diff --git a/game/gamesrc/objects/baseobjects.py b/game/gamesrc/objects/baseobjects.py index f1c079ba70..aa13e72bb4 100644 --- a/game/gamesrc/objects/baseobjects.py +++ b/game/gamesrc/objects/baseobjects.py @@ -113,9 +113,10 @@ class Character(BaseCharacter): We stove away the character when logging off, otherwise they will remain where they are, 'headless', so to say. """ - self.location.msg_contents("%s has left the game." % self.name) - self.db.prelogout_location = self.location - self.location = None + if self.location: # have to check, in case of multiple connections + self.location.msg_contents("%s has left the game." % self.name) + self.db.prelogout_location = self.location + self.location = None def at_post_login(self): """ diff --git a/src/commands/default/general.py b/src/commands/default/general.py index 3308840ed3..9d1b660cb8 100644 --- a/src/commands/default/general.py +++ b/src/commands/default/general.py @@ -330,8 +330,7 @@ class CmdQuit(MuxCommand): def func(self): "hook function" - sessions = self.caller.sessions - for session in sessions: + for session in self.caller.sessions: session.msg("Quitting. Hope to see you soon again.") session.session_disconnect() diff --git a/src/objects/objects.py b/src/objects/objects.py index b0f550d592..075fbd3960 100644 --- a/src/objects/objects.py +++ b/src/objects/objects.py @@ -55,7 +55,7 @@ class Object(TypeClass): if create_cmdset: dbobj.cmdset = CmdSetHandler(dbobj) - if utils.inherits_from(self, settings.BASE_CHARACTER_TYPECLASS): + if utils.inherits_from(self, settings.BASE_CHARACTER_TYPECLASS) or utils.inherits_from(self, Character): dbobj.cmdset.outside_access = False if create_scripts: dbobj.scripts = ScriptHandler(dbobj) diff --git a/src/typeclasses/typeclass.py b/src/typeclasses/typeclass.py index d27027631b..ef98d8fb50 100644 --- a/src/typeclasses/typeclass.py +++ b/src/typeclasses/typeclass.py @@ -15,9 +15,13 @@ from django.conf import settings # To ensure the sanity of the model, there are a # few property names we won't allow the admin to -# set just like that. +# set just like that. Note that these are *not* related +# to *in-game* safety (if you can edit typeclasses you have +# full access anyway), so no protection against changing +# e.g. 'locks' or 'permissions' should go here. PROTECTED = ['id', 'dbobj', 'db', 'objects', 'typeclass', 'attr', 'save', 'delete'] + # If this is true, all non-protected property assignments # are directly stored to a database attribute try: diff --git a/src/utils/logger.py b/src/utils/logger.py index 929e752c74..a037c56c9c 100644 --- a/src/utils/logger.py +++ b/src/utils/logger.py @@ -16,17 +16,20 @@ def log_trace(errmsg=None): adds an extra line with added info. """ tracestring = format_exc() - if tracestring: - for line in tracestring.splitlines(): - log.msg('[::] %s' % line) - if errmsg: - try: - errmsg = utils.to_str(errmsg) - except Exception, e: - errmsg = str(e) - for line in errmsg.splitlines(): - log.msg('[EE] %s' % line) - + try: + if tracestring: + for line in tracestring.splitlines(): + log.msg('[::] %s' % line) + if errmsg: + try: + errmsg = utils.to_str(errmsg) + except Exception, e: + errmsg = str(e) + for line in errmsg.splitlines(): + log.msg('[EE] %s' % line) + except Exception: + log.msg('[EE] %s' % errmsg ) + def log_errmsg(errmsg): """ Prints/logs an error message to the server log. diff --git a/src/web/media/javascript/evennia_webclient.js b/src/web/media/javascript/evennia_webclient.js index 184664618b..ef8bb0998d 100644 --- a/src/web/media/javascript/evennia_webclient.js +++ b/src/web/media/javascript/evennia_webclient.js @@ -204,7 +204,7 @@ $(document).keypress( function(event) { } else { if (wresult == 38 || wresult == 40) { - // this fixes a bug in firefox, those are on ASCII format + // this fixes a bug in firefox, those are on ASCII format return false; }