public class NetworkConnectorForServer
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
ServerController |
serverController |
| Constructor and Description |
|---|
NetworkConnectorForServer(int port,
ServerController controller)
initialization of the Server class and trying to start a Serversocket to
connect to the clients
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPlayerToTheGame()
at HillServer logic you can ask for the next player in the Queue to add it to the next game
|
void |
addPlayerToTheGame(WarriorServerThread client)
at HillServer logic you can an a client here to the player Queue
|
void |
addVisitorToTheGame(WarriorServerThread client)
With this method you can add a visitor to a running game
|
void |
archiveGame(GamingPlattform plattform)
if a game is over you can archive it with this method an it starts a new player
|
java.util.ArrayList<WarriorServerThread> |
getClients() |
void |
removeAClient(int ID)
if you want to disconnect to a specific client, call this method e.g. if
the client doesn't answer for a minute
|
void |
run()
this method is called automatically because of the Runnable
implementation here will start the waiting for a client
|
void |
startServerInThread()
let this server run as a separate thread so that rest of the program can
run separate of this tcp connection
|
void |
stop()
this method is for ending up the hole tcp service and terminating the
thread it is working on
|
public ServerController serverController
public NetworkConnectorForServer(int port,
ServerController controller)
port - Here you have to give it the port the server has to work onpublic void run()
run in interface java.lang.Runnablepublic java.util.ArrayList<WarriorServerThread> getClients()
public void startServerInThread()
public void stop()
public void removeAClient(int ID)
ID - port of the client you want to terminatepublic void addPlayerToTheGame(WarriorServerThread client)
client - public void addPlayerToTheGame()
public void archiveGame(GamingPlattform plattform)
plattform - public void addVisitorToTheGame(WarriorServerThread client)
client -