Add the home command.

This commit is contained in:
Greg Taylor 2009-04-06 22:07:41 +00:00
parent 867fb47be7
commit 899136760e
2 changed files with 14 additions and 1 deletions

View file

@ -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

View file

@ -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.