Colossus - Web Server

Scope

This document describes the Colossus WebServer functionality. The functionality is now part of the public build.

This is only needed if you want to run the server application, for example for testing purposes.

Building the software

The functionality has been merged to trunk. So use Eclipse or SVN to replace/update your working copy with the newest revision of colossus/trunk/Colossus.

Building it is basically the same as building the usual Colossus, but additionally there is a target "webjar". So the standard procedure is:

ant clean
ant 
ant webjar
Now it's ready to be run, but when you do it first time, you first still have to edit one configuration file.

Configuration

You have to create and adjust the file WebServer.cf (in the Colossus main directory, there where also Colossus.jar and build.xml are). Copy either WebServer_win.cf or WebServer_unix.cf to WebServer.cf and open it with your favorite editor.

Typically you will have to edit the lines with the following keys:

UsersFile=example.users.dat
JavaCommand=C:\\apps\\j2sdk_1.5.0_07\\bin\\java.exe
ColossusJar=C:\\workspace\\ColossusSVNJavaRaw\\Colossus.jar
LogPropTemplate=C:\\workspace\\ColossusSVNJavaRaw\\logging.properties
WorkFilesBaseDir=C:\\temp\\SomeColossus
Copy example.users.dat to a new name (e.g. users.dat) and change the setting here to that name (otherwise subversion will always flag this file as modified and you might accidentally submit the changed file to the repository).

Make JavaCommand point to your Java binary. (The WebServer starts a new java binary with a System.exec call - depending on the environment setup it may or may not be sufficient that java binary is in the PATH.)

Edit ColossusJar and LogPropTemplate to point to your Colossus Directory in which you built the new jars.

You may make WorkFilesBaseDir point to some other temporary directory. For every game the WebServer starts, it creates in that directory one subdirectory for the relevant gameId, and stores there the cf files and autosave files, which would usually be in the directory .Colossus/ under user's home directory.

You could edit also edit users.dat file, but you can create users using the WebClient GUI, and right now there's not much special what only admin type users can do - add it manually, or create one and edit the file later and replace user with admin according to the example data.

Running WebServer and WebClients

Starting the applications

For testing, I propose you open 3 commandline windows - one for the server and two for two clients.

In the first one, type

runwebserver
and in the two other ones for example in the beginning, to see what it does, just
run
or, when you have seen the startup often enough, and just want to test the WebClient functionality, I run them directly with username and the argument to directly start the webclient (e.g. I use users test1 and test2), so in the one window do this
run -w -m test1
and in the other one the same with username test2. Or any other name...

Note that the WebClient window saves its size and position, but all instances use same file - so, if you have 2 or more of them open, next time they both will reappear at the same position - the one saved latest by any of the earlier instances...

Using the WebClient

In the web server, there's not much to see or do. How to use the WebClient is documented in WebClient - that document is intended to become the general "How to use the WebClient" documentation once the whole thing becomes available to the general public.

Created October 2007.
Last updated friday, January 4, 2008 by Clemens Katzer