public class WarriorServerThread
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
DataManagementController |
dataManagement |
NetworkConnectorForServer |
server |
| Constructor and Description |
|---|
WarriorServerThread(NetworkConnectorForServer server,
java.net.Socket socket)
initialize new thread
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
this is a thread class witch is triggered if the thread has to end
|
java.lang.Boolean |
getConnection()
Is this client already available?
|
int |
getID() |
java.lang.String |
getLoginName() |
GameMode |
getRole() |
void |
open()
Here every Stream would be created
|
void |
resetClientForNewGame()
reset the client for a new game in the Hill ore a round
|
void |
run()
because of the superclass this method is called at runtime This keep
alive method is for receiving data from the specific client *
|
void |
sendingConfigMassage(int coresize,
int linelength,
int maxinstructions,
int gamecycles,
java.lang.String gameStandard)
trigger a config message
give it the configuration parameters of the core:
|
void |
sendingDataToThisClient(java.lang.String msg)
This method is for sending a message that is stored in the variable msg
to the specific client
|
void |
sendingErrorMassage(java.lang.String errormessage)
trigger a Error Massage
|
void |
sendingFinishMassage(java.lang.String state)
trigger finish message
|
void |
sendingStartMassage(java.util.ArrayList<java.lang.Integer> core,
java.util.ArrayList<java.lang.String> players)
trigger start package
|
void |
sendingUpdateMassage(java.lang.Integer index,
java.lang.Integer value)
trigger update message
|
void |
setCode(java.lang.String code)
set up the code
an it validates it for you and saves it if everything is fine
|
void |
setLoginName(java.lang.String name)
set up the loginName
|
void |
setRole(GameMode role)
set up the role for this game
|
activeCount, checkAccess, clone, 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, yieldpublic NetworkConnectorForServer server
public DataManagementController dataManagement
public WarriorServerThread(NetworkConnectorForServer server, java.net.Socket socket)
server - this has to be the server Management class (e.g.
WarriorServer)socket - this is the socket witch is connected to the specific clientpublic void sendingDataToThisClient(java.lang.String msg)
msg - the string that should be send to the clientpublic int getID()
public java.lang.String getLoginName()
public GameMode getRole()
public void setLoginName(java.lang.String name)
name - the loginName for this clientpublic void setRole(GameMode role)
role - visitor or playerpublic void setCode(java.lang.String code)
code - the code you want to give the warriorpublic void sendingErrorMassage(java.lang.String errormessage)
errormessage - public void sendingConfigMassage(int coresize,
int linelength,
int maxinstructions,
int gamecycles,
java.lang.String gameStandard)
coresize - linelength - maxinstructions - gamecycles - gameStandard - public void sendingStartMassage(java.util.ArrayList<java.lang.Integer> core,
java.util.ArrayList<java.lang.String> players)
core - players - public void sendingUpdateMassage(java.lang.Integer index,
java.lang.Integer value)
index - wherevalue - whopublic void sendingFinishMassage(java.lang.String state)
state - who wonpublic void resetClientForNewGame()
public java.lang.Boolean getConnection()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void open()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOException