Skip to content

Commit

Permalink
listcommands works
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed Nov 15, 2009
1 parent fd9eb3f commit 7d4eaea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/pyscripts/xsbs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ def allowTeamSwitch(cn, team):


registerCommandHandler('help', xsbs.help.onHelpCommand)
registerCommandHandler('listcommands', xsbs.help.listPublicCommands)

9 changes: 8 additions & 1 deletion src/pyscripts/xsbs/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def loadCommandInfo(command, handler):
info.description = line[len(tag)+1:]
valid = True
elif tag == '@public':
info.public == True
info.public = True
valid = True
if valid:
command_info[command] = info
Expand Down Expand Up @@ -79,3 +79,10 @@ def onPlayerCommands(cn, args):
msg += '#' + command + ' '
sbserver.playerMessage(cn, orange(msg))

def listPublicCommands(cn, args):
str = 'Public commands: '
for cmd in command_info.items():
if cmd[1].public:
str += cmd[1].command + ' '
sbserver.playerMessage(cn, info(str))

0 comments on commit 7d4eaea

Please sign in to comment.