Main Page | About | Help | FAQ | Special pages | Log in

Contents

Get the Code

 svn co https://ospace.svn.sourceforge.net/svnroot/ospace/branches/ospace_0.5

Please note that the following Python components are required to run the server: pygame, metakit

You may also want to install: epydoc, psyco

Metakit Note

The precompiled binary of Metakit (November 2005 build) works only with Python 2.4 and before. You can compile Metakit yourself from the source if you want to use Python 2.5. Python 2.5 requires Metakit 2.4.9.7 or later.

Note that for Mac OSX Leopard, there are several errors in the install instructions:

Where is the Server?

Linux: open a shell terminal
Windows: open command prompt
Change directory to where you installed Outerspace.
Note: Currently there are two versions: Branch and Trunk. When running the client and the server, you will 
need to use Branch. Trunk is not presently stable (6/8/07).
cd ospace_0.5/server

Initialize Server:

While in the server directory:

 python run.py --reset
 python run.py 

Use the --reset line only on first run.

Server Options:

 --reset : create a new universe; if a universe exists, destroy it first
 --upgrade : perform upgrade routine (also executes all objects' "update" methods, if found); you will need to do 
   this when updating to a newer version from the SVN. If the changes were just client-side, this isn't needed.
 --config <filename> : load an alternate config file; normally the config file loaded is var/config.ini
 --restore <filename> : restore from a database backup

Common Issues:

If the server fails to start with the message, "server.pid exists" then the server was improperly shut down. Just delete var/server.pid and it will run again. This prevents running two servers at once.

OSClient

In a separate terminal window, while in the server directory:

 python osclient.py admin

This will log you into the admin client. If you have set a password for admin, it will prompt you for it.

You will need this for almost all server commands.

Quick start

You will see a menu in OSClient. If you don't, you probably forgot the .py on the python command.

Each command is a single letter followed by return. I will write them as <letter> : <definition> for readability.

The first thing you will want to do is create a galaxy:

 g : create a galaxy
   Enter galaxy name
   Enter galaxy center coordinates (normally multiples of 100)

Once this is done, you can log into your server from any Client. We recommend you use the version in the SVN repository to guarantee compatibility with the SVN server version. You can run this from branch/ospace_0.5/client-pygame/osc.py or osc.pyc.

You will need to update the config file (which probably doesn't exist yet):

 cd ospace/client-pygame
 mkdir var
 cat >var/osci.ini <<END
 [game]
 server = localhost:9080
 
 [client]
 updatemode = never
 keepAlive = 10
 END

Create an account and log into the galaxy you just created. We won't go into details on this here since hopefully you should be familiar with the client from playing OuterSpace already. Note: Galaxies with only one account will be automatically restarted during voting.

The second thing you will want to do is start time. Once all people have joined, use this command:

 s : start time

Your galaxy time is now running, but you need to process turns to get it moving.

 t : process single turn
 r : process multiple turns

Or from terminal prompt:

  python osclient --turns=X admin

If you feel industrious, you can write a cron job to process turns for you.

Detailed guide

OSClient Commands

Each command in OSClient has a corresponding command from the console prompt. For instance:

 Create galaxy: >>> s.createNewGalaxy(1, 100, 200, 'Argo')
 Start time: >>> s.enableTime(<<galaxyID>>, 1)
 Process turn: >>> s.processTurn()
 Run a backup: >>> s.backup(<filename>)

To enter the console:

 c : console

You can always use the console to access the game and gain more control over it than from the menu. However, you are limited to admin commands, which are not documented at present, so you'll need to do a lot of code reading to use it.

Stopping the Server

To stop the server:

 If it is running in the foreground, simply press Ctrl-C.
 Otherwise, send a SIGTERM signal to it: kill -s TERM `cat var/server.pid`

Admin Passwords

Set the Admin User password:

 python useradd.py admin password Admin email@domain.com

Pirate Passwords

Set pirate password:

 Create a config file if it doesn't exist: server/var/config.ini
 It needs to contain the following:
 [vip]
 password = {some password}

How to run backup

Use osclient and run: >>> s.backup(<filename>)

Retrieved from "http://www.ospace.net/wiki/index.php/ServerHowTo"

This page has been accessed 5,828 times. This page was last modified 02:17, 21 January 2008.


Browse
Main Page
Download
Help
FAQ
SourceForge
Links

Server sponsor
K2 Software
K2 Software
Find
Advertising

This page
Printable version
Context
Page history
What links here
Related changes


SourceForge.net Logo