From 899136760ef0599862a3d22bdb8383cb5184dac4 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Mon, 6 Apr 2009 22:07:41 +0000 Subject: [PATCH] Add the home command. --- src/alias_mgr.py | 2 +- src/commands/privileged.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/alias_mgr.py b/src/alias_mgr.py index 613f019afd..43492701e0 100644 --- a/src/alias_mgr.py +++ b/src/alias_mgr.py @@ -11,7 +11,7 @@ def load_cmd_aliases(): alias_list = CommandAlias.objects.all() # Reset the list. - CMD_ALIAS_LIST = {} + CMD_ALIAS_LIST.clear() for alias in alias_list: CMD_ALIAS_LIST[alias.user_input] = alias.equiv_command diff --git a/src/commands/privileged.py b/src/commands/privileged.py index cee03a7301..55fdc244aa 100644 --- a/src/commands/privileged.py +++ b/src/commands/privileged.py @@ -138,6 +138,19 @@ def cmd_newpassword(command): GLOBAL_CMD_TABLE.add_command("@newpassword", cmd_newpassword, priv_tuple=("genperms.manage_players")) +def cmd_home(command): + """ + Teleport the player to their home. + """ + pobject = command.source_object + if pobject.home == None: + pobject.emit_to("You have no home set, @link yourself to somewhere.") + else: + pobject.emit_to("There's no place like home...") + pobject.move_to(pobject.get_home()) +GLOBAL_CMD_TABLE.add_command("home", cmd_home, + priv_tuple=("genperms.tel_anywhere")) + def cmd_shutdown(command): """ Shut the server down gracefully.