From d017ff0d39186e2ec10e6cfaa62ea92ff5078b78 Mon Sep 17 00:00:00 2001 From: Michael King Date: Thu, 26 Apr 2007 23:35:37 +0000 Subject: [PATCH] * Added cmd_page. I think I'm running into SQLite problems, as when the command runs, it simply dumps the session. I tried to test this on MySQL, but I can't get syncdb to work, either. (tsalaroth mking@arikel.net) --- commands_general.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/commands_general.py b/commands_general.py index 255d4049d5..613a96fe67 100644 --- a/commands_general.py +++ b/commands_general.py @@ -237,6 +237,23 @@ def cmd_examine(cdat): session.msg("Location: %s" % (target_obj.get_location(),)) +def cmd_page(cdat): + """ + Send a message to target user (if online). + """ + session = cdat['session'] + target_name = cdat['uinput']['splitted'][1:][0] + message = cdat['uinput']['splitted'][1:][1:] + target = Object.objects.get(name__iexact=target_name) + try: + if target.is_connected_plr(): + target.emit_to("% pages you with: %s" % (session.something, message)) + session.get_pobject().emit_to("Page sent.") + else: + session.get_pobject().emit_to("User %s is not logged on." % target_name.capitalize()) + except: + session.get_pobject().emit_to("User %s not found." % target_name) + def cmd_quit(cdat): """ Gracefully disconnect the user as per his own request.