Added a @reload command to reload most of the modules. This currently only seems to work for the stuff outside of the apps directory, and doesn't include the server, session_mgr, or events modules, as they have variables in them that we can't have reset. So basically, changes to the functions_ and commands_ modules can be applied with @reload, but little else. Hopefully this will improve with time. Also fixed a bug with @name'ing players but not updating their account's username to reflect it.

This commit is contained in:
Greg Taylor 2007-04-30 17:51:55 +00:00
parent 81b1797144
commit 4fd5a20e2c
6 changed files with 50 additions and 11 deletions

View file

@ -176,8 +176,8 @@ class Object(models.Model):
# If it's a player, we need to update their user object as well.
if self.is_player():
pobject = User.objects.get(id=self.id)
pobject.name = new_name
pobject = self.get_user_account()
pobject.username = new_name
pobject.save()
def get_user_account(self):
@ -292,7 +292,7 @@ class Object(models.Model):
uobj.is_active = False
uobj.save()
except:
functions_general.print_errmsg('Destroying object %s but no matching player.' % (self,))
functions_general.log_errmsg('Destroying object %s but no matching player.' % (self,))
# Set the object type to GOING
self.type = 5
@ -439,7 +439,7 @@ class Object(models.Model):
try:
return self.location
except:
functions_general.print_errmsg("Object '%s(#%d)' has invalid location: #%s" % (self.name,self.id,self.location_id))
functions_general.log_errmsg("Object '%s(#%d)' has invalid location: #%s" % (self.name,self.id,self.location_id))
return False
def get_attribute_value(self, attrib, default=False):