mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 21:17:17 +02:00
Made msg() properly trigger the at_msg_receive hook, as per #506.
This commit is contained in:
parent
4ab5e2aa22
commit
5d1b74ea17
1 changed files with 10 additions and 1 deletions
|
|
@ -473,6 +473,9 @@ class ObjectDB(TypedObject):
|
|||
sessid (int): sessid to relay to, if any.
|
||||
If set to 0 (default), use either from_obj.sessid (if set) or self.sessid automatically
|
||||
If None, echo to all connected sessions
|
||||
|
||||
When this message is called, from_obj.at_msg_send and self.at_msg_receive are called.
|
||||
|
||||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
|
|
@ -492,7 +495,13 @@ class ObjectDB(TypedObject):
|
|||
try:
|
||||
_GA(from_obj, "at_msg_send")(text=text, to_obj=self, **kwargs)
|
||||
except Exception:
|
||||
pass
|
||||
logger.log_trace()
|
||||
try:
|
||||
if not _GA(_GA(self, "typeclass"), "at_msg_receive")(text=text, **kwargs):
|
||||
# if at_msg_receive returns false, we abort message to this object
|
||||
return
|
||||
except Exception:
|
||||
logger.log_trace()
|
||||
|
||||
session = _SESSIONS.session_from_sessid(sessid if sessid else _GA(self, "sessid"))
|
||||
if session:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue