uk.org.redfelineninja.risk.server
Class RiskServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uk.org.redfelineninja.risk.server.RiskServer
All Implemented Interfaces:
java.lang.Runnable

public class RiskServer
extends java.lang.Thread

This is a application based server for the Risk Arena. It is capable of running within a Thread to allow it to be easily integrated into the client. It also provides a main method to allow seperate testing.


Field Summary
static java.lang.String defaultMap
          This is the original risk map (included in the distribution).
static int defaultPort
          Default port for the Risk server.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RiskServer()
          Create a server on the default port using the standard output as the server console.
RiskServer(int p)
          Start the server on the supplied port using the standard output as the server console.
RiskServer(int p, java.io.PrintWriter w)
          Start the sever on the supplied port using the supplied PrintWriter as the server console.
RiskServer(java.io.PrintWriter w)
          Start the sever on the default port using the supplied PrintWriter as the server console.
 
Method Summary
static void main(java.lang.String[] args)
          Start the server non-threaded.
 void run()
          This method starts the server and waits for connections.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultPort

public static final int defaultPort
Default port for the Risk server. For a period of time this is the authors favourite number. It has no known historical significance. Try putting £16.44 of petrol in your car so you can enjoy getting a credit card bill. As is so often the way the author has now started flirting with other numbers. So it goes ...

See Also:
Constant Field Values

defaultMap

public static final java.lang.String defaultMap
This is the original risk map (included in the distribution).

Constructor Detail

RiskServer

public RiskServer()
Create a server on the default port using the standard output as the server console.


RiskServer

public RiskServer(int p)
Start the server on the supplied port using the standard output as the server console.


RiskServer

public RiskServer(java.io.PrintWriter w)
Start the sever on the default port using the supplied PrintWriter as the server console.


RiskServer

public RiskServer(int p,
                  java.io.PrintWriter w)
Start the sever on the supplied port using the supplied PrintWriter as the server console.

Method Detail

main

public static void main(java.lang.String[] args)
Start the server non-threaded. This is the command to start a single game server.


run

public void run()
This method starts the server and waits for connections. Currently it will never return.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread