vooga.network.ingame
Class VoogaGameServer

java.lang.Object
  extended by java.lang.Thread
      extended by vooga.network.VoogaServer
          extended by vooga.network.ingame.VoogaGameServer
All Implemented Interfaces:
java.lang.Runnable

public class VoogaGameServer
extends VoogaServer

VoogaGameSessionServer manages clients in a game session.

Author:
sam1, tgr3, tws10

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class vooga.network.VoogaServer
SERVER
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
VoogaGameServer()
           
 
Method Summary
 void addUserToSession(long channelID, java.lang.String userName)
          Adds client user to a game session.
 void initialize()
          Allows subclasses to perform an additional initialization after the server has been constructed and started listening.
protected  void intializeConnection(java.lang.String clientName, java.net.Socket clientSocket)
          Allows server subclasses to implement additional initialization for a user connection, such as starting a server thread to receive input from that client.
static void main(java.lang.String[] args)
           
 void removeUserFromSession(long sessionID, java.lang.String userName)
          Removes client user from a game session.
 void sendToSession(long channelID, java.lang.String sender, java.lang.Object obj)
          Sends update to a clients in a game session.
 
Methods inherited from class vooga.network.VoogaServer
getAllConnectedUsers, getInStream, getMySocket, getOutStream, listeningToSocket, removeConnection, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Constructor Detail

VoogaGameServer

public VoogaGameServer()
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

initialize

public void initialize()
Description copied from class: VoogaServer
Allows subclasses to perform an additional initialization after the server has been constructed and started listening.

Specified by:
initialize in class VoogaServer

addUserToSession

public void addUserToSession(long channelID,
                             java.lang.String userName)
Adds client user to a game session.

Parameters:
channelID - unique game session identifier.
userName - to be added to unique game session.

removeUserFromSession

public void removeUserFromSession(long sessionID,
                                  java.lang.String userName)
Removes client user from a game session.

Parameters:
sessionID - unique session identifier
userName - to be removed to unique game session.

sendToSession

public void sendToSession(long channelID,
                          java.lang.String sender,
                          java.lang.Object obj)
Sends update to a clients in a game session.

Parameters:
channelID - unique session identifier.
sender - sender in the game session.
object - update to be sent.

intializeConnection

protected void intializeConnection(java.lang.String clientName,
                                   java.net.Socket clientSocket)
Description copied from class: VoogaServer
Allows server subclasses to implement additional initialization for a user connection, such as starting a server thread to receive input from that client.

Specified by:
intializeConnection in class VoogaServer

main

public static void main(java.lang.String[] args)