Fixed some hooks to match wiki docs.

This commit is contained in:
Griatch 2011-02-14 18:31:16 +00:00
parent 923b9ac2ec
commit 6a13d07c55
3 changed files with 18 additions and 4 deletions

View file

@ -230,7 +230,7 @@ class Object(TypeClass):
string += ", ".join(things)
return string
def at_msg_receive(self, msg, from_obj=None):
def at_msg_receive(self, msg, from_obj=None, data=None):
"""
This hook is called whenever someone
sends a message to this object.
@ -249,7 +249,7 @@ class Object(TypeClass):
"""
return True
def at_msg_send(self, msg, to_obj):
def at_msg_send(self, msg, to_obj=None, data=None):
"""
This is a hook that is called when /this/ object
sends a message to another object with obj.msg()

View file

@ -258,11 +258,11 @@ class PlayerDB(TypedObject):
"""
if from_obj:
try:
from_obj.at_msg_send(outgoing_string, self)
from_obj.at_msg_send(outgoing_string, to_obj=self, data=data)
except Exception:
pass
if self.character:
if self.character.at_msg_receive(outgoing_string, from_obj):
if self.character.at_msg_receive(outgoing_string, from_obj=from_obj, data=data):
for session in object.__getattribute__(self, 'sessions'):
session.msg(outgoing_string, data)