Currently Online

Latest Posts

Changes in DedicatedServer

Editor Comment

added motd

Revision Differences of Revision 6

# Dedicated Server ¶

#### Contents ¶
[TOC] ¶

## How does it work ¶
From Build 16 on, the main Widelands executable supports a terminal based "dedicated server modus". Following is a short description how this modus works: ¶

* To start Widelands in dedicated Modus, run Widelands in a terminal like this: _widelands --dedicated=<path to default map>_ ¶
* Server starts up, connects to the metaserver and opens a game with the default map. ¶
* The clients can now connect set up the server via chat commands and can start the game. ¶
* Once started the game runs until the last player left. Afterwards, the dedicated server closes the game, reconnects to the metaserver and reopens a new game with the default map. ¶

## How to compile ¶
_If you have any notes on how one can ease the compilation of Widelands as dedicated server without X server or similiar stuff, please add here_ ¶

## Start up commands ¶
There are some dedicated server specific start up commands, following list may not be complete, but should at least show the most important ones: ¶

* _--dedicated=<path to default map>_ : Mandatory to run the dedicated server. The map given in argument will be loaded at startup and at each restart (after end of a game). ¶

And general startup commands: ¶
* _--nickname=<hostname>_ : The name that will be used for login into the metaserver. ¶
* _--servername=<servername> : The name that will show up in the server list ¶
* _--autosave=number : number of seconds between each autosave ¶

### New commands introduced after build16 ¶
* _--dedicated_saving=true/false_ : if true(default), players can send the server a message to save the game under a specific name, to continue the game later on. ¶
* _--dedicated_password=<password>
_ : The password, if the server is supposed to be password protected
* _--dedicated_motd=<Message of the day>: If you want to replace the default "this is a dedicated server write "@server help" to get help" message, write your message to this command. ¶

## Commands at runtime ¶
There are several commands you can give a dedicated server by sending a private message (e.g. "@dedicated start") ¶

### General ¶
These commands can be executed during set up time and in a running game. ¶

* _help_ : Shows all available commands (same as this paragraph). ¶
* _host_ : Runs a host command like "/announce <msg>", "/warn <user> <msg>" or "/kick <user> <reason>" ¶

#### New commands introduced after build16 ¶
The following commands were introduced after build16: ¶

* _pwd_ : can be used to send the password to the server, if the dedicated server is password protected. ¶

### During game setup ¶
(The following commands are only valid for the build16 version of the dedicated server - after build16 they were removed, as the dedicated server gsot enhanced that way, that users can set up the server via their own launch game lobby interface, like if they were the hosting player.)

* _start_ : Starts the game ¶
* _ls_maps_ : Shows a list of available/selectable maps on the host. ¶
* _ls_saved_games_ : Shows a list of available/selectable saved games on the host. ¶
* _switch_map $_ : Switch to map $ (full name with .wmf) ¶
* _switch_save $_ : Switch to saved game $ (full name with .wgf) ¶
* _toggle_type #_ : Toggle type of player # ¶
* _toggle_tribe #_ : Toggle tribe of player # ¶
* _toggle_init #_ : Toggle initialization of player # ¶
* _toggle_win_con_ : Toggles the win condition ¶

### During playing ¶

* _save $:_ : Tries to save the game to save/$.wgf, if possible and if enabled on dedicated server (default) ¶