Package top.focess.qq.api.net
Interface ClientReceiver
-
-
Method Summary
All Methods Instance Methods Abstract 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 servervoidsendPacket(Packet packet)Send the packet to the server-
Methods inherited from interface top.focess.qq.api.net.Receiver
close, unregister, unregisterAll
-
-
-
-
Method Detail
-
sendPacket
void sendPacket(Packet packet)
Send the packet to the server- Parameters:
packet- the packet
-
register
<T extends Packet> void register(Plugin plugin, Class<T> c, PackHandler<T> packHandler)
Register packet handler for server- Type Parameters:
T- the packet type- Parameters:
c- the packet classpackHandler- the packet handlerplugin- the plugin
-
getName
String getName()
Get the name of the client- Returns:
- the name of the client
-
getHost
String getHost()
Get the target host of the client- Returns:
- the target host of the client
-
getPort
int getPort()
Get the target port of the client- Returns:
- the target port of the client
-
isConnected
boolean isConnected()
Indicate this client has connected to a server- Returns:
- true if the client has connected to a server, false otherwise
-
getClientId
int getClientId()
Get the client id- Returns:
- the client id
-
getClientToken
String getClientToken()
Get the client token- Returns:
- the client token
-
-