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 Server

    java.lang.Object
      vutbr.checkers.server.Server

    public class Server

extends java.lang.Object

Trida Server

Author:
  Ondrej Novy

Constructor Summary
`Server(java.lang.String configFile)` Konstruktor

Method Summary
`ServerThread` | `accept()` Prijme spojeni od klienta
`void` | `close()` Uzavreni spojeni ke klientovi
`boolean` | `game(ServerThread serverThread, java.lang.String login)` Odesle zadost o hru
`boolean` | `gameAccept(ServerThread serverThread, java.lang.String login)` Odesle potvrzeni hry
`boolean` | `gameEnd(java.lang.String login)` Odesle konec hry
`boolean` | `gameReject(ServerThread serverThread, java.lang.String login)` Odesle odmitnuti hry
`java.util.Hashtable<java.lang.String,ServerThread>` | `getClients()` Vrati seznamu uzivatelu
`int` | `getPort()` Vrati port
`boolean` | `login(ServerThread serverThread)` Provede prihlaseni uzivatele Odesle mu seznam aktualnich uzivatelu a r ozesle informaci o prihlaseni ostatnim uzivatelum
`void` | `logout(ServerThread serverThread)` Provede odhlaseni uzivatele Odesle informaci o odhlaseni ostatnim uzivatelum
`boolean` | `serverGame(java.lang.String login, ServerGame serverGame)` Nastavi server game protihraci
`boolean` | `turn(java.lang.String login, int x, int y, int toX, int toY)` Provede tah figurkou
`boolean` | `turnEnd(java.lang.String login)`
`void` | `userInGame(java.lang.String login)` Odesle informaci ostatnim hracum, ze je tento hrac ve hre
`void` | `userOutGame(java.lang.String login)` Odesle informaci ostatnim hracum, ze je tento hrac uz neni ve hre

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Server

    public Server(java.lang.String configFile)

  Konstruktor

  Parameters:
    `configFile` - Jmeno konfiguracniho souboru

Method Detail

### accept

    public ServerThread accept()
                        throws java.io.IOException

  Prijme spojeni od klienta

  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Uzavreni spojeni ke klientovi

  Throws:
    `java.io.IOException`

### getPort

    public int getPort()

  Vrati port

  Returns:
    Port

### login

    public boolean login(ServerThread serverThread)

  Provede prihlaseni uzivatele Odesle mu seznam aktualnich uzivatelu a r ozesle informaci o prihlaseni ostatnim uzivatelum

  Parameters:
    `serverThread` - Vlakno serveru

### logout

    public void logout(ServerThread serverThread)

  Provede odhlaseni uzivatele Odesle informaci o odhlaseni ostatnim uzivatelum

  Parameters:
    `serverThread` - Vlakno serveru

### userInGame

    public void userInGame(java.lang.String login)

  Odesle informaci ostatnim hracum, ze je tento hrac ve hre

  Parameters:
    `login` - Login hrace

### userOutGame

    public void userOutGame(java.lang.String login)

  Odesle informaci ostatnim hracum, ze je tento hrac uz neni ve hre

  Parameters:
    `login` - Login hrace

### getClients

    public java.util.Hashtable<java.lang.String,ServerThread> getClients()

  Vrati seznamu uzivatelu

  Returns:
    Seznam uzivatelu

### game

    public boolean game(ServerThread serverThread,
                        java.lang.String login)

  Odesle zadost o hru

  Parameters:
    `serverThread` - Vlakno serveru
    `login` - Login protihrace

### gameAccept

    public boolean gameAccept(ServerThread serverThread,
                              java.lang.String login)

  Odesle potvrzeni hry

  Parameters:
    `serverThread` - Vlakno serveru
    `login` - Login protihrace

### gameReject

    public boolean gameReject(ServerThread serverThread,
                              java.lang.String login)

  Odesle odmitnuti hry

  Parameters:
    `serverThread` - Vlakno serveru
    `login` - Login protihrace

### turn

    public boolean turn(java.lang.String login,
                        int x,
                        int y,
                        int toX,
                        int toY)

  Provede tah figurkou

  Parameters:
    `x` - Zdrojova souradnice X
    `y` - Zdrojova souradnice Y
    `toX` - Cilova souradnice X
    `toY` - Cilova souradnice Y
  Returns:
    True pokud se tah povedl

### turnEnd

    public boolean turnEnd(java.lang.String login)

### gameEnd

    public boolean gameEnd(java.lang.String login)

  Odesle konec hry

  Parameters:
    `login` - Login protihrace

### serverGame

    public boolean serverGame(java.lang.String login,
                              ServerGame serverGame)

  Nastavi server game protihraci

  Parameters:
    `login` - Login protihrace
    `serverGame` - Server game

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