Interface ServerReceiver

    • Method Detail

      • sendPacket

        void sendPacket​(String client,
                        Packet packet)
        Send packet to the special client
        Parameters:
        client - the client name
        packet - the packet
      • register

        <T extends Packet> void register​(Plugin plugin,
                                         String client,
                                         Class<T> c,
                                         PackHandler<T> packHandler)
        Register packet handler for special client
        Type Parameters:
        T - the packet type
        Parameters:
        client - the client name
        c - the packet class
        packHandler - the packet handler
        plugin - the plugin
      • isConnected

        boolean isConnected​(String client)
        Indicate the client is connected to server
        Parameters:
        client - the client name
        Returns:
        true if the client is connected to server, false otherwise
      • getClient

        @Nullable
        Client getClient​(String name)
        Get the client by given name
        Parameters:
        name - the client name
        Returns:
        the client