Difference between revisions of "Gamedata Updating (SourceMod)"

From AlliedModders Wiki
Jump to: navigation, search
(New page: We now have a gamedata auto-updating feature in SourceMod (for gamedata files only). When your server starts, SourceMod will contact AlliedModders to check for gamedata file updates. Allie...)
 
(Configuration)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
We now have a gamedata auto-updating feature in SourceMod (for gamedata files only). When your server starts, SourceMod will contact AlliedModders to check for gamedata file updates. AlliedModders will send back new files if they are available.
+
SourceMod has an automatic updating feature for gamedata files. When your server starts, SourceMod will contact AlliedModders to check for gamedata updates. AlliedModders will send back new files if they are available.
  
As part of this effort, if your server crashes on load, gamedata files will become locked, and no "hacky" functionality will be available. The motivation behind this is to give your server time to update safely in case plugins are trying to run functions that are doomed to crash.  
+
This feature has been available since SourceMod 1.1.  However the updating mechanism was rewritten in 1.2, and servers running 1.1 will no longer receive updates. This documentation applies only to SourceMod 1.2 and higher.
 
 
=Users=
 
  
 
==Configuration==
 
==Configuration==
  
core.cfg has four new settings to control the autoupdaters functionality
+
<tt>core.cfg</tt> has four new settings to control the autoupdaters functionality
  
 
*DisableAutoUpdate
 
*DisableAutoUpdate
Line 13: Line 11:
 
**The default value is "no". A value of "yes" will block the Auto Updater.
 
**The default value is "no". A value of "yes" will block the Auto Updater.
 
*ForceRestartAfterUpdate
 
*ForceRestartAfterUpdate
**Enables or disables automatic restarting of the server after a successful update.
+
**Enables or disables automatic restarting of SourceMod after a gamedata update.
**The default value is "no". A value of "yes" will let the server automatically restart.
+
**The default value is "no". A value of "yes" will make SourceMod reload itself and refresh the map.
*AutoUpdateServer
+
*AutoUpdateURL
**Sets the server to connect to for auotmatic gamedata updates.
+
**Sets the URL to connect to for automatic updates.
**Default is "hayate.alliedmods.net"
+
**Default is "http://update.sourcemod.net/update/"
*AutoUpdatePort
 
**Sets the port to connect to on the AutoUpdateServer server
 
**Default is 6500
 
 
 
=Developers=
 
 
 
The daemon is a c++ linux console app that listens for incoming gamedata requests and replies with any changed files.
 
The default listening port is 6500.
 
SourceCode is available from mercurial under tools/daemon.
 
 
 
==File Layout==
 
 
 
All runtime files used are stored in a subdirectory of the daemon executable called 'md5'.
 
The list of recognised files is hard coded into the program.
 
Each recognised gamedata file must also have a matching information file with an identical name bar using *.sums for the extension instead of *.txt. This file contains the current md5 sum on the first line and the name of the gamedata file it relates to on the second line.
 
All known md5 sums for a file are created as symlinks pointing to the sums file.
 
 
 
==Updating Daemon==
 
 
 
*Overwrite the gamedata file with the new one
 
*Edit the sums file to have the new md5 sum - There is a special calculator for this in tools/gamedata_md5
 
*Add a symlink from the sum to the sums file
 
*There is a script called 'updateGameData.sh' which can do the second part of this for you
 
./updateGameData.sh <filename with no extension>
 
  
==Protocol==
+
==Custom Files==
  
Should I doc this? Can't find the bug report where it was..
+
Gamedata files from the default SourceMod distribution can be overwritten even if there are custom changes.  To make protected custom changes, use the <tt>custom</tt> folder under the gamedata directory.  All files under this directory are parsed (in an undefined order) after the main files are loaded. They will never be overwritten.
  
==ToDo==
 
  
*Convert daemon to a proper system process/daemon and remove it from my user
+
[[Category:SourceMod Documentation]]
*Run another test with the recent gamedata changes
 
*Add structs gamedata file to the daemon
 

Latest revision as of 11:29, 27 August 2013

SourceMod has an automatic updating feature for gamedata files. When your server starts, SourceMod will contact AlliedModders to check for gamedata updates. AlliedModders will send back new files if they are available.

This feature has been available since SourceMod 1.1. However the updating mechanism was rewritten in 1.2, and servers running 1.1 will no longer receive updates. This documentation applies only to SourceMod 1.2 and higher.

Configuration

core.cfg has four new settings to control the autoupdaters functionality

  • DisableAutoUpdate
    • Enables or Disables SourceMod's automatic gamedata updating.
    • The default value is "no". A value of "yes" will block the Auto Updater.
  • ForceRestartAfterUpdate
    • Enables or disables automatic restarting of SourceMod after a gamedata update.
    • The default value is "no". A value of "yes" will make SourceMod reload itself and refresh the map.
  • AutoUpdateURL

Custom Files

Gamedata files from the default SourceMod distribution can be overwritten even if there are custom changes. To make protected custom changes, use the custom folder under the gamedata directory. All files under this directory are parsed (in an undefined order) after the main files are loaded. They will never be overwritten.