Interface BasicHandshakePacketDispatcher
- All Superinterfaces:
PacketDispatcher
,TransactionalPacketDispatcher
ServerSideConnectionEvent.Handshake
phase.-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
isSupportedBy
(EngineConnection connection) Deprecated.Is currently not supported by the basic packet channel during the handshake phasesendToServer
(Packet packet) Deprecated.Is currently not supported by the basic packet channel<R extends Packet>
CompletableFuture<R>sendToServer
(RequestPacket<R> packet) Deprecated.Is currently not supported by the basic packet channelMethods 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 Details
-
isSupportedBy
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:
isSupportedBy
in interfacePacketDispatcher
- Parameters:
connection
- The connection to check- Returns:
- Whether the packet channel is supported
-
sendToServer
Deprecated.Is currently not supported by the basic packet channelSends thePacket
to the server using this channel. This method returns aCompletableFuture
that will be accepted once the response is received.The
CompletableFuture
may fail exceptionally by aNoResponseException
if 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:
sendToServer
in 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.Is currently not supported by the basic packet channelSends thePacket
to the server.Calling this during the login phase is currently not supported, only responses to
RequestPacket
s byRequestPacketHandler
s are. Doing so will result in aIllegalStateException
when attempting to use the method.A exception will be thrown if the specified packet type isn't registered in the
PacketChannel
this 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:
sendToServer
in interfacePacketDispatcher
- Parameters:
packet
- The packet to send- Returns:
- A future which will complete when the operation has finished
-