diff --git a/src/cmdtable.py b/src/cmdtable.py index 0fae0f6dc6..7bc2278242 100644 --- a/src/cmdtable.py +++ b/src/cmdtable.py @@ -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) \ No newline at end of file diff --git a/src/commands/unloggedin.py b/src/commands/unloggedin.py index dcfb56e2a1..1e69c34ddd 100644 --- a/src/commands/unloggedin.py +++ b/src/commands/unloggedin.py @@ -15,11 +15,6 @@ def cmd_connect(command): session = command.session - # Check whether command is being issued in-game. - if str(session.get_pobject()) != 'None': - session.msg("Connect command unavailable in-game") - return - # Argument check. # Fail gracefully if no argument is provided if not command.command_argument: @@ -55,11 +50,6 @@ def cmd_create(command): Handle the creation of new accounts. """ session = command.session - - # Check whether command is being issued ingame. - if str(session.get_pobject()) != 'None': - session.msg("Create command unavailable in-game") - return # Argument check. # Fail gracefully if no argument is provided