Admin/Competition Setup

Overview

This document describes the Administrator setup for running a normal competition with registration, or running competitions on the player side with a single registration for testing purposes.

The basic steps for running a competition (from scratch) are:

  1. Unpack the Admin files directory
  2. Run Pre-registration
  3. Pre-register Players: Teams register a team name, password, and team member names in order to be considered for later competitions
  4. Run admin.jar (Registration and Competition will result)
  5. Startup Players: Players will (automatically) register with the administrator, and wait for the competition time.
  6. Competition runs/completes
  7. Shutdown Players
Steps 1..3 only happen when setting up a new administrator path, and steps 4 and 5 can be modified to allow multiple competitions to be run with the same set of Players.

For the sake of this document, we will assume that we have created a directory in which to place our files (say setup), within it we have created two subdirectories, admin and players, and you have access to a number of terminals/shell prompts.

Main Competition Setup

The normal competition setup is essentially what is described above... but here are the details.

Setup the Admin Files

  1. Copy admin.jar into setup/admin/
  2. Within setup/admin/, run:
         jar -xf admin.jar files/config.txt prereg/prereg.html
  3. Also run:
         mkdir -p files/history

Pre-registration

  1. Within setup/admin/ run:
         java -cp admin.jar prereg.PreRegServer 7000
  2. Open the prereg page in FireFox:
         firefox ./prereg/prereg.html
  3. Submit registrations for Players/Teams to be involved.
  4. Close the PreRegServer (hit enter in the Prereg terminal)
The course staff has likely completed (or is in the process of completing) some of these steps. You should have alread chosen and registered your team name and password for the main course competitions on the prereg page.

Running a Main Competition

Starting the administrator is quite simple. There are two major running modes of the Admin, for running competitions at absolute and/or relative dates.

Absolute:

From within setup/admin/ run:
     java -jar admin.jar "MM/DD/YYYY hh:mm:ss am|pm"
Where the string is the starting date/time of the competition (fill in the date/time/am/pm accordingly). Registration will be open until the competition time. Player that are registered will be contacted to take each of their turns in the contest.

Relative:

From within setup/admin/ run:
     java -jar admin.jar --relative SECONDS
Where SECONDS is the number of seconds (i.e., an integer) before the competition starts. Registration will be open until the competition time, and those registered will be contacted to take their turns.

Once the Admin is running, you can start your player(s):

     java -jar player.jar 9000 server.domain.name "TeamName" "Password"
Where 9000 is the port we've chosen for our Player to comunicate on, server.domain.name is the address/machine where the Admin is running. For course competitions, the Admin address will be given by the course staff. For local competitions (Admin/Players running on the same machine) you can use the local host address: 127.0.0.1

No Registration Setup

While testing players it is usful to be able to run several competitions without the need to continually register players. We basically run a separate registration once, and reuse the Player address/port when contacting them.

Separate Regististration

  1. Choose free Ports for the Players (say 9000-9005)
  2. Within setup/admin/
         java -cp admin.jar reg.RegServer 8000
  3. Within setup/players/ register each of the Players:
         java -cp player.jar player.Register 9000 server.domain.name:8000 "Team1" "Pass1"
         java -cp player.jar player.Register 9001 server.domain.name:8000 "Team2" "Pass2"
              ...
  4. Close the RegServer (hit enter in the Reg terminal)
This will create a file in the setup/admin/ directory named files/players.txt that contains the team names, addresses, and port numbers. (This file is actually just a List of PlayerSpec).

Running a noreg Competition

  1. Start each Player (without registration):
         java -jar player.jar 9000 --noreg
         java -jar player.jar 9001 --noreg
              ...
  2. Run the Admin (also without registration)
    Absolute:
         java -jar admin.jar --noreg "MM/DD/YYYY hh:mm:ss am|pm"
    Or Relative:
         java -jar admin.jar --noreg --relative SECONDS
In this case the Players must be started before the Admin is run, since the administrator will start the competition immediately.