|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread de.tud.dvs1.mmpgp2p.ClientThread
public abstract class ClientThread
Diese Klasse abstrahiert einen Client, der in Verbindung mit dem Server tritt.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static long |
MAX_WAIT_NOP
|
static long |
STATUS_PAUSEING
|
static long |
STATUS_PLAYING
|
static long |
STATUS_STARTING
|
static long |
STATUS_UNDEFINED
|
Fields inherited from class de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread |
---|
CR, logSystemStatsInterval, logSystemStatsLast, logSystemStatsStart, logSystemStatsWriter, MAGIC |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ClientThread(java.util.Properties p)
|
|
ClientThread(java.lang.String server,
java.lang.String port,
java.lang.String username,
java.lang.String password)
|
Method Summary | |
---|---|
void |
addCommand(MmpgP2PCommand c)
Diese Methode dient als Schnittstelle zur Implementierung. |
protected void |
closedConnection(ConnectionWorkerThread t)
Diese Funktion wird aufgerufen, nachem sich ein ConnectionWorkerThread beendet |
protected void |
executeCommand(MmpgP2PCommand c)
Führe ein Kommando aus. |
abstract void |
gameWorldUpdated()
Diese Methode wird aufgerufen, sobald die Welt sich geändert hat. |
Avatar[] |
getAvatars()
Gibt die Avatare des Clients zurück. |
GameWorld |
getGameWorld()
Liefert die Spielewelt zurück, die alle für den Clients sichtbaren Objekte enthält. |
java.lang.String |
getRCInformationString()
|
SessionTicket |
getTicket()
Liefert das SessionTicket des Clients zurück, sofern es schon erhalten ist. |
protected ClientRequest |
incomingConnection(ConnectionWorkerThread t)
Eine Verbinung kommt herein. |
protected void |
incomingData(ConnectionWorkerThread t)
Auf einer Verbindung kommen Daten herein. |
void |
login()
In das System einloggen. |
void |
logout()
Logout. |
void |
pauseGame()
Gib den RegionControllern das Signal zum Pausieren des Spiels für diesen Spieler |
void |
playGame()
Spielbetrieb wieder aufnehmen. |
void |
run()
Thread-Methode |
void |
setGZIP(boolean b)
|
void |
startGame()
Gib den RegionControllern das Signal zur Aufnahme des Spielbetriebs. |
void |
stopClient()
Der Client beendet sich. |
Methods inherited from class de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread |
---|
closeServerConnectionWorker, doLogSystemStats, getConnectionWorker, getDebug, getProperties, getProperty, getProperty, getServerConnectionWorker, getSystemLoad, getSystemMemory, getThreadName, getTime, getTraffic, initSystemStats, isRunning, isStarting, log_debug, log_debug, log, log, logSystemStats, openConnection, openServerConnection, printSystemStatsFirstLine, readFirstLine, resetSystemStats, setDebug, setProperty, setRunning, stopThread, waitFor, waitForShutdown |
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 |
---|
public static final long STATUS_UNDEFINED
public static final long STATUS_STARTING
public static final long STATUS_PLAYING
public static final long STATUS_PAUSEING
public static final long MAX_WAIT_NOP
Constructor Detail |
---|
public ClientThread(java.util.Properties p)
public ClientThread(java.lang.String server, java.lang.String port, java.lang.String username, java.lang.String password)
Method Detail |
---|
public abstract void gameWorldUpdated()
public SessionTicket getTicket()
public void stopClient()
public java.lang.String getRCInformationString()
public void pauseGame() throws MmpgP2PException
MmpgP2PException
public void playGame() throws MmpgP2PException
MmpgP2PException
public void startGame() throws MmpgP2PException
MmpgP2PException
public Avatar[] getAvatars()
public GameWorld getGameWorld()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setGZIP(boolean b)
public void logout()
public void login() throws MmpgP2PException, java.io.IOException, java.lang.InterruptedException, java.lang.ClassNotFoundException
MmpgP2PException
java.io.IOException
java.lang.InterruptedException
java.lang.ClassNotFoundException
protected void executeCommand(MmpgP2PCommand c) throws MmpgP2PException
MmpgP2PException
public void addCommand(MmpgP2PCommand c)
protected ClientRequest incomingConnection(ConnectionWorkerThread t)
incomingConnection
in class MmpgP2PServiceThread
protected void incomingData(ConnectionWorkerThread t)
MmpgP2PServiceThread
incomingData
in class MmpgP2PServiceThread
protected void closedConnection(ConnectionWorkerThread t)
MmpgP2PServiceThread
closedConnection
in class MmpgP2PServiceThread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |