Fixed erroneous alias-assigments in tutorial_world that caused tracebacks. Resolves Issue 423.

This commit is contained in:
Griatch 2013-08-30 20:53:38 +02:00
parent 0a42b73824
commit 839a78ca8d
5 changed files with 12 additions and 32 deletions

View file

@ -559,7 +559,7 @@ class CrumblingWall(TutorialObject, Exit):
"called when the object is first created."
super(CrumblingWall, self).at_object_creation()
self.aliases = ["secret passage", "passage", "crack", "opening", "secret door"]
self.aliases.add(["secret passage", "passage", "crack", "opening", "secret door"])
# this is assigned first when pushing button, so assign this at creation time!
self.db.destination = 2

View file

@ -121,22 +121,6 @@ def field_pre_save(sender, instance=None, update_fields=None, raw=False, **kwarg
# # update cache
# _FIELD_CACHE[hid] = new_value
# access method
#
#def get_field_cache(obj, fieldname):
# "Called by _get wrapper"
# hid = hashid(obj, "-%s" % fieldname)
# return hid and _FIELD_CACHE.get(hid, None) or None
#
#def set_field_cache(obj, fieldname, value):
# hid = hashi(obj, "-%s" % fieldname)
# if hid:
# _FIELD_CACHE.set(hid, value)
#
#def flush_field_cache():
# "Clear the field cache"
# _FIELD_CACHE.clear()
def get_cache_sizes():
return (0, 0), (0, 0), (0, 0)
def get_field_cache(obj, name):

View file

@ -34,11 +34,12 @@ from src.server.oobhandler import OOBHANDLER
def track_desc(session, *args, **kwargs):
"Sets up a passive watch for the desc attribute on session object"
if session.player and session.player.character:
char = session.player.character
OOBHANDLER.track_passive(session, char, "desc", entity="db")
# to start off we return the value once
return char.db.desc
if session.player:
char = session.player.get_puppet(session.sessid)
if char:
OOBHANDLER.track_passive(session, char, "desc", entity="db")
# to start off we return the value once
return char.db.desc
"""
@ -49,7 +50,7 @@ from src.server import caches
from src.server.caches import hashid
from src.utils import logger, create
class _OOBTrackerScript(Script):
class _OOBTracker(Script):
"""
Active tracker script, handles subscriptions
"""
@ -126,7 +127,7 @@ class OOBhandler(object):
tracker - object who is tracking
tracked - object being tracked
entityname - field/property/attribute/ndb nam to watch
entityname - field/property/attribute/ndb name to watch
function - function object to call when entity update. When entitye <key>
is updated, this function will be called with called
with function(obj, entityname, new_value, *args, **kwargs)

View file

@ -96,11 +96,6 @@ AUTHENTICATION_BACKENDS = ('src.web.backends.CaseInsensitiveModelBackend',)
# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
LANGUAGE_CODE = 'en-us'
# Should the default MUX help files be imported? This might be
# interesting to developers for reference, but is frustrating to users
# since it creates a lot of help entries that has nothing to do
# with what is actually available in the game.
IMPORT_MUX_HELP = False
# How long time (in seconds) a user may idle before being logged
# out. This can be set as big as desired. A user may avoid being
# thrown off by sending the empty system command 'idle' to the server

View file

@ -371,7 +371,7 @@ class AttributeHandler(object):
attr_obj.value = value
def remove(self, key, raise_exception=True, category=None, accessing_obj=None, default_access=True):
def remove(self, key, raise_exception=False, category=None, accessing_obj=None, default_access=True):
"""Remove attribute or a list of attributes from object.
If accessing_obj is given, will check against the 'attredit' lock. If not given, this check is skipped.
@ -514,8 +514,8 @@ class TagHandler(object):
# this will only create tag if no matches existed beforehand (it will overload
# data on an existing tag since that is not considered part of making the tag unique)
tagobj = Tag.objects.create_tag(key=tagstr, category=category, data=data)
print tagstr
print tagobj
#print tagstr
#print tagobj
_GA(self.obj, self._m2m_fieldname).add(tagobj)
def get(self, key, category="", return_obj=False):