Difference between revisions of "Server Administration"

From #openttdcoop wiki

Jump to: navigation, search
m (Basic SVN Commands: wrong part bold)
 
(52 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
{{obsolete}}
 +
{{Merge |Wiki/Server Administration}}
 +
 
On this page all the needed commands are shown to administrate a Server via SSH and especially those for administrating the #openttdcoop Servers
 
On this page all the needed commands are shown to administrate a Server via SSH and especially those for administrating the #openttdcoop Servers
  
=== Directories ===
+
=== Servers / Directories ===
* [[Member Zone]]: ~/svn-zone/bin/
+
====ps.openttdcoop.org====
* [[Public Server]]: ~/svn-public/bin/
+
* 3979 - [[Public Server]]: '''~/svn-publicserver/autopilot/'''
* [[Coopetition|CoopetitionServer]]: ~/svn-coopetition/bin/
+
* 0000 - [[Special Server]]: '''~/svn-special/autopilot''' (inactive)
 +
* 0000 - [[Pro Dev Server]]: '''~/svn-dev/autopilot/''' (inactive)
 +
* 3982 - [[ProZone]]: '''~/svn-prozone/autopilot/'''
 +
* 3999 - [[StableServer]] '''~/svn-stable/autopilot/'''
 +
 
 +
====mz.openttdcoop.org====
 +
* 3979 - [[WWOTTDGD]]: '''~/svn-wwottdgd/autopilot/''' (inactive)
 +
* 3979 - [[YACD]]: ''' ~/svn-yacd/autopilot/'''
 +
* 3980 - [[Member Zone]]: '''~/svn-member/autopilot/''' (inactive)
 +
* 3981 - [[dev server]]: '''~/svn-play-is/autopilot/'''
 +
* 3982 - [[coopetition server]]: '''~/svn-h2h/autopilot/'''
 +
* 3999 - [[StableServer]] '''~/svn-stable/autopilot/'''
 +
 
 +
 
 +
Check internal member board for access infos.
 +
 
 +
=== Connecting to the server ===
 +
* Connect to the server with ssh
 +
* Issue command screen -x
 +
* Issue quit -> ends game without saving
 +
* Issue exit -> ends game with save
  
 
=== Starting the Server (via autopilot) ===
 
=== Starting the Server (via autopilot) ===
* Start a new game: ./autopilot.tcl new
+
* Start a new game: ./autopilot.tcl new | tee logs/<gamenr>.log
* Load the default savegame (save/game.sav): ./autopilot.tcl load
+
* Load the default savegame (save/game.sav): ./autopilot.tcl load | tee logs/<gamenr>.log
* Load another savegame: ./autopilot.tcl load save/game/path.sav
+
* Load another savegame: ./autopilot.tcl load save/game/path.sav | tee logs/<gamenr>.log
  
 
=== Reloading the Server (via console) ===
 
=== Reloading the Server (via console) ===
 
* configure settings with Progman's Config Tool
 
* configure settings with Progman's Config Tool
* save current game to ~/website/blog/files/publicserver_archive/PublicServerGame_$Number_Final.sav (we need to check if that is possible over ottd console...)
+
* save current game with '''save game$Number''' (Recommend to add a number, so you can find it better for archiving.)
* Reload server: newgame
+
* Reload server: '''newgame'''
  
 
=== Editing the openttd.cfg ===
 
=== Editing the openttd.cfg ===
'''Common things should be edited with the Configuration Tool: http://openttdcoop.ppcis.org/config/'''
+
'''Common things should be edited with the Configuration Tool: http://openttdcoop.org/config/'''
  
Before you start a new game, the config file has to be edited. Map-Size, diff_custom, [[GRF template for Administrators|NewGrfs]] and need to be set.
+
<div style="font-size: xx-small;">Before you start a new game, the config file has to be edited. Map-Size, diff_custom, [[GRF template for Administrators|NewGrfs]] and need to be set.
 
* To edit openttd.cfg via SSH you should use vim: '''vi openttd.cfg'''
 
* To edit openttd.cfg via SSH you should use vim: '''vi openttd.cfg'''
 
* To search for a string change to search-mode with '''?''' and type your search string, with '''n''' you can jump to next result.
 
* To search for a string change to search-mode with '''?''' and type your search string, with '''n''' you can jump to next result.
Line 25: Line 48:
 
* To save and leave vim, leave any mode first with '''ESC''', and type ''':wq''' (: = command mode)
 
* To save and leave vim, leave any mode first with '''ESC''', and type ''':wq''' (: = command mode)
 
* To leave without saving type ''':q!'''
 
* To leave without saving type ''':q!'''
* Some values are a bit confusing, i.e. diff_custom, you can find details about this value on the [[openttd:Diff_custom|openttd.org wiki page]]
+
* Some values are a bit confusing, i.e. diff_custom, you can find details about this value on the [[openttd:Diff_custom|openttd.org wiki page]]</div>
  
=== Basic SVN Commands ===
+
To upload a file to the publicserver (usually a .sav), use http://ps.openttdcoop.org/public/config/files.php
* We are updating our Server's via SVN: '''svn up -r $revision_number'''
+
  
* Sometimes everything is screwed up and we need to check out a new version (its very bad if this happens):
+
=== Updating the server ===
** Backing up the old data: i.e. '''cp -r ~/svn-coop/bin ~/backup'''
+
 
** Remove the corrupt copy: '''rm -rf ~/svn-coop'''
+
Easy way via script (updates automatically to the last nightly):
** Check out a new working copy via svn: '''svn co -r $revision_number svn://svn.openttd.org/trunk svn-coop'''
+
* ./update
** The Source should be patched with dihedrals reload patch.: '''patch -p0 < ~/network_nextgame_reload_cfg.patch''' (Sometimes, there are also other patches.)
+
Patch the server, if needed (see below for details). Make sure the patches apply cleanly. Otherwise fix them or skip them.
** Configure and Compile: ./configure --revision=rXXXXX (without M) && make
+
* patch -p0 < nomod.diff
** Restore files from the backup like grfs and openttd.cfg
+
* patch -p0 < bb2.diff
 +
* patch -p0 < magic_bulldozer.diff
 +
* patch -p1 < patches/keepBlitterForDedicated.p1.diff
 +
* make bundle
 +
Did the compile work? If so, copy the files:
 +
* cp -Rf bundle/* autopilot
 +
* cd autopilot
 +
* ./autopilot.tcl load | tee -a logs/<gamenr>.log
 +
 
 +
====Manual update====
 +
 
 +
* svn up rREV
 +
check, if all files have updated without conflicts (prefix "C"), if there are lines with "C":
 +
* svn revert . -R and reapply the patches
 +
on manual update, you need write the finger manually:
 +
* ./update -w
 +
 
 +
====Patching Server====
 +
The update script did revert the server build to clean trunk, but maybe we need to patch our server:
 +
the patches need to be multiplayer safe, no information can be saved in the savegame. We store the patches in subfolder patches.
 +
* nomod.diff: it does tell openttd to compile without adding "M" to the version
 +
* bb2.diff: logging the docommands
 +
* magic_bulldozer.diff: enables switch with rcon
 +
 
 +
First, you apply one patch ('''patch -p0 < patch.diff'''), if there are no errors, you take the next, if there are errors, you revert the apply with -R ('''patch -Rp0 < patch.diff''') and ask the patch creator to update or try self. If all patches are applied, you need to remake: '''make bundle''' (no configure).
 +
copy the bundle to autopilot: '''cp -Rf bundle/ autopilot/'''
 +
 
 +
====Support for [[Autostart]] and other tools====
 +
To support other tools to update client or homepage with current used revision etc., we need to have the following tags on our server:
 +
* '''rev''': currently used SVN trunk revision
 +
* '''grfversion''': currently used #openttdcoop NewGRF package version
 +
* '''patch.url''': currently used patch (mostly for dev server, link to TT-Forums)
 +
* '''$OS.url''': link to the binary (if it isn't a nightly)
 +
 
 +
Those "Tags" are located in http://<server>/<port>/
 +
They can be configured over the webconfigurator: config/urls.php
  
 
=== Using rcon ===
 
=== Using rcon ===
 
Some values have to be change in runtime, you can do this really easy with Remote Connection in-game. If you are connected to the Server toggle the Console with '''^''' and use commands:
 
Some values have to be change in runtime, you can do this really easy with Remote Connection in-game. If you are connected to the Server toggle the Console with '''^''' and use commands:
 
* To pause/unpause the game: '''rcon password pause/unpause'''
 
* To pause/unpause the game: '''rcon password pause/unpause'''
* To change a patch setting: '''rcon password "patch patch_setting value"''' (don't forget the breakets)
+
* To change a patch setting: '''rcon password "patch patch_setting value"''' (don't forget the quotation marks)
 
** To view a value of a setting: '''rcon password "patch patch_setting"'''
 
** To view a value of a setting: '''rcon password "patch patch_setting"'''
 
** Some settings use namespaces: i.e. '''"patch yapf.rail_use_yapf"'''
 
** Some settings use namespaces: i.e. '''"patch yapf.rail_use_yapf"'''
  
=== Archiving a Game ===
+
=== Archiving a PublicServer Game===
If a game is done do the following steps via SSH:
+
If a game is done do the following step via IRC: !transfer <num> localsave.sav (might be game.sav)
* '''exit''' (=save+exit) the game, the game will be saved to the default save: '''save/game.sav'''
+
then add a Report to the Wiki (if you don't have time, add at least the date and the used revision!)
* copy the file to the archive: '''cp save/game.sav ~/website/blog/files/publicserver_archive/PublicServerGame_$Number_Final.sav'''
+
 
* make the file accessible: '''chmod 755 ~/website/blog/files/publicserver_archive/PublicServerGame_$Number_Final.sav'''
+
== Custom Server Commands ==
* add a Report to the Wiki (if you don't have time, add at least the date and the used revision!)
+
 
 +
===!content===
 +
 
 +
Update the BaNaNaS content, needs !restart after to load the new NewGRFs
 +
 
 +
===!gamenr===
 +
 
 +
Sets the gamenr, needed for the logs and topic, run this before !restart
  
=== Dedicated Servers ===
+
===!restart===
====Ammler's server for high usage games.====
+
SSH: ottdc@mozart.ammler.ch
+
  
 +
Restarts the server after update or for newgame
  
 
[[Category:Guides]]
 
[[Category:Guides]]

Latest revision as of 04:53, 30 October 2014


On this page all the needed commands are shown to administrate a Server via SSH and especially those for administrating the #openttdcoop Servers

Servers / Directories

ps.openttdcoop.org

mz.openttdcoop.org


Check internal member board for access infos.

Connecting to the server

  • Connect to the server with ssh
  • Issue command screen -x
  • Issue quit -> ends game without saving
  • Issue exit -> ends game with save

Starting the Server (via autopilot)

  • Start a new game: ./autopilot.tcl new | tee logs/<gamenr>.log
  • Load the default savegame (save/game.sav): ./autopilot.tcl load | tee logs/<gamenr>.log
  • Load another savegame: ./autopilot.tcl load save/game/path.sav | tee logs/<gamenr>.log

Reloading the Server (via console)

  • configure settings with Progman's Config Tool
  • save current game with save game$Number (Recommend to add a number, so you can find it better for archiving.)
  • Reload server: newgame

Editing the openttd.cfg

Common things should be edited with the Configuration Tool: http://openttdcoop.org/config/

Before you start a new game, the config file has to be edited. Map-Size, diff_custom, NewGrfs and need to be set.
  • To edit openttd.cfg via SSH you should use vim: vi openttd.cfg
  • To search for a string change to search-mode with ? and type your search string, with n you can jump to next result.
  • To edit a value you have to change to the insert mode with i, then you can edit the values
  • To save and leave vim, leave any mode first with ESC, and type :wq (: = command mode)
  • To leave without saving type :q!
  • Some values are a bit confusing, i.e. diff_custom, you can find details about this value on the openttd.org wiki page

To upload a file to the publicserver (usually a .sav), use http://ps.openttdcoop.org/public/config/files.php

Updating the server

Easy way via script (updates automatically to the last nightly):

  • ./update

Patch the server, if needed (see below for details). Make sure the patches apply cleanly. Otherwise fix them or skip them.

  • patch -p0 < nomod.diff
  • patch -p0 < bb2.diff
  • patch -p0 < magic_bulldozer.diff
  • patch -p1 < patches/keepBlitterForDedicated.p1.diff
  • make bundle

Did the compile work? If so, copy the files:

  • cp -Rf bundle/* autopilot
  • cd autopilot
  • ./autopilot.tcl load | tee -a logs/<gamenr>.log

Manual update

  • svn up rREV

check, if all files have updated without conflicts (prefix "C"), if there are lines with "C":

  • svn revert . -R and reapply the patches

on manual update, you need write the finger manually:

  • ./update -w

Patching Server

The update script did revert the server build to clean trunk, but maybe we need to patch our server: the patches need to be multiplayer safe, no information can be saved in the savegame. We store the patches in subfolder patches.

  • nomod.diff: it does tell openttd to compile without adding "M" to the version
  • bb2.diff: logging the docommands
  • magic_bulldozer.diff: enables switch with rcon

First, you apply one patch (patch -p0 < patch.diff), if there are no errors, you take the next, if there are errors, you revert the apply with -R (patch -Rp0 < patch.diff) and ask the patch creator to update or try self. If all patches are applied, you need to remake: make bundle (no configure). copy the bundle to autopilot: cp -Rf bundle/ autopilot/

Support for Autostart and other tools

To support other tools to update client or homepage with current used revision etc., we need to have the following tags on our server:

  • rev: currently used SVN trunk revision
  • grfversion: currently used #openttdcoop NewGRF package version
  • patch.url: currently used patch (mostly for dev server, link to TT-Forums)
  • $OS.url: link to the binary (if it isn't a nightly)

Those "Tags" are located in http://<server>/<port>/ They can be configured over the webconfigurator: config/urls.php

Using rcon

Some values have to be change in runtime, you can do this really easy with Remote Connection in-game. If you are connected to the Server toggle the Console with ^ and use commands:

  • To pause/unpause the game: rcon password pause/unpause
  • To change a patch setting: rcon password "patch patch_setting value" (don't forget the quotation marks)
    • To view a value of a setting: rcon password "patch patch_setting"
    • Some settings use namespaces: i.e. "patch yapf.rail_use_yapf"

Archiving a PublicServer Game

If a game is done do the following step via IRC: !transfer <num> localsave.sav (might be game.sav) then add a Report to the Wiki (if you don't have time, add at least the date and the used revision!)

Custom Server Commands

!content

Update the BaNaNaS content, needs !restart after to load the new NewGRFs

!gamenr

Sets the gamenr, needed for the logs and topic, run this before !restart

!restart

Restarts the server after update or for newgame

Powered by MediaWiki
  • This page was last modified on 30 October 2014, at 04:53.