|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.palamedes.gdl.connection.NanoHTTPD
org.eclipse.palamedes.gdl.connection.PlayerServer
public class PlayerServer
Field Summary | |
---|---|
protected static boolean |
DEFAULT_MODE
|
protected static int |
DEFAULT_PORT
|
protected Player |
player
Stores the player of this server |
protected int |
port
|
protected boolean |
slaveMode
|
Fields inherited from class org.eclipse.palamedes.gdl.connection.NanoHTTPD |
---|
MIME_DEFAULT_BINARY, MIME_HTML, MIME_PLAINTEXT, myFileDir, server_thread |
Constructor Summary | |
---|---|
PlayerServer(Player player,
java.util.Map<java.lang.String,java.lang.String> options)
|
Method Summary | |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
getOptions(java.lang.String[] args)
This method creates and returns the option map. |
protected static int |
getPort(java.util.Map<java.lang.String,java.lang.String> argumentMap)
This method extracts the port number out of the argument map. |
static void |
main(java.lang.String[] args)
starts the game player and waits for messages from the game master Command line options: [port] slave |
Response |
serve(java.lang.String uri,
java.lang.String method,
java.util.Properties header,
java.util.Properties parms,
java.lang.String data)
Override this to customize the server. |
protected void |
setOptions(java.util.Map<java.lang.String,java.lang.String> options)
This method is a hook to setup any relevant commandline option within the player server or player. |
void |
waitForExit()
wait for server thread to exit |
Methods inherited from class org.eclipse.palamedes.gdl.connection.NanoHTTPD |
---|
serveFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static int DEFAULT_PORT
protected static boolean DEFAULT_MODE
protected Player player
protected int port
protected boolean slaveMode
Constructor Detail |
---|
public PlayerServer(Player player, java.util.Map<java.lang.String,java.lang.String> options) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public Response serve(java.lang.String uri, java.lang.String method, java.util.Properties header, java.util.Properties parms, java.lang.String data)
NanoHTTPD
(By default, this delegates to serveFile() and allows directory listing.)
serve
in class NanoHTTPD
uri
- Percent-decoded URI without parameters, for example
"/index.cgi"method
- "GET", "POST" etc.header
- Header entries, percent decodedparms
- Parsed, percent decoded parameters from URI and, in case of
POST, data.
public void waitForExit()
protected void setOptions(java.util.Map<java.lang.String,java.lang.String> options)
options
- public static java.util.Map<java.lang.String,java.lang.String> getOptions(java.lang.String[] args)
protected static int getPort(java.util.Map<java.lang.String,java.lang.String> argumentMap)
argumentMap
- public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |