From cf45a0ecac4bbd0b14702452f3c9d223ce66ed2f Mon Sep 17 00:00:00 2001 From: urthub Date: Sun, 19 Jan 2014 16:59:19 +0100 Subject: [PATCH] Add example to customize server cfg on map change --- conf/settings.conf | 10 ++++++---- spunky.py | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/conf/settings.conf b/conf/settings.conf index ae28728..cd861fa 100644 --- a/conf/settings.conf +++ b/conf/settings.conf @@ -5,12 +5,14 @@ rcon_password = secretpassword ; Password for RCON log_file = /opt/urbanterror/.q3a/q3ut4/games.log ; Full path of the 'games.log' file [rules] -show_rules = 1 ; Enable (1) or disable (0) displaying the rules -rules_frequency = 180 ; Interval when rules shall be repeated +show_rules = 1 ; Enable (1) or disable (0) displaying rules / rotation messages +rules_frequency = 180 ; Interval when rules / rotation messages shall be repeated [bot] max_ping = 200 ; Max allowed ping, player with higher ping will be kicked task_frequency = 60 ; Interval for checking ping, warnings and spectators teamkill_autokick = 1 ; Enable (1) or disable (0) autokick for team killing -gravity = 800 ; Set gravity to given value -verbose = 0 ; Enable (1) or disable (0) debug messages \ No newline at end of file +verbose = 0 ; Enable (1) or disable (0) debug messages + +[custom] +gravity = 800 ; Set gravity to given value -> check method new_game() for details \ No newline at end of file diff --git a/spunky.py b/spunky.py index bc5f1bd..b733214 100644 --- a/spunky.py +++ b/spunky.py @@ -1997,11 +1997,13 @@ def cmp_ab(p1, p2): def new_game(self): """ - set-up a new game, set gravity according to config file + set-up a new game """ - gravity = CONFIG.get('bot', 'gravity') self.rcon_handle.clear() - self.rcon_handle.push("set g_gravity %s" % gravity) + ## Example: set g_gravity according to the value in the config file + # uncomment the following 2 lines to enable this customization: + # gravity = CONFIG.get('custom', 'gravity') + # self.rcon_handle.push("set g_gravity %s" % gravity) ### Main ###