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>
voidregisterPackHandler(Plugin plugin, Class<T> c, PackHandler<T> packHandler)Register packet handler for server-
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
-
registerPackHandler
public <T extends Packet> void registerPackHandler(Plugin plugin, Class<T> c, PackHandler<T> packHandler)
Description copied from interface:ClientReceiverRegister packet handler for server- Specified by:
registerPackHandlerin interfaceClientReceiver- Type Parameters:
T- the packet type- Parameters:
plugin- the pluginc- the packet classpackHandler- the packet handler
-
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
-
-