org.xistrat.net
Class PlayerServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.xistrat.net.PlayerServer
All Implemented Interfaces:
java.lang.Runnable, Server

public class PlayerServer
extends java.lang.Thread
implements java.lang.Runnable, Server

Server that handles interaction with a SINGLE client. It is created by F4Daemon to handle a point-to-point communication with a client.

Since:
0.5.42

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 java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PlayerServer(java.net.Socket s, byte id, F4Daemon dmon, boolean v)
           
 
Method Summary
 void abort()
           
 void closeSocket()
           
 void doStop()
           
 void gameList()
          MESSAGE HANDLING
 int getStatus()
           
 void login(java.lang.String gameName, java.lang.String _alias)
           
 void logout()
           
 void lose(java.lang.String winner)
           
 void move(int from, int to)
           
 void newGame(java.lang.String gameName, java.lang.String position, java.lang.String komi)
           
 void pass()
           
 void put(int to)
           
 void remove(int loc)
           
 void run()
           
 void setAlias(java.lang.String alias)
           
 void setStatus(int state)
           
 void undo(int num)
           
 void win()
           
 
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

PlayerServer

public PlayerServer(java.net.Socket s,
                    byte id,
                    F4Daemon dmon,
                    boolean v)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

doStop

public void doStop()

setAlias

public void setAlias(java.lang.String alias)

getStatus

public int getStatus()

setStatus

public void setStatus(int state)

win

public void win()

lose

public void lose(java.lang.String winner)

closeSocket

public void closeSocket()

gameList

public void gameList()
MESSAGE HANDLING

Specified by:
gameList in interface Server

newGame

public void newGame(java.lang.String gameName,
                    java.lang.String position,
                    java.lang.String komi)
Specified by:
newGame in interface Server

login

public void login(java.lang.String gameName,
                  java.lang.String _alias)
Specified by:
login in interface Server

logout

public void logout()
Specified by:
logout in interface Server

abort

public void abort()
Specified by:
abort in interface Server

move

public void move(int from,
                 int to)
Specified by:
move in interface Server

put

public void put(int to)
Specified by:
put in interface Server

pass

public void pass()
Specified by:
pass in interface Server

undo

public void undo(int num)
Specified by:
undo in interface Server

remove

public void remove(int loc)
Specified by:
remove in interface Server