import random
import re
+import traceback
import unicodedata
import mudpy
else:
message = "Arglebargle, glop-glyf!?!"
- # send the error message
- actor.send(message)
+ # try to send the error message, and log if we can't
+ try:
+ actor.send(message)
+ except Exception:
+ mudpy.misc.log(
+ 'Sending a command error to user %s raised exception...\n%s' % (
+ actor.owner.account.get("name"), traceback.format_exc()))
def halt(actor, parameters):
def move(actor, parameters):
"""Move the avatar in a given direction."""
- if parameters in actor.universe.contents[actor.get("location")].portals():
- actor.move_direction(parameters)
- else:
- actor.send("You cannot go that way.")
+ for portal in sorted(
+ actor.universe.contents[actor.get("location")].portals()):
+ if portal.startswith(parameters):
+ actor.move_direction(portal)
+ return(portal)
+ actor.send("You cannot go that way.")
def preferences(actor, parameters):