This commit is contained in:
Griatch 2011-11-05 23:09:59 +01:00
commit c297e01fc3
7 changed files with 914 additions and 26 deletions

View file

@ -310,8 +310,7 @@ class ObjectDB(TypedObject):
hom = home.dbobj
else:
hom = home.dbobj
if home:
self.db_home = hom
self.db_home = hom
except Exception:
string = "Cannot set home: "
string += "%s is not a valid home."
@ -746,6 +745,9 @@ class ObjectDB(TypedObject):
default_home_id = int(settings.CHARACTER_DEFAULT_HOME)
try:
default_home = ObjectDB.objects.get(id=default_home_id)
if default_home.id == self.id:
# we are deleting default home!
default_home = None
except Exception:
string = "Could not find default home '(#%d)'."
logger.log_errmsg(string % default_home_id)
@ -754,17 +756,19 @@ class ObjectDB(TypedObject):
for obj in objs:
home = obj.home
# Obviously, we can't send it back to here.
if home and home.id == self.id:
home = default_home
if not home or (home and home.id == self.id):
obj.home = default_home
# If for some reason it's still None...
if not home:
if not obj.home:
string = "Missing default home, '%s(#%d)' "
string += "now has a null location."
obj.location = None
obj.msg("Something went wrong! You are dumped into nowhere. Contact an admin.")
logger.log_errmsg(string % (obj.name, obj.id))
return
if self.has_player:
if obj.has_player:
if home:
string = "Your current location has ceased to exist,"
string += " moving you to %s(#%d)."
@ -812,8 +816,7 @@ class ObjectDB(TypedObject):
for session in self.sessions:
session.msg("Your character %s has been destroyed." % self.name)
#session.session_disconnect()
# no need to disconnect, Player just jumps to OOC mode.
# sever the connection (important!)
if object.__getattribute__(self, 'player') and self.player:
self.player.character = None
@ -824,7 +827,7 @@ class ObjectDB(TypedObject):
# if self.player:
# self.player.user.is_active = False
# self.player.user.save()
# self.player.user.save(
# Destroy any exits to and from this room, if any
self.clear_exits()

View file

@ -141,8 +141,6 @@ DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = ''
DATABASE_NONBLOCKING_SAVE = True
###################################################
# Evennia in-game parsers
###################################################
@ -344,7 +342,9 @@ SESSION_COOKIE_NAME = 'sessionid'
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
USE_I18N = False
# Where to find locales (no need to change this, most likely)
LOCALE_PATHS = ["../locale/"]
# This should be turned off unless you want to do tests with Django's
# development webserver (normally Evennia runs its own server)
SERVE_MEDIA = False