gecco.server.startup
Class StartServer

java.lang.Object
  |
  +--gecco.server.startup.StartServer

public class StartServer
extends Object

This class is the startup routine for the server, that parses all configuration files, and sets everything up.

Author:
Henrik Bäärnhielm, Karl Hasselström, Henrik Hägerström

Field Summary
private  ActionProcessor actionProcessor
          Description of the Field
private  ActsOfGod actsOfGod
          Description of the Field
private  String actsofgodConfFileName
          Description of the Field
private  Class automatonClass
          Description of the Field
private  BufferedReader bufReader
          Description of the Field
private  HashMap colorToState
          Description of the Field
private  int connectionPort
          Description of the Field
private  int currentLine
          Description of the Field
private  String game
          Description of the Field
private  String globalConfFileName
          Description of the Field
private  Set godseyeRoles
          Description of the Field
private  String logFileName
          Description of the Field
private  LogManager logManager
          Description of the Field
private  AutomatonMap map
          Description of the Field
private  int mapX
          Description of the Field
private  int mapY
          Description of the Field
private  QManager qManager
          Description of the Field
private  Set roles
          Description of the Field
private  String rolesConfFileName
          Description of the Field
private  UnitManager unitManager
          Description of the Field
private  String unitsConfFileName
          Description of the Field
private  String unitTypesConfFileName
          Description of the Field
private  VisibilityManager visibilityManager
          Description of the Field
 
Constructor Summary
StartServer(CommandLineProperties props)
          Constructor for the StartServer object
 
Method Summary
private static void abort(String message, int exitStatus)
          Description of the Method
private  Reader getConfFile(String name)
           
private  byte[] getImage(String name)
           
static void main(String[] args)
          The main program for the StartServer class
private  void parseActsOfGod(Reader in)
          Parses the Acts of God configuration file.
private  void parseGlobal(Reader in)
          Parses the global configuration file.
private  void parseRoles(Reader in)
          Parses the Roles configuration file.
private  void parseUnits(Reader in)
          Parses the Units configuration file.
private  void parseUnitTypes(Reader in)
          Parses the Unit Types configuration file.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

globalConfFileName

private final String globalConfFileName
Description of the Field

rolesConfFileName

private final String rolesConfFileName
Description of the Field

unitTypesConfFileName

private final String unitTypesConfFileName
Description of the Field

unitsConfFileName

private final String unitsConfFileName
Description of the Field

actsofgodConfFileName

private final String actsofgodConfFileName
Description of the Field

logFileName

private final String logFileName
Description of the Field

bufReader

private BufferedReader bufReader
Description of the Field

currentLine

private int currentLine
Description of the Field

automatonClass

private Class automatonClass
Description of the Field

connectionPort

private int connectionPort
Description of the Field

game

private String game
Description of the Field

unitManager

private UnitManager unitManager
Description of the Field

qManager

private QManager qManager
Description of the Field

actsOfGod

private ActsOfGod actsOfGod
Description of the Field

visibilityManager

private VisibilityManager visibilityManager
Description of the Field

actionProcessor

private ActionProcessor actionProcessor
Description of the Field

logManager

private LogManager logManager
Description of the Field

roles

private Set roles
Description of the Field

godseyeRoles

private Set godseyeRoles
Description of the Field

map

private AutomatonMap map
Description of the Field

mapX

private int mapX
Description of the Field

mapY

private int mapY
Description of the Field

colorToState

private HashMap colorToState
Description of the Field
Constructor Detail

StartServer

public StartServer(CommandLineProperties props)
            throws FileNotFoundException,
                   IOException,
                   SyntaxErrorException,
                   ParseErrorException
Constructor for the StartServer object
Parameters:
props - Description of Parameter
Throws:
FileNotFoundException - Description of Exception
IOException - Description of Exception
SyntaxErrorException - Description of Exception
ParseErrorException - Description of Exception
Method Detail

getConfFile

private Reader getConfFile(String name)
                    throws FileNotFoundException

getImage

private byte[] getImage(String name)
                 throws FileNotFoundException,
                        IOException

parseGlobal

private void parseGlobal(Reader in)
                  throws IOException,
                         SyntaxErrorException,
                         ParseErrorException
Parses the global configuration file.
Parameters:
theStream - The file stream.
Throws:
IOException - Description of Exception
SyntaxErrorException - Description of Exception
ParseErrorException - Description of Exception

parseRoles

private void parseRoles(Reader in)
                 throws IOException,
                        SyntaxErrorException,
                        ParseErrorException
Parses the Roles configuration file.
Parameters:
theStream - The file stream.
Throws:
IOException - Description of Exception
SyntaxErrorException - Description of Exception
ParseErrorException - Description of Exception

parseUnitTypes

private void parseUnitTypes(Reader in)
                     throws IOException,
                            SyntaxErrorException,
                            ParseErrorException
Parses the Unit Types configuration file.
Parameters:
theStream - The file stream.
Throws:
IOException - Description of Exception
SyntaxErrorException - Description of Exception
ParseErrorException - Description of Exception

parseUnits

private void parseUnits(Reader in)
                 throws IOException,
                        SyntaxErrorException,
                        ParseErrorException
Parses the Units configuration file.
Parameters:
theStream - The file stream.
Throws:
IOException - Description of Exception
SyntaxErrorException - Description of Exception
ParseErrorException - Description of Exception

parseActsOfGod

private void parseActsOfGod(Reader in)
                     throws IOException,
                            SyntaxErrorException,
                            ParseErrorException
Parses the Acts of God configuration file.
Parameters:
theStream - The file stream.
Throws:
IOException - Description of Exception
SyntaxErrorException - Description of Exception
ParseErrorException - Description of Exception

main

public static void main(String[] args)
The main program for the StartServer class
Parameters:
args - The command line arguments

abort

private static void abort(String message,
                          int exitStatus)
Description of the Method
Parameters:
message - Description of Parameter
exitStatus - Description of Parameter