monrovia.client.protocol
Interface ClientProtocolHandler

All Known Implementing Classes:
MonroviaClient

public interface ClientProtocolHandler

The ClientProtocolHandler handles the protocols communication to the client


Method Summary
 void arena(short[][] pMapBytes, short[][] pBitmapBytes, Command[] pMapCommands, Stat[] pPlayerStats)
          gives the server the arena and player information, used when entering an arena
 void changedStat(int pStatID, int pStatValue)
          sets stat pStatID to pStatValue (int)
 void changedStat(int pStatID, java.lang.String pStatValue)
          sets stat pStatID to pStatValue (string)
 void command(Command pCommand)
          adds or removes a command
 void connectionError(java.lang.String pMessage)
          the connectionError method is called when an error occurs while connecting
 void giveSenders(UdpSender pUdpSender, TcpSender pTcpSender)
          gives the protocol handler the senders
 void newLocation(int pXMap, int pYMap)
          sets the location of the player in this arena
 void newMessage(java.lang.String pMessage)
          adds new message
 void newObject(int pBitmapID, int pXDelta, int pYDelta)
          adds new map object
 void refresh()
          refresh tells the client that all the info for turn has arrived
 void serverExit()
          informs that the server has exited/killed our connect
 void serverReconnect()
          informs that the server wishes a reconnect (new connect via tcp and udp) purpose: arena change
 

Method Detail

giveSenders

public void giveSenders(UdpSender pUdpSender,
                        TcpSender pTcpSender)
gives the protocol handler the senders
Parameters:
pUdpSender - the udpsender for the client
pTcpSender - the tcpsender for the client

arena

public void arena(short[][] pMapBytes,
                  short[][] pBitmapBytes,
                  Command[] pMapCommands,
                  Stat[] pPlayerStats)
gives the server the arena and player information, used when entering an arena
Parameters:
pMapBytes - gives the client the new map
pBitmapBytes - gives the client the new bitmaps
pMapCommands - gives the client the new commands for this map
pPlayerStats - gives the client the stats of the player

serverExit

public void serverExit()
informs that the server has exited/killed our connect

serverReconnect

public void serverReconnect()
informs that the server wishes a reconnect (new connect via tcp and udp) purpose: arena change

refresh

public void refresh()
refresh tells the client that all the info for turn has arrived

newLocation

public void newLocation(int pXMap,
                        int pYMap)
sets the location of the player in this arena
Parameters:
pXMap - the x coordinate on the map
pYMap - the y coordinate on the map

changedStat

public void changedStat(int pStatID,
                        int pStatValue)
sets stat pStatID to pStatValue (int)
Parameters:
pStatID - the id of the stat to be set
pStatValue - the value that the stat should take

changedStat

public void changedStat(int pStatID,
                        java.lang.String pStatValue)
sets stat pStatID to pStatValue (string)
Parameters:
pStatID - the id of the stat to be set
pStatValue - the value of the stat to be set

command

public void command(Command pCommand)
adds or removes a command
Parameters:
pCommand - the command

newMessage

public void newMessage(java.lang.String pMessage)
adds new message
Parameters:
pMessage - the message

newObject

public void newObject(int pBitmapID,
                      int pXDelta,
                      int pYDelta)
adds new map object
Parameters:
pBitmapID - the id of the bitmap to be displayed
pXDelta - the x distance from the player
pYDelta - the y distance from the player

connectionError

public void connectionError(java.lang.String pMessage)
the connectionError method is called when an error occurs while connecting
Parameters:
pMessage - the message of the error