|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--thegame.shared.GameConnection | +--thegame.server.GameServerConnection
The connection to GameClient on the GameServer side.
Field Summary | |
protected GameServer |
gameServer
The GameServer the GameServerConnection sends messages to. |
protected boolean |
isPlayerDrawingCircles
Is true if the player is drawing circles; is false if the player is drawing crosses. |
protected boolean |
isReadyForPlayerList
Is true if the player is ready to receive a playerlist; is false otherwise. |
protected boolean |
isWaiting
Is true when the player is waiting for a joining player; is false otherwise. |
protected java.lang.String |
playerName
The name of the player on the GameClient side. |
protected GameServerConnection |
remotePlayer
The GameServerConnection referencing the remote player. |
Fields inherited from class thegame.shared.GameConnection |
in, isRunning, out, socket |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
GameServerConnection(java.net.Socket socket,
GameServer gameServer)
Constructs a GameServerConnection on the specified socket and binds it to the specified GameServer. |
Method Summary | |
boolean |
getPlayerDrawingCircles()
Returns the isPlayerDrawingCircles property. |
java.lang.String |
getPlayerName()
Returns the name of the player on the GameClient side |
GameServerConnection |
getRemotePlayer()
Returns the remotePlayer property. |
boolean |
isReadyForPlayerList()
Returns the isReadyForPlayerList property. |
boolean |
isWaiting()
Returns the isWaiting property. |
void |
run()
The socket is listened on and if a message arrives, it is sent either to gameServer, to remotePlayer, or is discarded. |
void |
setPlayerDrawingCircles(boolean isPlayerDrawingCircles)
Sets the isPlayerDrawingCircles property. |
void |
setPlayerName(java.lang.String playerName)
Sets the name of the player on the GameClient side |
void |
setReadyForPlayerList(boolean isReadyForPlayerList)
Sets the isReadyForPlayerList property. |
void |
setRemotePlayer(GameServerConnection remotePlayer)
Sets the remotePlayer property. |
void |
setWaiting(boolean isWaiting)
Sets the isWaiting property. |
Methods inherited from class thegame.shared.GameConnection |
close, getMessageBody, getMessageContentsAs1DIntArray, getMessageContentsAs1DStringArray, getMessageContentsAs2DIntArray, getMessageContentsAsBoolean, getMessageID, getReadyToSendForm, send, send, send, send, send, send, setRunning |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected GameServer gameServer
protected boolean isPlayerDrawingCircles
protected boolean isReadyForPlayerList
protected boolean isWaiting
protected java.lang.String playerName
protected GameServerConnection remotePlayer
Constructor Detail |
public GameServerConnection(java.net.Socket socket, GameServer gameServer) throws java.io.IOException
socket
- the socket to be used (must be already initialized)gameServer
- the GameServer to send messages tojava.io.IOException
- if an I/O error occurs when constructing the superclassMethod Detail |
public boolean getPlayerDrawingCircles()
public java.lang.String getPlayerName()
public GameServerConnection getRemotePlayer()
public boolean isReadyForPlayerList()
public boolean isWaiting()
public void run()
run
in class java.lang.Thread
public void setPlayerDrawingCircles(boolean isPlayerDrawingCircles)
isPlayerDrawingCircles
- true if the player is drawing circles; false it the player is drawing crossespublic void setPlayerName(java.lang.String playerName)
playerName
- the name of the player on the GameClient sidepublic void setReadyForPlayerList(boolean isReadyForPlayerList)
isReadyForPlayerList
- true if the player is ready for playerlist; false otherwisepublic void setRemotePlayer(GameServerConnection remotePlayer)
remotePlayer
- the GameServerConnection referencing the remote playerpublic void setWaiting(boolean isWaiting)
isWaiting
- true if the player is set waiting; false otherwise
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |