Difference between revisions of "Server Administration"

From #openttdcoop wiki

Jump to: navigation, search
(Editing the openttd.cfg)
(Patching Server: all patches are p0 now)
Line 72: Line 72:
 
The update script did revert the server build to clean trunk, but maybe we need to patch our 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.
 
the patches need to be multiplayer safe, no information can be saved in the savegame.  We store the patches in subfolder patches.
* nomod.patch (p1): it does tell openttd to compile without adding "M" to the version
+
* nomod.diff: it does tell openttd to compile without adding "M" to the version
* bb2.diff (p0): logging the docommands  
+
* bb2.diff: logging the docommands  
* magic_bulldozer.diff (p0): enables switch with rcon
+
* 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).
 
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).

Revision as of 13:20, 4 December 2009

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

  • 3979 - Public Server: ~/svn-public/autopilot/ (Web: ~/website/public/)
  • 3980 - Special Server: ~/svn-special/autopilot (Dutchset) (Web: ~/website/special/)
  • 3981 - Pro Dev Server: ~/svn-dev/autopilot/ (Web: ~/webiste/dev/)
  • 3982 - ProZone: ~/svn-prozone/autopilot/ (Web: ~/website/prozone/)

mz.openttdcoop.org

  • 3979 - WWOTTDGD: ~/svn-wwottdgd/autopilot/ (Web: ~/public_html/wwottdgd/)
  • 3980 - Member Zone: ~/svn-member/autopilot/ (Web: ~/public_html/member/)
  • 3981 - dev server: ~/svn-play-is/autopilot/ (Web: ~/public_html/is2)
  • 3982 - coopetition server: ~/svn-h2h/autopilot/ Web: ~/public_html/h2h/)

www.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>
  • Load the default savegame (save/game.sav): ./autopilot.tcl load | tee logs/<gamenr>
  • Load another savegame: ./autopilot.tcl load save/game/path.sav | tee logs/<gamenr>

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 (Basic SVN Commands)

Use the update script: ./update (automatically update to last nightly revision)

* We are updating our Server's via SVN: svn up -r $revision_number && ./configure -D && make
  • Sometimes everything is screwed up and we need to check out a new version (its very bad if this happens):
    • Backing up the old data: i.e. cp -r ~/svn-coop/bin ~/backup
    • Remove the corrupt copy: rm -rf ~/svn-coop
    • Check out a new working copy via svn: svn co -r $revision_number svn://svn.openttd.org/trunk svn-coop
    • Restore files from the backup like grfs and openttd.cfg
    • make the binary:
      • ./configure --enable-dedicated
      • make bundle
      • cp -Rf bundle/* autopilot
    • edit ~/website/rev to $revision_number
    • start autopilot:
      • cd autopilot
      • ./autopilot.tcl [load <game>]

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!)

Powered by MediaWiki