Implemented page history, meaning you don't need to provide your victim's name/alias and the equal sign after the initial page. TODO: Allow paging multiple people at once, ala MUX.
This commit is contained in:
parent
c4597f41a1
commit
4f67efb70a
2 changed files with 12 additions and 1 deletions
|
|
@ -253,6 +253,13 @@ def cmd_page(cdat):
|
||||||
# Combine the arguments into one string, split it by equal signs into
|
# Combine the arguments into one string, split it by equal signs into
|
||||||
# victim (entry 0 in the list), and message (entry 1 and above).
|
# victim (entry 0 in the list), and message (entry 1 and above).
|
||||||
eq_args = ' '.join(args).split('=')
|
eq_args = ' '.join(args).split('=')
|
||||||
|
|
||||||
|
# If no equal sign is in the passed arguments, see if the player has
|
||||||
|
# a LASTPAGED attribute. If they do, default the page to them, if not,
|
||||||
|
# don't touch anything and error out.
|
||||||
|
if len(eq_args) == 1 and pobject.has_attribute("LASTPAGED"):
|
||||||
|
eq_args.insert(0, "#%s" % (pobject.get_attribute_value("LASTPAGED"),))
|
||||||
|
|
||||||
if len(eq_args) > 1:
|
if len(eq_args) > 1:
|
||||||
target = functions_db.player_search(pobject, eq_args[0])
|
target = functions_db.player_search(pobject, eq_args[0])
|
||||||
message = ' '.join(eq_args[1:])
|
message = ' '.join(eq_args[1:])
|
||||||
|
|
@ -272,9 +279,13 @@ def cmd_page(cdat):
|
||||||
(pobject.get_name(show_dbref=False), message))
|
(pobject.get_name(show_dbref=False), message))
|
||||||
session.msg("You paged %s with '%s'." %
|
session.msg("You paged %s with '%s'." %
|
||||||
(target[0].get_name(show_dbref=False), message))
|
(target[0].get_name(show_dbref=False), message))
|
||||||
|
pobject.set_attribute("LASTPAGED", target[0].id)
|
||||||
else:
|
else:
|
||||||
session.msg("Player %s does not exist or is not online." %
|
session.msg("Player %s does not exist or is not online." %
|
||||||
(target[0].get_name(show_dbref=False),))
|
(target[0].get_name(show_dbref=False),))
|
||||||
|
else:
|
||||||
|
session.msg("Page who?")
|
||||||
|
return
|
||||||
|
|
||||||
def cmd_quit(cdat):
|
def cmd_quit(cdat):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ NOSAVE_FLAGS = ["CONNECTED"]
|
||||||
NOSET_FLAGS = ["CONNECTED"]
|
NOSET_FLAGS = ["CONNECTED"]
|
||||||
|
|
||||||
# These attribute names can't be modified by players.
|
# These attribute names can't be modified by players.
|
||||||
NOSET_ATTRIBS = ["MONEY", "ALIAS"]
|
NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED"]
|
||||||
|
|
||||||
# Server version number.
|
# Server version number.
|
||||||
EVENNIA_VERSION = 'Pre-Alpha'
|
EVENNIA_VERSION = 'Pre-Alpha'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue