net.sourceforge.simplegamenet.framework.transport
Class ClientModem

java.lang.Object
  extended bynet.sourceforge.simplegamenet.framework.transport.Modem
      extended bynet.sourceforge.simplegamenet.framework.transport.ClientModem
All Implemented Interfaces:
net.sourceforge.simplegamenet.framework.transport.PacketCodes

public class ClientModem
extends net.sourceforge.simplegamenet.framework.transport.Modem
implements net.sourceforge.simplegamenet.framework.transport.PacketCodes


Field Summary
static int CHAT_ASK_MESSAGE
           
static int CHAT_GRANT_MESSAGE
           
static int CON_ADD_PLAYER
           
static int CON_BAN
           
static int CON_CLIENT_CON_CLOSE
           
static int CON_CLIENT_CON_OPEN
           
static int CON_CLIENT_PING
           
static int CON_CLIENT_PONG
           
static int CON_KICK
           
static int CON_LOGIN_DATA
           
static int CON_LOGIN_NICKNAME
           
static int CON_REMOVE_PLAYER_BY_BAN
           
static int CON_REMOVE_PLAYER_BY_CLIENT_VIOLATION
           
static int CON_REMOVE_PLAYER_BY_DISCONNECTION
           
static int CON_REMOVE_PLAYER_BY_KICK
           
static int CON_REMOVE_PLAYER_BY_LEFT
           
static int CON_REMOVE_PLAYER_BY_SERVER_VIOLATION
           
static int CON_SERVER_CON_CLOSE
           
static int CON_SERVER_CON_OPEN
           
static int CON_SERVER_PING
           
static int CON_SERVER_PONG
           
static int CON_SGN_VERSION
           
static int E_CHAT_MESSAGE
           
static int E_CON_BANNED
           
static int E_CON_CLIENT_CON_OPEN
           
static int E_CON_CLIENT_SGN_VERSION
           
static int E_CON_CLIENT_VIOLATION
           
static int E_CON_LOGIN
           
static int E_CON_SERVER_SGN_VERSION
           
static int E_CON_SERVER_VIOLATION
           
static int E_GAME_CHANGE_GAME_SETTINGS_GAME_IN_PROGRESS
           
static int E_GAME_CHANGE_GAME_SETTINGS_NOT_ACCEPTED
           
static int E_GAME_CHANGE_PLAYER_SETTINGS_GAME_IN_PROGRESS
           
static int E_GAME_CHANGE_PLAYER_SETTINGS_NOT_ACCEPTED
           
static int E_GAME_CLIENT_ABORT_GAME
           
static int E_GAME_CLIENT_GAME_VERSION
           
static int E_GAME_CLIENT_START_GAME
           
static int E_GAME_NOT_FOUND
           
static int E_GAME_SERVER_GAME_VERSION
           
static int GAME_CHANGE_GAME_SETTINGS
           
static int GAME_CHANGE_PLAYER_SETTINGS
           
static int GAME_CLIENT_ABORT_GAME
           
static int GAME_CLIENT_CONFIRM_GAME_ABORTING
           
static int GAME_CLIENT_CONFIRM_GAME_STOPPING
           
static int GAME_CLIENT_SEND_DATA
           
static int GAME_CLIENT_START_GAME
           
static int GAME_OPEN
           
static int GAME_SERVER_GAME_ABORTING
           
static int GAME_SERVER_GAME_ENDED
           
static int GAME_SERVER_GAME_STARTED
           
static int GAME_SERVER_GAME_STOPPING
           
static int GAME_SERVER_SEND_DATA
           
static int GAME_UPDATE_GAME_SETTINGS
           
static int GAME_UPDATE_PLAYER_SETTINGS
           
protected  Integer nextPingID
           
protected  HashMap pingIDMap
           
protected  TaskQueue taskQueue
           
 
Constructor Summary
ClientModem(ClientEngineImpl clientEngine, Socket socket, ObjectInputStream objectInputStream, ObjectOutputStream objectOutputStream)
           
 
Method Summary
 void abortGame()
           
 void changeGameSettings(net.sourceforge.simplegamenet.specs.to.GameSettings gameSettings)
           
 void changePlayerSettings(net.sourceforge.simplegamenet.specs.to.PlayerSettings playerSettings)
           
 void leaveProtocolViolatingServer()
           
 void leaveServer()
           
 void processDisconnection()
           
 void processDisconnectionInEventThread()
           
 void processPacket(Packet packet)
           
 void processPacketInEventThread(Packet packet)
           
 void sendChatMessage(ChatMessage chatMessage)
           
 void sendData(Serializable data)
           
 void startGame()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CON_CLIENT_CON_OPEN

public static final int CON_CLIENT_CON_OPEN
See Also:
Constant Field Values

E_CON_BANNED

public static final int E_CON_BANNED
See Also:
Constant Field Values

E_CON_CLIENT_CON_OPEN

public static final int E_CON_CLIENT_CON_OPEN
See Also:
Constant Field Values

CON_SERVER_CON_OPEN

public static final int CON_SERVER_CON_OPEN
See Also:
Constant Field Values

CON_SGN_VERSION

public static final int CON_SGN_VERSION
See Also:
Constant Field Values

E_CON_CLIENT_SGN_VERSION

public static final int E_CON_CLIENT_SGN_VERSION
See Also:
Constant Field Values

E_CON_SERVER_SGN_VERSION

public static final int E_CON_SERVER_SGN_VERSION
See Also:
Constant Field Values

GAME_OPEN

public static final int GAME_OPEN
See Also:
Constant Field Values

E_GAME_NOT_FOUND

public static final int E_GAME_NOT_FOUND
See Also:
Constant Field Values

E_GAME_CLIENT_GAME_VERSION

public static final int E_GAME_CLIENT_GAME_VERSION
See Also:
Constant Field Values

E_GAME_SERVER_GAME_VERSION

public static final int E_GAME_SERVER_GAME_VERSION
See Also:
Constant Field Values

CON_LOGIN_NICKNAME

public static final int CON_LOGIN_NICKNAME
See Also:
Constant Field Values

E_CON_LOGIN

public static final int E_CON_LOGIN
See Also:
Constant Field Values

CON_LOGIN_DATA

public static final int CON_LOGIN_DATA
See Also:
Constant Field Values

CON_CLIENT_PING

public static final int CON_CLIENT_PING
See Also:
Constant Field Values

CON_SERVER_PONG

public static final int CON_SERVER_PONG
See Also:
Constant Field Values

CON_SERVER_PING

public static final int CON_SERVER_PING
See Also:
Constant Field Values

CON_CLIENT_PONG

public static final int CON_CLIENT_PONG
See Also:
Constant Field Values

CHAT_ASK_MESSAGE

public static final int CHAT_ASK_MESSAGE
See Also:
Constant Field Values

E_CHAT_MESSAGE

public static final int E_CHAT_MESSAGE
See Also:
Constant Field Values

CHAT_GRANT_MESSAGE

public static final int CHAT_GRANT_MESSAGE
See Also:
Constant Field Values

GAME_CHANGE_GAME_SETTINGS

public static final int GAME_CHANGE_GAME_SETTINGS
See Also:
Constant Field Values

E_GAME_CHANGE_GAME_SETTINGS_GAME_IN_PROGRESS

public static final int E_GAME_CHANGE_GAME_SETTINGS_GAME_IN_PROGRESS
See Also:
Constant Field Values

E_GAME_CHANGE_GAME_SETTINGS_NOT_ACCEPTED

public static final int E_GAME_CHANGE_GAME_SETTINGS_NOT_ACCEPTED
See Also:
Constant Field Values

GAME_UPDATE_GAME_SETTINGS

public static final int GAME_UPDATE_GAME_SETTINGS
See Also:
Constant Field Values

CON_ADD_PLAYER

public static final int CON_ADD_PLAYER
See Also:
Constant Field Values

GAME_CHANGE_PLAYER_SETTINGS

public static final int GAME_CHANGE_PLAYER_SETTINGS
See Also:
Constant Field Values

E_GAME_CHANGE_PLAYER_SETTINGS_GAME_IN_PROGRESS

public static final int E_GAME_CHANGE_PLAYER_SETTINGS_GAME_IN_PROGRESS
See Also:
Constant Field Values

E_GAME_CHANGE_PLAYER_SETTINGS_NOT_ACCEPTED

public static final int E_GAME_CHANGE_PLAYER_SETTINGS_NOT_ACCEPTED
See Also:
Constant Field Values

GAME_UPDATE_PLAYER_SETTINGS

public static final int GAME_UPDATE_PLAYER_SETTINGS
See Also:
Constant Field Values

CON_CLIENT_CON_CLOSE

public static final int CON_CLIENT_CON_CLOSE
See Also:
Constant Field Values

CON_REMOVE_PLAYER_BY_LEFT

public static final int CON_REMOVE_PLAYER_BY_LEFT
See Also:
Constant Field Values

CON_KICK

public static final int CON_KICK
See Also:
Constant Field Values

CON_REMOVE_PLAYER_BY_KICK

public static final int CON_REMOVE_PLAYER_BY_KICK
See Also:
Constant Field Values

CON_BAN

public static final int CON_BAN
See Also:
Constant Field Values

CON_REMOVE_PLAYER_BY_BAN

public static final int CON_REMOVE_PLAYER_BY_BAN
See Also:
Constant Field Values

CON_REMOVE_PLAYER_BY_DISCONNECTION

public static final int CON_REMOVE_PLAYER_BY_DISCONNECTION
See Also:
Constant Field Values

E_CON_CLIENT_VIOLATION

public static final int E_CON_CLIENT_VIOLATION
See Also:
Constant Field Values

CON_REMOVE_PLAYER_BY_CLIENT_VIOLATION

public static final int CON_REMOVE_PLAYER_BY_CLIENT_VIOLATION
See Also:
Constant Field Values

E_CON_SERVER_VIOLATION

public static final int E_CON_SERVER_VIOLATION
See Also:
Constant Field Values

CON_REMOVE_PLAYER_BY_SERVER_VIOLATION

public static final int CON_REMOVE_PLAYER_BY_SERVER_VIOLATION
See Also:
Constant Field Values

CON_SERVER_CON_CLOSE

public static final int CON_SERVER_CON_CLOSE
See Also:
Constant Field Values

GAME_CLIENT_START_GAME

public static final int GAME_CLIENT_START_GAME
See Also:
Constant Field Values

E_GAME_CLIENT_START_GAME

public static final int E_GAME_CLIENT_START_GAME
See Also:
Constant Field Values

GAME_SERVER_GAME_STARTED

public static final int GAME_SERVER_GAME_STARTED
See Also:
Constant Field Values

GAME_CLIENT_SEND_DATA

public static final int GAME_CLIENT_SEND_DATA
See Also:
Constant Field Values

GAME_SERVER_SEND_DATA

public static final int GAME_SERVER_SEND_DATA
See Also:
Constant Field Values

GAME_CLIENT_ABORT_GAME

public static final int GAME_CLIENT_ABORT_GAME
See Also:
Constant Field Values

E_GAME_CLIENT_ABORT_GAME

public static final int E_GAME_CLIENT_ABORT_GAME
See Also:
Constant Field Values

GAME_SERVER_GAME_STOPPING

public static final int GAME_SERVER_GAME_STOPPING
See Also:
Constant Field Values

GAME_SERVER_GAME_ABORTING

public static final int GAME_SERVER_GAME_ABORTING
See Also:
Constant Field Values

GAME_CLIENT_CONFIRM_GAME_STOPPING

public static final int GAME_CLIENT_CONFIRM_GAME_STOPPING
See Also:
Constant Field Values

GAME_CLIENT_CONFIRM_GAME_ABORTING

public static final int GAME_CLIENT_CONFIRM_GAME_ABORTING
See Also:
Constant Field Values

GAME_SERVER_GAME_ENDED

public static final int GAME_SERVER_GAME_ENDED
See Also:
Constant Field Values

taskQueue

protected TaskQueue taskQueue

nextPingID

protected Integer nextPingID

pingIDMap

protected HashMap pingIDMap
Constructor Detail

ClientModem

public ClientModem(ClientEngineImpl clientEngine,
                   Socket socket,
                   ObjectInputStream objectInputStream,
                   ObjectOutputStream objectOutputStream)
Method Detail

processPacketInEventThread

public void processPacketInEventThread(Packet packet)

processPacket

public void processPacket(Packet packet)

sendChatMessage

public void sendChatMessage(ChatMessage chatMessage)

changeGameSettings

public void changeGameSettings(net.sourceforge.simplegamenet.specs.to.GameSettings gameSettings)

changePlayerSettings

public void changePlayerSettings(net.sourceforge.simplegamenet.specs.to.PlayerSettings playerSettings)

startGame

public void startGame()

sendData

public void sendData(Serializable data)

abortGame

public void abortGame()

leaveServer

public void leaveServer()

leaveProtocolViolatingServer

public void leaveProtocolViolatingServer()

processDisconnectionInEventThread

public void processDisconnectionInEventThread()

processDisconnection

public void processDisconnection()


Copyright © 2003-2004 The 3 Belgians. All Rights Reserved.