Game Server

Here is a link to the page with the server source code on it.

Here is a link to all the compiled code ready to roll. If you do need to recompile for some reason just use make and it should do it all for you.
NOTE: gamesServer.tar is a tar file sontaining all the files in the directory, so you can just download it an untar it in a directory with "tar -xvf gameServer.tar".

You can unpack this code and compile it in the burrow. You can run the server on the burrow too.

So go to the burrow or ssh into the burrow. If you go there open a shell aka a terminal from the start menu

To run the server first find an open port. To do this use "checkport [some port number]".

Example:
I want to check port 7777, so I type:

checkport 7777
then it tells me in english if that port is in use. Go ahead and try port 7777. You will probably find it not in use because the server I have been running is on burrowww.cs.indiana.edu.


Next you need to find out what machine you are on. There are about 20 machines in the burrow. To do this type:

hostname
this will tell me the address of the host machine you are on.


So lets say you are on marmot.cs.indiana.edu and you know port 7777 is free. You need to start the server on port 7777.

To run the server go into the directory where you have your compiled server code. One of the files in there is simply called Simulator. This is the "executable" of this program for unix. Type:

./Simulator
this does not run the code but rather gives you a list of arguments that Simulator can take.

To run a continous game with unlimited players using the maze map start simulator like this:

./Simulator -p 7777 -m maze -k maze.packs &
If you want to restrict it to only one player use:
./Simulator -p 7777 -n 1 -m maze -k maze.packs &
See the difference?

OK, Remeber how we wanted to know what machine we were starting this server on? We wanted to know that because we have to modify the client code to connect to that machine on whatever port we are running the server. So in Prof. Sabrys code we are connecting to burrowww.cs.indiana.edu, but the server we have been working with in this example is on marmot.cs.indian.edu. So change burrowww to marmot. We are still on port 7777 so that doesn't have to change, but if we had chosen a different port it would have to change.

Now you have a running server and client rigged to connect to it. So lets talk about some helpful unix commands.

  1. "cd" is the change directory command.
    cd .. Goes up to the previous directory
    cd gameServer takes you into the gameServer directory
  2. "ps -u [username]" gives you a list of all the processes [username] is running.
    You will want to use your username for [username] because it will tell you if your server is still running or not. If you don't see it in the list of processes for you then it is not running.
  3. "ls" Similar to dir in dos. Lists all the all the files and directories in the current directory
  4. "rm [filename]" Removes (deletes) the file you give it.
    "rm *.log" This removes all the files in the current directory with a .log extension
  5. "pico [filename]" Pico is a simple text editor you can use to view the .log files that the server creates
  6. "mkdir [directory name]" This command creates a directory (folder) with the name you give it.
  7. "tar -xvf [filename]" Unpacks the file you give it into the current directory. You must give it a tar file.

UITS software download website

In case you need it the adress for any machine in the burrow looks like this: [machine name].cs.indiana.edu


Last modified: Tue Oct 29 21:47:47 US Eastern Standard Time 2002