Removed spam-possibilities with page command (issue100). Also did several other refinements to the comm system.

This commit is contained in:
Griatch 2010-09-04 13:52:01 +00:00
parent d90c2909a2
commit 142cb00566
7 changed files with 36 additions and 26 deletions

View file

@ -64,16 +64,19 @@ if os.name == 'nt':
bat_file.write("@%s %%*" % twistd_path)
bat_file.close()
print """
INFO: Since you are running Windows, a twistd.bat file was created for you.
The twistd.bat is a simple batch file that tries to call the twisted
executable. The system has determined this to be:
INFO: Since you are running Windows, a file 'twistd.bat' was
created for you. This is a simple batch file that tries to call
the twisted executable. Evennia determined this to be:
%s
If you should run into errors you might need to edit twistd.bat to point to
the correct location of the Twisted executable (usually called twistd.py).
If you run into errors at startup you might need to edit
twistd.bat to point to the actual location of the Twisted
executable (usually called twistd.py) on your machine.
When you are ready, run this program again to retry the server restart.""" % twistd_path
This procedure is only done once. Run evennia.py again when you
are ready to start the server.
""" % twistd_path
sys.exit()
TWISTED_BINARY = 'twistd.bat'

View file

@ -733,11 +733,14 @@ class CmdPage(MuxCommand):
caller = self.caller
player = caller.player
# get the last message we sent
# get the last messages we sent
messages = list(Msg.objects.get_messages_by_sender(player))
pages = [msg for msg in messages
if msg.receivers]
print messages
print pages
if pages:
lastpage = pages[-1]
@ -746,16 +749,17 @@ class CmdPage(MuxCommand):
lastpages = messages[-10:]
else:
lastpages = messages
lastpages = "\n ".join(["%s to %s: %s" % (mess.date_sent, mess.receivers.all(),
mess.message)
for mess in messages])
lastpages = "\n ".join(["{w%s{n to {c%s{n: %s" % (page.date_sent,
"{n,{c ".join([obj.name for obj in page.receivers]),
page.message)
for page in pages])
caller.msg("Your latest pages:\n %s" % lastpages )
return
return
if not self.args or not self.rhs:
if pages:
string = "You last paged %s." % (", ".join([obj.name
for obj in lastpage.receivers.all()]))
string = "You last paged {c%s{n." % (", ".join([obj.name
for obj in lastpage.receivers]))
caller.msg(string)
return
else:
@ -773,7 +777,7 @@ class CmdPage(MuxCommand):
receivers = self.lhslist
recobjs = []
for receiver in receivers:
for receiver in set(receivers):
pobj = caller.search("*%s" % (receiver.lstrip('*')), global_search=True)
if not pobj:
return
@ -782,7 +786,7 @@ class CmdPage(MuxCommand):
header = "{wPlayer{n {c%s{n {wpages:{n" % caller.key
message = self.rhs
# create the persistent message object
msg = create.create_message(caller, message,
msg = create.create_message(player, message,
receivers=recobjs)
# tell the players they got a message.
for pobj in recobjs:

View file

@ -608,6 +608,8 @@ class CmdCreate(ObjManipCommand):
else:
string = "You create a new %s: %s."
string = string % (obj.typeclass, obj.name)
# set a default desc
obj.db.desc = "You see nothing special."
if 'drop' in self.switches:
if caller.location:
obj.move_to(caller.location, quiet=True)

View file

@ -192,6 +192,10 @@ class CmdCreate(MuxCommand):
location=default_home,
typeclass=typeclass,
home=default_home)
# set a default description
new_character.db.desc = "This is a Player."
new_character.db.FIRST_LOGIN = True
new_player = new_character.player
new_player.db.FIRST_LOGIN = True