Class Server

java.lang.Object
za.co.wethinkcode.robots.server.Server

public class Server extends Object
Represents the Robot World server. This class is responsible for loading the server configuration, creating the game world, starting the server, accepting client connections, and managing the server
  • Constructor Details

    • Server

      public Server(WorldConfig config, World world, String ipAddress)
      The standard constructor of a new Server
      Parameters:
      config - the config of the world containing things like obstacles etc
      world - the domain object of the world that robots are connecting to
      ipAddress - the IP address of the current server.
  • Method Details

    • main

      public static void main(String[] args)
      The main method of the Server class.
      Parameters:
      args - Command Line Arguments
    • newServer

      public static Server newServer(String[] args) throws ServerInitilisationError
      Static style configuration stage for setting up a server.

      This sets up registerShutdownHook() as well as applying the necessary overrides

      Parameters:
      args - args passed in directly
      Returns:
      the configured Server
      Throws:
      ServerInitilisationError