Interface BasicHandshakePacketDispatcher

    • Method Detail

      • isSupportedBy

        @Deprecated
        default boolean isSupportedBy​(EngineConnection connection)
        Deprecated.
        Is currently not supported by the basic packet channel during the handshake phase
        Gets whether the packet channel this dispatcher belongs to is supported by the given EngineConnection.

        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 interface PacketDispatcher
        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 channel
        Sends the Packet to the server using this channel. This method returns a CompletableFuture that will be accepted once the response is received.

        The CompletableFuture may fail exceptionally by a NoResponseException 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 interface TransactionalPacketDispatcher
        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 channel
        Sends the Packet to the server.

        Calling this during the login phase is currently not supported, only responses to RequestPackets by RequestPacketHandlers are. Doing so will result in a IllegalStateException 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 interface PacketDispatcher
        Parameters:
        packet - The packet to send
        Returns:
        A future which will complete when the operation has finished