Previously, the global command table was being filled with entries from other tables due to some funky globalization of the ctable instance variable. Fixed that and yanked the conditionals on a few of the logged out commands that check for logged in status.

This commit is contained in:
Greg Taylor 2009-01-12 18:01:35 +00:00
parent 0b533b984d
commit e6d3d9395d
2 changed files with 6 additions and 12 deletions

View file

@ -23,7 +23,11 @@ class CommandTable(object):
"""
Stores command tables and performs lookups.
"""
ctable = {}
ctable = None
def __init__(self):
# This ensures there are no leftovers when the class is instantiated.
self.ctable = {}
def add_command(self, command_string, function, priv_tuple=None):
"""
@ -121,4 +125,4 @@ Global unconnected command table, for unauthenticated users.
GLOBAL_UNCON_CMD_TABLE = CommandTable()
GLOBAL_UNCON_CMD_TABLE.add_command("connect", commands.unloggedin.cmd_connect)
GLOBAL_UNCON_CMD_TABLE.add_command("create", commands.unloggedin.cmd_create)
GLOBAL_UNCON_CMD_TABLE.add_command("quit", commands.unloggedin.cmd_quit)
GLOBAL_UNCON_CMD_TABLE.add_command("quit", commands.unloggedin.cmd_quit)