From 6d52103359d16f53ae6b6a73607a617ece9628c4 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Mon, 30 Apr 2007 13:29:36 +0000 Subject: [PATCH] Fix paging to take multi-word victims. Also updated messages to match MUX2. --- commands_general.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/commands_general.py b/commands_general.py index 2583a69ca..c1f291f88 100644 --- a/commands_general.py +++ b/commands_general.py @@ -250,11 +250,13 @@ def cmd_page(cdat): if len(args) == 0: session.msg("Page who/what?") return - - eq_args = args[0].split('=') + + # Combine the arguments into one string, split it by equal signs into + # victim (entry 0 in the list), and message (entry 1 and above). + eq_args = ' '.join(args).split('=') if len(eq_args) > 1: target = functions_db.local_and_global_search(pobject, eq_args[0]) - message = eq_args[1:] + message = ' '.join(eq_args[1:]) if len(target) == 0: session.msg("I can't find the user %s." % (eq_args[0].capitalize(),)) @@ -267,12 +269,13 @@ def cmd_page(cdat): return else: if target[0].is_connected_plr(): - target[0].emit_to("%s pages you with: %s" % - (pobject.get_name(), ' '.join(message))) - session.msg("Page sent.") + target[0].emit_to("%s pages: %s" % + (pobject.get_name(show_dbref=False), message)) + session.msg("You paged %s with '%s'." % + (target[0].get_name(show_dbref=False), message)) else: session.msg("Player %s does not exist or is not online." % - (target[0].name.capitalize(),)) + (target[0].get_name(show_dbref=False),)) except: from traceback import format_exc session.msg("Untrapped error: %s" % (format_exc(),))