|
|||||||||
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.RegionControllerThread
public class RegionControllerThread
Diese Klasse ist die auf den Clients laufende Instanz eines RegionControllers. Auf jedem Client läuft mindestens eine Instanz und wartet auf Verbindungen.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
MAX_CLIENTS
|
static java.lang.String |
MIN_CLIENTS
|
static java.lang.String |
PORT
|
static java.lang.String |
START_TIMEOUT
|
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 | |
---|---|
RegionControllerThread()
|
|
RegionControllerThread(java.util.Properties p)
Constructor Ein neuer RegionControllerThread wird erzeugt |
Method Summary | |
---|---|
protected void |
closedConnection(ConnectionWorkerThread t)
Diese Funktion wird aufgerufen, nachem sich ein ConnectionWorkerThread beendet |
void |
deleteGameWorld()
|
GameWorld |
getGameWorld()
|
java.net.InetAddress |
getInetAddress()
|
int |
getPort()
|
RegionControllerInfo |
getRegionControllerInfo()
Eine RegionController Klasse für diesen RegionControllerThread zurückgeben |
RegionInfo |
getRegionInfo()
|
protected ClientRequest |
incomingConnection(ConnectionWorkerThread t)
Ein neuer Client verbindet sich. |
void |
incomingData(ConnectionWorkerThread t)
Neue Daten liegen an |
void |
initRegionController()
Den Initialisierungskram erledigen. |
void |
log(java.lang.Exception e)
|
void |
log(java.lang.String s)
|
void |
run()
Thread-Methode |
void |
setGameWorld(GameWorld world)
Erhält eine Klasse mit Objekte, mit denen die Welt initialisiert wird. |
void |
setLogStream(java.io.PrintStream s)
Das logging des RCs kann umgeleitet werden, indem hier ein entsprechender PrintStream übergeben wird. |
void |
setRuleset(Ruleset rules)
Die Spielregeln setzen. |
GameWorld[] |
splitGameWorld()
|
GameWorld[] |
splitGameWorld(GameWorld gw)
Die Spielewelt wird aufgeteilt. |
static GameWorld[] |
splitGameWorld(GameWorld gw,
int sx,
int sy)
Die Spielewelt wird aufgeteilt. |
GameWorld[] |
splitGameWorld(int x,
int y)
|
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, 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 java.lang.String PORT
public static final java.lang.String START_TIMEOUT
public static final java.lang.String MAX_CLIENTS
public static final java.lang.String MIN_CLIENTS
Constructor Detail |
---|
public RegionControllerThread(java.util.Properties p)
prop
- Konfiguration.public RegionControllerThread()
Method Detail |
---|
public void initRegionController()
protected ClientRequest incomingConnection(ConnectionWorkerThread t)
incomingConnection
in class MmpgP2PServiceThread
protected void closedConnection(ConnectionWorkerThread t)
MmpgP2PServiceThread
closedConnection
in class MmpgP2PServiceThread
public void incomingData(ConnectionWorkerThread t)
incomingData
in class MmpgP2PServiceThread
public void setRuleset(Ruleset rules)
public void setGameWorld(GameWorld world) throws MmpgP2PException
world
- Die neue Spielwelt
MmpgP2PException
public GameWorld getGameWorld()
public RegionInfo getRegionInfo()
public void deleteGameWorld()
public GameWorld[] splitGameWorld() throws MmpgP2PException
MmpgP2PException
public GameWorld[] splitGameWorld(int x, int y) throws MmpgP2PException
MmpgP2PException
public GameWorld[] splitGameWorld(GameWorld gw) throws MmpgP2PException
MmpgP2PException
public static GameWorld[] splitGameWorld(GameWorld gw, int sx, int sy) throws MmpgP2PException
gw
- Die Spielewelt, die geteilt werden sollsx
- Die X-Koordinate für eine vertikale Aufteilung.
Kann -1 sein, falls nicht vertikal geteilt werden soll.sy
- Die Y-Koordinate für eine horizinlae Aufteilung.
Kann -1 sein, falls nicht horizontal geteilt werden soll.
MmpgP2PException
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public RegionControllerInfo getRegionControllerInfo()
public int getPort()
public java.net.InetAddress getInetAddress()
public void setLogStream(java.io.PrintStream s)
public void log(java.lang.String s)
log
in class MmpgP2PServiceThread
public void log(java.lang.Exception e)
log
in class MmpgP2PServiceThread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |