Package top.focess.qq.core.net
Class AClientReceiver
- java.lang.Object
-
- top.focess.qq.core.net.AClientReceiver
-
- All Implemented Interfaces:
ClientReceiver,Receiver
- Direct Known Subclasses:
FocessClientReceiver,FocessSidedClientReceiver
public abstract class AClientReceiver extends Object implements ClientReceiver
-
-
Constructor Summary
Constructors Constructor Description AClientReceiver(String host, int port, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetClientId()Get the client idStringgetClientToken()Get the client tokenStringgetHost()Get the target host of the clientStringgetName()Get the name of the clientintgetPort()Get the target port of the clientbooleanisConnected()Indicate this client has connected to a server<T extends Packet>
voidregister(Plugin plugin, Class<T> c, PackHandler<T> packHandler)Register packet handler for servervoidunregister(Plugin plugin)Unregister the packet handlers of the pluginbooleanunregisterAll()Unregister all the packet handlers-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface top.focess.qq.api.net.ClientReceiver
sendPacket
-
-
-
-
Method Detail
-
register
public <T extends Packet> void register(Plugin plugin, Class<T> c, PackHandler<T> packHandler)
Description copied from interface:ClientReceiverRegister packet handler for server- Specified by:
registerin interfaceClientReceiver- Type Parameters:
T- the packet type- Parameters:
plugin- the pluginc- the packet classpackHandler- the packet handler
-
unregister
public void unregister(Plugin plugin)
Description copied from interface:ReceiverUnregister the packet handlers of the plugin- Specified by:
unregisterin interfaceReceiver- Parameters:
plugin- the plugin
-
unregisterAll
public boolean unregisterAll()
Description copied from interface:ReceiverUnregister all the packet handlers- Specified by:
unregisterAllin interfaceReceiver- Returns:
- true if there are some packet-handlers not belonging to MainPlugin not been unregistered, false otherwise
-
getHost
public String getHost()
Description copied from interface:ClientReceiverGet the target host of the client- Specified by:
getHostin interfaceClientReceiver- Returns:
- the target host of the client
-
getPort
public int getPort()
Description copied from interface:ClientReceiverGet the target port of the client- Specified by:
getPortin interfaceClientReceiver- Returns:
- the target port of the client
-
isConnected
public boolean isConnected()
Description copied from interface:ClientReceiverIndicate this client has connected to a server- Specified by:
isConnectedin interfaceClientReceiver- Returns:
- true if the client has connected to a server, false otherwise
-
getClientId
public int getClientId()
Description copied from interface:ClientReceiverGet the client id- Specified by:
getClientIdin interfaceClientReceiver- Returns:
- the client id
-
getClientToken
public String getClientToken()
Description copied from interface:ClientReceiverGet the client token- Specified by:
getClientTokenin interfaceClientReceiver- Returns:
- the client token
-
getName
public String getName()
Description copied from interface:ClientReceiverGet the name of the client- Specified by:
getNamein interfaceClientReceiver- Returns:
- the name of the client
-
-