Interface BasicHandshakePacketDispatcher
-
- All Superinterfaces:
PacketDispatcher,TransactionalPacketDispatcher
public interface BasicHandshakePacketDispatcher extends TransactionalPacketDispatcher
Represents the packet dispatcher of theServerSideConnectionEvent.Handshakephase.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default booleanisSupportedBy(EngineConnection connection)Deprecated.Is currently not supported by the basic packet channel during the handshake phasejava.util.concurrent.CompletableFuture<java.lang.Void>sendToServer(Packet packet)Deprecated.Is currently not supported by the basic packet channel<R extends Packet>
java.util.concurrent.CompletableFuture<R>sendToServer(RequestPacket<R> packet)Deprecated.Is currently not supported by the basic packet channel-
Methods inherited from interface org.spongepowered.api.network.channel.packet.PacketDispatcher
sendTo, sendTo, sendToAllPlayers, sendToAllPlayersIn
-
Methods inherited from interface org.spongepowered.api.network.channel.packet.TransactionalPacketDispatcher
sendTo, sendTo
-
-
-
-
Method Detail
-
isSupportedBy
@Deprecated default boolean isSupportedBy(EngineConnection connection)
Deprecated.Is currently not supported by the basic packet channel during the handshake phaseGets whether the packet channel this dispatcher belongs to is supported by the givenEngineConnection.A packet channel is supported if the other side of the connection also supports the channel.
The basic packet channel is currently not aware whether it's supported during the handshake phase. The dispatcher assumes that a basic channel is always supported during the handshake phase.
- Specified by:
isSupportedByin interfacePacketDispatcher- Parameters:
connection- The connection to check- Returns:
- Whether the packet channel is supported
-
sendToServer
@Deprecated <R extends Packet> java.util.concurrent.CompletableFuture<R> sendToServer(RequestPacket<R> packet)
Deprecated.Is currently not supported by the basic packet channelSends thePacketto the server using this channel. This method returns aCompletableFuturethat will be accepted once the response is received.The
CompletableFuturemay fail exceptionally by aNoResponseExceptionif there wasn't a valid response received for the given request.A exception will be thrown if the specified packet type isn't registered in this
PacketChannel.The basic packet channel doesn't currently support packets to be send to the server during the handshake phase. Only responses to requests by the server are possible.
- Specified by:
sendToServerin interfaceTransactionalPacketDispatcher- Type Parameters:
R- The type of the response packet- Parameters:
packet- The packet to send to the server- Returns:
- The completable future to handle the response packet and exceptions
-
sendToServer
@Deprecated java.util.concurrent.CompletableFuture<java.lang.Void> sendToServer(Packet packet)
Deprecated.Is currently not supported by the basic packet channelSends thePacketto the server.Calling this during the login phase is currently not supported, only responses to
RequestPackets byRequestPacketHandlers are. Doing so will result in aIllegalStateExceptionwhen attempting to use the method.A exception will be thrown if the specified packet type isn't registered in the
PacketChannelthis dispatcher belongs to.The basic packet channel currently doesn't support packets to be send to the server during the handshake phase. Only responses to requests by the server are possible.
- Specified by:
sendToServerin interfacePacketDispatcher- Parameters:
packet- The packet to send- Returns:
- A future which will complete when the operation has finished
-
-