|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--monrovia.server.core.ProtocolHandlerImpl
Implementation of the protocol handler.
Inner Class Summary | |
class |
ProtocolHandlerImpl.SocketKey
|
Constructor Summary | |
ProtocolHandlerImpl(PlayerDataImpl pPlayerData,
GameDataImpl pGameData)
Constructor. |
Method Summary | |
int |
addClient(java.lang.String pName,
java.lang.String pPassword,
java.lang.String pAddress,
int pPort,
ServerTcpSender pTcpSender,
ServerUdpSender pUdpSender)
addClient adds pClientName with pClientAddress and pClientPort as well as this clients udpsender and tcp sender to active clients returning an unique pClientID if pClientPassword is correct, if not returns 0, returns 0 also when client is already logged in |
void |
command(int pClientID,
int pCommandID)
command: pClientID wishes to execute pCommandID |
void |
command(int pClientID,
int pCommandID,
int pArg)
command: pClientID wishes to execute pCommandID with argumet pArg1 |
void |
command(int pClientID,
int pCommandID,
int pArg1,
int pArg2)
command: pClientID wishes to execute pCommandID with argument pArg1 and pArg2 |
void |
command(int pClientID,
int pCommandID,
java.lang.String pArg)
command: pClientID wishes to execute pCommandID with argument pArg1 (string) |
byte[][] |
getBitmaps(int pClientID)
getBitmaps returns an array of byte[], each of which is a bitmap |
int |
getClientID(java.lang.String pAddress,
int pPort)
getClientID returns the clientID identified by pClientAddress and pClientPort. |
Command[] |
getCommands(int pClientID)
getCommands returns an array of strings, each of which is the commands text |
int[][] |
getMap(int pClientID)
getMap returns the Map of pClientID |
Stat[] |
getStats(int pClientID)
getStats return the Stats of pClientID |
int |
getTurn(int pClientID)
getTurn returns the ClientID:s turn |
void |
removeClient(int pClientID)
removeClient remove pClientID from active clients |
void |
setTurn(int pClientID,
int pTurn)
setTurn sets ClientID:s turn |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProtocolHandlerImpl(PlayerDataImpl pPlayerData, GameDataImpl pGameData)
Method Detail |
public int[][] getMap(int pClientID)
ProtocolHandler
getMap
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the id of the clientpublic Command[] getCommands(int pClientID)
ProtocolHandler
getCommands
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the id of the clientpublic byte[][] getBitmaps(int pClientID)
ProtocolHandler
getBitmaps
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the id of the clientpublic Stat[] getStats(int pClientID)
ProtocolHandler
getStats
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the id of the clientpublic int addClient(java.lang.String pName, java.lang.String pPassword, java.lang.String pAddress, int pPort, ServerTcpSender pTcpSender, ServerUdpSender pUdpSender)
ProtocolHandler
addClient
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientName
- the user name of the clientpClientPassword
- the clients passwordpClientAddress
- the ip address of the clientpClientPort
- the port of the clientpTcpSender
- the tcpsender for this clientpUdpSender
- the udpsender for this clientpublic void removeClient(int pClientID)
ProtocolHandler
removeClient
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the clients idpublic int getClientID(java.lang.String pAddress, int pPort)
ProtocolHandler
getClientID
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientAddress
- the ip address of the clientthe
- port of the clientpublic int getTurn(int pClientID)
ProtocolHandler
getTurn
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the id of the clientpublic void setTurn(int pClientID, int pTurn)
ProtocolHandler
setTurn
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the clients idpTurn
- the turn to be setpublic void command(int pClientID, int pCommandID)
ProtocolHandler
command
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the clients idpCommandID
- the id of the commandpublic void command(int pClientID, int pCommandID, int pArg)
ProtocolHandler
command
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the clients idpCommandID
- the id of the commandpArg1
- the value of the argumentpublic void command(int pClientID, int pCommandID, int pArg1, int pArg2)
ProtocolHandler
command
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the clients idpCommandID
- the id of the commandpArg1
- the value of the first argumentpArg2
- the value of the second argumentpublic void command(int pClientID, int pCommandID, java.lang.String pArg)
ProtocolHandler
command
in interface ProtocolHandler
monrovia.protocol.server.ProtocolHandler
pClientID
- the clients idpCommandID
- the id of the commandpArg1
- the value of the argument
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |