Some optimizations, cleanup and a few bugfixes. Just changing a spurious property retrieval in the typeclass removed an extra, pointless database query.

This commit is contained in:
Griatch 2012-09-18 01:03:35 +02:00
parent 160d4a2807
commit 0dae03156c
5 changed files with 57 additions and 38 deletions

View file

@ -632,16 +632,13 @@ class ObjectDB(TypedObject):
data (object): an optional data object that may or may not
be used by the protocol.
"""
# This is an important function that must always work.
# we use a different __getattribute__ to avoid recursive loops.
if object.__getattribute__(self, 'player'):
object.__getattribute__(self, 'player').msg(message, from_obj=from_obj, data=data)
if _GA(self, 'player'):
_GA(_GA(self, 'player'), "msg")(message, from_obj=from_obj, data=data)
def emit_to(self, message, from_obj=None, data=None):
"Deprecated. Alias for msg"
logger.log_depmsg("emit_to() is deprecated. Use msg() instead.")
self.msg(message, from_obj, data)
_GA(self, "msg")(message, from_obj, data)
def msg_contents(self, message, exclude=None, from_obj=None, data=None):
"""