Skip to content

Commit

Permalink
Add example to customize server cfg on map change
Browse files Browse the repository at this point in the history
  • Loading branch information
urthub committed Jan 19, 2014
1 parent 5e43e7b commit cf45a0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions conf/settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
verbose = 0 ; Enable (1) or disable (0) debug messages

[custom]
gravity = 800 ; Set gravity to given value -> check method new_game() for details
8 changes: 5 additions & 3 deletions spunky.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down

0 comments on commit cf45a0e

Please sign in to comment.