|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--monrovia.protocol.server.ServerUdpSender
This class is used to send UDP message to a single client.
Constructor Summary | |
ServerUdpSender(java.io.BufferedOutputStream pOutputStream)
Constructor |
|
ServerUdpSender(java.net.DatagramSocket pDatagramSocket,
java.net.InetAddress pInetAddress,
int pClientPort)
Constructor |
Method Summary | |
void |
addCommand(Command pCmd)
addCommand adds or removes a command to the clients command collection |
void |
addMessage(java.lang.String pMessage)
addMessage sends a message to the client |
void |
addObject(int pId,
int pXDelta,
int pYDelta)
addObject sets a dynamic object to a location |
void |
addStat(int pStatID,
int pValue)
addStat informs the client of a changed int stat |
void |
addStat(int pStatID,
java.lang.String pValue)
addStat informs the client of a change string stat |
void |
flush()
flush sends the packet to the client |
void |
newTurn(int pXMap,
int pYMap)
newTurn initializes a new udp message |
void |
startSending()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServerUdpSender(java.net.DatagramSocket pDatagramSocket, java.net.InetAddress pInetAddress, int pClientPort)
pDatagramSocket
- an already allocated DatagramSocketpInetAddress
- the address of the receiverpClientPort
- the port of the receiverpublic ServerUdpSender(java.io.BufferedOutputStream pOutputStream)
pDataOutpuStream
- the outputstreamMethod Detail |
public void startSending()
public void newTurn(int pXMap, int pYMap)
pXMap
- the x coordinate where the client is nowpYMap
- the y coordinatepublic void flush()
public void addObject(int pId, int pXDelta, int pYDelta)
pId
- the object idpXDelta
- the x distance from the playerpYDelta
- the y distancepublic void addStat(int pStatID, int pValue)
pStatID
- the stats idpValue
- the valuepublic void addStat(int pStatID, java.lang.String pValue)
pStatID
- the stats idpValue
- the valuepublic void addCommand(Command pCmd)
pCmd
- the command to be sentpublic void addMessage(java.lang.String pMessage)
pMessage
- the message to be sent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |