Class AServerReceiver

    • Constructor Detail

      • AServerReceiver

        public AServerReceiver()
    • Method Detail

      • isConnected

        public boolean isConnected​(String client)
        Description copied from interface: ServerReceiver
        Indicate the client is connected to server
        Specified by:
        isConnected in interface ServerReceiver
        Parameters:
        client - the client name
        Returns:
        true if the client is connected to server, false otherwise
      • getClient

        @Nullable
        public Client getClient​(String name)
        Description copied from interface: ServerReceiver
        Get the client by given name
        Specified by:
        getClient in interface ServerReceiver
        Parameters:
        name - the client name
        Returns:
        the client
      • generateToken

        protected static String generateToken()
      • registerPackHandler

        public <T extends Packet> void registerPackHandler​(Plugin plugin,
                                                           String name,
                                                           Class<T> c,
                                                           PackHandler<T> packHandler)
        Description copied from interface: ServerReceiver
        Register packet handler for special client
        Specified by:
        registerPackHandler in interface ServerReceiver
        Type Parameters:
        T - the packet type
        Parameters:
        plugin - the plugin
        name - the client name
        c - the packet class
        packHandler - the packet handler