Skip to content

Commit

Permalink
added #mapmodifyspec enable/disable
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed Nov 8, 2009
1 parent d5dc1de commit 686992f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pyscripts/CheatDetection/cheatdetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from xsbs.players import player
from xsbs.ui import warning
from xsbs.settings import PluginConfig
from xsbs.commands import registerCommandHandler

config = PluginConfig('cheatdetection')
spectate_map_modified = (config.getOption('Config', 'spectate_map_modified', 'yes') == 'yes')
Expand All @@ -22,7 +23,18 @@ def checkModified(cn):
except ValueError:
pass

def mapModifiedSpecCmd(cn, args):
if args == 'disable':
spectate_map_modified = False
sbserver.playerMessage(info('Spectate modified mapes disabled'))
elif args == 'enable':
spectate_map_modified = True
sbserver.playerMessage(info('Spectate modified mapes enabled'))
else:
sbserver.playerMessage(cn, error('Usage: #mapmodifiedspec (enable/disable)'))

registerServerEventHandler('player_modified_map', onMapModified)
registerServerEventHandler('player_active', checkModified)
registerServerEventHandler('player_unspectated', checkModified)
registerCommandHandler('mapmodifiedspec', mapModifiedSpecCmd)

0 comments on commit 686992f

Please sign in to comment.