org.xistrat.net
Class F4ClientCore

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

public class F4ClientCore
extends java.lang.Thread
implements java.lang.Runnable, Client

F4ClientCore is the Core Client class, used both by F4Client and F4Applet.

It implements the Client interface to handle messages, and its concern is the logic of the game (client side), not the interface.

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
 java.net.InetAddress adx
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
F4ClientCore(java.net.InetAddress adx, int port, boolean verb)
           
 
Method Summary
 void abort()
           
 void abortAck(boolean ok, java.lang.String info)
           
 void abortOfAnother(java.lang.String name)
           
 void closeSocket()
          close tha current socket's streams nad reconnect as if it where the first time
 void doStop()
           
 void empty()
           
 void gameList()
          MESSAGE SENDING
 void gameListAck(java.lang.String[] list, java.lang.String[] position)
          MESSAGE HANDLING
 void gameStart()
           
 int getID()
           
 void info(java.lang.String info)
           
 void login(java.lang.String gameName, java.lang.String alias)
           
 void loginAck(boolean ok, java.lang.String info, int id, java.lang.String position)
           
 void loginOfAnother(java.lang.String name)
           
 void logout()
           
 void logoutAck()
           
 void logoutOfAnother(java.lang.String name)
           
 void lose(java.lang.String winner)
           
 void move(int from, int to)
           
 void moveAck(boolean ok, java.lang.String info, int to, int from, int id)
           
 void moveRequest(boolean waitForMe)
           
 void newGame(java.lang.String gameName, java.lang.String position, java.lang.String komi)
           
 void newGameAck(boolean ok, java.lang.String info)
           
 void pass()
           
 void passAck(boolean ok, java.lang.String info, int id)
           
 void put(int to)
           
 void putAck(boolean ok, java.lang.String info, int to, int cont, int id)
           
 void remove(int loc)
           
 void removeAck(boolean ok, java.lang.String info, int to, int cont, int id)
           
 void removeOfAnother(boolean ok, java.lang.String info, int to, int cont, int id)
           
 void removeRequest(boolean ok, java.lang.String info, int id)
           
 void run()
           
 void setClientUI(ClientUI cui)
           
 void undo(int num)
           
 void undoAck(boolean ok, java.lang.String info, int id, int num)
           
 void undoOfAnother(java.lang.String name)
           
 void undoRequest(boolean undo)
           
 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
 

Field Detail

adx

public java.net.InetAddress adx
Constructor Detail

F4ClientCore

public F4ClientCore(java.net.InetAddress adx,
                    int port,
                    boolean verb)
Method Detail

setClientUI

public void setClientUI(ClientUI cui)

run

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

doStop

public void doStop()

getID

public int getID()

gameListAck

public void gameListAck(java.lang.String[] list,
                        java.lang.String[] position)
MESSAGE HANDLING

Specified by:
gameListAck in interface Client

newGameAck

public void newGameAck(boolean ok,
                       java.lang.String info)
Specified by:
newGameAck in interface Client

loginAck

public void loginAck(boolean ok,
                     java.lang.String info,
                     int id,
                     java.lang.String position)
Specified by:
loginAck in interface Client

loginOfAnother

public void loginOfAnother(java.lang.String name)
Specified by:
loginOfAnother in interface Client

logoutAck

public void logoutAck()
Specified by:
logoutAck in interface Client

logoutOfAnother

public void logoutOfAnother(java.lang.String name)
Specified by:
logoutOfAnother in interface Client

abortAck

public void abortAck(boolean ok,
                     java.lang.String info)
Specified by:
abortAck in interface Client

abortOfAnother

public void abortOfAnother(java.lang.String name)
Specified by:
abortOfAnother in interface Client

gameStart

public void gameStart()
Specified by:
gameStart in interface Client

moveRequest

public void moveRequest(boolean waitForMe)
Specified by:
moveRequest in interface Client

moveAck

public void moveAck(boolean ok,
                    java.lang.String info,
                    int to,
                    int from,
                    int id)
Specified by:
moveAck in interface Client

putAck

public void putAck(boolean ok,
                   java.lang.String info,
                   int to,
                   int cont,
                   int id)
Specified by:
putAck in interface Client

passAck

public void passAck(boolean ok,
                    java.lang.String info,
                    int id)
Specified by:
passAck in interface Client

undoAck

public void undoAck(boolean ok,
                    java.lang.String info,
                    int id,
                    int num)
Specified by:
undoAck in interface Client

undoOfAnother

public void undoOfAnother(java.lang.String name)
Specified by:
undoOfAnother in interface Client

undoRequest

public void undoRequest(boolean undo)
Specified by:
undoRequest in interface Client

removeAck

public void removeAck(boolean ok,
                      java.lang.String info,
                      int to,
                      int cont,
                      int id)
Specified by:
removeAck in interface Client

removeOfAnother

public void removeOfAnother(boolean ok,
                            java.lang.String info,
                            int to,
                            int cont,
                            int id)
Specified by:
removeOfAnother in interface Client

removeRequest

public void removeRequest(boolean ok,
                          java.lang.String info,
                          int id)
Specified by:
removeRequest in interface Client

win

public void win()
Specified by:
win in interface Client

lose

public void lose(java.lang.String winner)
Specified by:
lose in interface Client

info

public void info(java.lang.String info)
Specified by:
info in interface Client

empty

public void empty()
Specified by:
empty in interface Client

closeSocket

public void closeSocket()
close tha current socket's streams nad reconnect as if it where the first time

Specified by:
closeSocket in interface Client

gameList

public void gameList()
MESSAGE SENDING


newGame

public void newGame(java.lang.String gameName,
                    java.lang.String position,
                    java.lang.String komi)

login

public void login(java.lang.String gameName,
                  java.lang.String alias)

undo

public void undo(int num)

logout

public void logout()

abort

public void abort()

move

public void move(int from,
                 int to)

put

public void put(int to)

pass

public void pass()

remove

public void remove(int loc)