|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread
de.tud.dvs1.mmpgp2p.ServerThread
de.tud.dvs1.example.ServerImplementation
public class ServerImplementation
Beispiel-Implementierung eines mmpgp2p Systems. Ausgabe auf der Konsole (bisher kein GUI)
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 |
WORLD_TILESIZE
|
static java.lang.String |
WORLD_TOTX
|
static java.lang.String |
WORLD_TOTY
|
Fields inherited from class de.tud.dvs1.mmpgp2p.ServerThread |
---|
initialRC, MAX_WAIT_CLIENT_CONNECT, MAX_WAIT_CLIENT_INACTIVE, PORT, regionControllers, regionTree, SERVER, SERVERNICENAME, worldInfo |
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 | |
---|---|
ServerImplementation(java.util.Properties p)
Constructor |
Method Summary | |
---|---|
protected Avatar[] |
getClientAvatars(ClientInfo c)
Implementierung der abstrakten Methode |
protected GameWorld |
getInitialGameWorld()
Die Implementierung muß eine Spielewelt liefern, mit der sich der Server initialisieren kann. |
protected Ruleset |
getInitialRuleset()
Mit dieser Methode liefert die Serverklasse die Spielregeln. |
void |
log(java.lang.Exception e)
|
void |
log(java.lang.String s)
|
protected SessionTicket |
loginClient(ClientRequest client)
Einfache Benutzerverwaltung. |
static void |
main(java.lang.String[] args)
|
protected int |
registerNewClient(ClientRequest client)
Implementierung der abstrakten Methode |
protected void |
saveClientAvatars(ClientInfo c,
Avatar[] avatars)
Die zum Client gehörenden Avatare persistent sichern. |
Methods inherited from class de.tud.dvs1.mmpgp2p.ServerThread |
---|
closedConnection, doLogSystemStats, getActiveClients, getGameWorld, getHeader, getHeaderFromInputStreamReader, getInfo, getNextFreeRC, getNumConnectionRequests, getRuleset, getServerThread, getShutdownMagic, incomingConnection, incomingData, printSystemStatsFirstLine, requestMerge, requestSplit, run, sendShutDown, splitRegion, splitRegion, stopServer, stopThread |
Methods inherited from class de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread |
---|
closeServerConnectionWorker, getConnectionWorker, getDebug, getProperties, getProperty, getProperty, getServerConnectionWorker, getSystemLoad, getSystemMemory, getThreadName, getTime, getTraffic, initSystemStats, isRunning, isStarting, log_debug, log_debug, logSystemStats, openConnection, openServerConnection, readFirstLine, resetSystemStats, setDebug, setProperty, setRunning, 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 java.lang.String WORLD_TOTX
public static java.lang.String WORLD_TOTY
public static java.lang.String WORLD_TILESIZE
Constructor Detail |
---|
public ServerImplementation(java.util.Properties p)
Method Detail |
---|
public static void main(java.lang.String[] args)
protected GameWorld getInitialGameWorld()
ServerThread
getInitialGameWorld
in class ServerThread
protected int registerNewClient(ClientRequest client)
registerNewClient
in class ServerThread
client
- Enthält alle Informationen, die vom
Client geliefert wurden.
protected Ruleset getInitialRuleset()
ServerThread
getInitialRuleset
in class ServerThread
protected Avatar[] getClientAvatars(ClientInfo c)
getClientAvatars
in class ServerThread
c
- Enthält alle Informationen, die vom Client geliefert wurden.
protected void saveClientAvatars(ClientInfo c, Avatar[] avatars)
ServerThread
saveClientAvatars
in class ServerThread
c
- Enthält alle Informationen, die den Client identifizieren.avatars
- Die Avatare des Clientsprotected SessionTicket loginClient(ClientRequest client)
loginClient
in class ServerThread
client
- Enthält alle Informationen, die vom Client geliefert wurden.
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 |