From e6d3d9395dbb2b827c2ab08e768b6aac3598ea3b Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Mon, 12 Jan 2009 18:01:35 +0000 Subject: [PATCH] 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. --- src/cmdtable.py | 8 ++++++-- src/commands/unloggedin.py | 10 ---------- 2 files changed, 6 insertions(+), 12 deletions(-) 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