Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## vutbr.checkers.server
Class ServerThread

    java.lang.Object
      java.lang.Thread
          vutbr.checkers.protocol.ProtocolClient
              vutbr.checkers.server.ServerThread

All Implemented Interfaces:
  java.lang.Runnable

    public class ServerThread

extends ProtocolClient

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
`ServerThread(java.net.Socket socket)` Konstruktor

Method Summary
`protected void` | `game(java.lang.String login)` Odesle RequestGame zpravu
`protected void` | `gameAccept(java.lang.String login)` Odesle ReplyGameAccept zpravu
`protected void` | `gameEnd()` Odesle RequestGameEnd zpravu
`protected void` | `gameReject(java.lang.String login)` Odesle ReplyGameReject zpravu
`java.lang.String` | `getLogin()` Vrati login hrace
`Server` | `getServer()` Vrati server
`protected ServerGame` | `getServerGame()` Vrati server game
`void` | `onBadCommand()`
`void` | `onExit()`
`void` | `onGame(java.lang.String login)`
`void` | `onGameAccept(java.lang.String login)`
`void` | `onGameEnd()`
`void` | `onGameError(java.lang.String error)`
`void` | `onGameReject(java.lang.String login)`
`void` | `onLogin(java.lang.String login)`
`void` | `onLoginError(java.lang.String error)`
`void` | `onLoginOk()`
`void` | `onPong()`
`void` | `onRegister(java.lang.String login)`
`void` | `onRegisterError(java.lang.String error)`
`void` | `onRegisterOk()`
`void` | `onTurn(int x, int y, int toX, int toY)`
`void` | `onTurnEnd()`
`void` | `onTurnEndError(java.lang.String error)`
`void` | `onTurnEndOk()`
`void` | `onTurnError(java.lang.String error)`
`void` | `onTurnOk()`
`void` | `onUserInGame(java.lang.String login)`
`void` | `onUserLogin(java.lang.String login)`
`void` | `onUserLogout(java.lang.String login)`
`void` | `onUserOutGame(java.lang.String login)`
`void` | `run()` Spusti vlakno
`void` | `setServer(Server server)` Nastavi server
`protected void` | `setServerGame(ServerGame serverGame)` Nastavi server game
`protected void` | `turn(int x, int y, int toX, int toY)` Odesle RequestTurn zpravu
`protected void` | `turnEnd()` Odesle RequestTurnEnd zpravu
`protected void` | `userInGame(java.lang.String login)` Odesle ReplyUserInGame zpravu
`void` | `userLogin(java.lang.String login)` Odesle ReplyUserLogin zpravu
`void` | `userLogout(java.lang.String login)` Odesle ReplyUserLogout zpravu
`protected void` | `userOutGame(java.lang.String login)` Odesle ReplyUserOutGame zpravu

Methods inherited from class vutbr.checkers.protocol.ProtocolClient
`denyMethod, getProtocolInput, getProtocolOutput, onPing, setProtocolInput, setProtocolOutput`

Methods inherited from class java.lang.Thread
`activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, 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

### ServerThread

    public ServerThread(java.net.Socket socket)

  Konstruktor

  Parameters:
    `socket` - Soket

Method Detail

### run

    public void run()

  Spusti vlakno

  Specified by:
    `run` in interface `java.lang.Runnable`
  Overrides:
    `run` in class `java.lang.Thread`

### setServer

    public void setServer(Server server)

  Nastavi server

  Parameters:
    `server` - Server

### getServer

    public Server getServer()

  Vrati server

  Returns:
    Server

### getLogin

    public java.lang.String getLogin()

  Vrati login hrace

  Returns:
    Login hrace

### userLogin

    public void userLogin(java.lang.String login)

  Odesle ReplyUserLogin zpravu

  Parameters:
    `login` - Login hrace

### userLogout

    public void userLogout(java.lang.String login)

  Odesle ReplyUserLogout zpravu

  Parameters:
    `login` - Login hrace

### setServerGame

    protected void setServerGame(ServerGame serverGame)

  Nastavi server game

  Parameters:
    `serverGame` - Server game

### getServerGame

    protected ServerGame getServerGame()

  Vrati server game

  Returns:
    Server game

### game

    protected void game(java.lang.String login)

  Odesle RequestGame zpravu

  Parameters:
    `login` - Login protihrace

### gameAccept

    protected void gameAccept(java.lang.String login)

  Odesle ReplyGameAccept zpravu

  Parameters:
    `login` - Login protihrace

### gameReject

    protected void gameReject(java.lang.String login)

  Odesle ReplyGameReject zpravu

  Parameters:
    `login` - Login protihrace

### turn

    protected void turn(int x,
                        int y,
                        int toX,
                        int toY)

  Odesle RequestTurn zpravu

  Parameters:
    `x` - Zdrojova souradnice X
    `y` - Zdrojova souradnice Y
    `toX` - Cilova souradnice X
    `toY` - Cilova souradnice Y

### turnEnd

    protected void turnEnd()

  Odesle RequestTurnEnd zpravu

### gameEnd

    protected void gameEnd()

  Odesle RequestGameEnd zpravu

### userInGame

    protected void userInGame(java.lang.String login)

  Odesle ReplyUserInGame zpravu

  Parameters:
    `login` - Login hrace

### userOutGame

    protected void userOutGame(java.lang.String login)

  Odesle ReplyUserOutGame zpravu

  Parameters:
    `login` - Login hrace

### onLogin

    public void onLogin(java.lang.String login)

  Specified by:
    `onLogin` in class `ProtocolClient`

### onRegister

    public void onRegister(java.lang.String login)

  Specified by:
    `onRegister` in class `ProtocolClient`

### onExit

    public void onExit()

  Specified by:
    `onExit` in class `ProtocolClient`

### onGame

    public void onGame(java.lang.String login)

  Specified by:
    `onGame` in class `ProtocolClient`

### onTurn

    public void onTurn(int x,
                       int y,
                       int toX,
                       int toY)

  Specified by:
    `onTurn` in class `ProtocolClient`

### onTurnEnd

    public void onTurnEnd()

  Specified by:
    `onTurnEnd` in class `ProtocolClient`

### onBadCommand

    public void onBadCommand()

  Specified by:
    `onBadCommand` in class `ProtocolClient`

### onUserLogin

    public void onUserLogin(java.lang.String login)

  Specified by:
    `onUserLogin` in class `ProtocolClient`

### onUserLogout

    public void onUserLogout(java.lang.String login)

  Specified by:
    `onUserLogout` in class `ProtocolClient`

### onUserInGame

    public void onUserInGame(java.lang.String login)

  Specified by:
    `onUserInGame` in class `ProtocolClient`

### onUserOutGame

    public void onUserOutGame(java.lang.String login)

  Specified by:
    `onUserOutGame` in class `ProtocolClient`

### onLoginOk

    public void onLoginOk()

  Specified by:
    `onLoginOk` in class `ProtocolClient`

### onLoginError

    public void onLoginError(java.lang.String error)

  Specified by:
    `onLoginError` in class `ProtocolClient`

### onRegisterOk

    public void onRegisterOk()

  Specified by:
    `onRegisterOk` in class `ProtocolClient`

### onRegisterError

    public void onRegisterError(java.lang.String error)

  Specified by:
    `onRegisterError` in class `ProtocolClient`

### onPong

    public void onPong()

  Overrides:
    `onPong` in class `ProtocolClient`

### onGameAccept

    public void onGameAccept(java.lang.String login)

  Specified by:
    `onGameAccept` in class `ProtocolClient`

### onGameReject

    public void onGameReject(java.lang.String login)

  Specified by:
    `onGameReject` in class `ProtocolClient`

### onGameError

    public void onGameError(java.lang.String error)

  Specified by:
    `onGameError` in class `ProtocolClient`

### onTurnError

    public void onTurnError(java.lang.String error)

  Specified by:
    `onTurnError` in class `ProtocolClient`

### onTurnOk

    public void onTurnOk()

  Specified by:
    `onTurnOk` in class `ProtocolClient`

### onTurnEndError

    public void onTurnEndError(java.lang.String error)

  Specified by:
    `onTurnEndError` in class `ProtocolClient`

### onTurnEndOk

    public void onTurnEndOk()

  Specified by:
    `onTurnEndOk` in class `ProtocolClient`

### onGameEnd

    public void onGameEnd()

  Specified by:
    `onGameEnd` in class `ProtocolClient`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD