Fixed some issues with @dest'ing player objects that don't have a matching account (should never really happen but just in case.)
This commit is contained in:
parent
cf0fa701ef
commit
95e645246e
4 changed files with 18 additions and 6 deletions
|
|
@ -270,7 +270,7 @@ class Object(models.Model):
|
||||||
"""
|
"""
|
||||||
Clears all of an object's attributes.
|
Clears all of an object's attributes.
|
||||||
"""
|
"""
|
||||||
self.get_all_attributes()
|
attribs = self.get_all_attributes()
|
||||||
for attrib in attribs:
|
for attrib in attribs:
|
||||||
self.delete()
|
self.delete()
|
||||||
|
|
||||||
|
|
@ -289,9 +289,12 @@ class Object(models.Model):
|
||||||
# If the object is a player, set the player account object to inactive.
|
# If the object is a player, set the player account object to inactive.
|
||||||
# It can still be recovered at this point.
|
# It can still be recovered at this point.
|
||||||
if self.is_player():
|
if self.is_player():
|
||||||
|
try:
|
||||||
uobj = User.objects.get(id=self.id)
|
uobj = User.objects.get(id=self.id)
|
||||||
uobj.is_active = False
|
uobj.is_active = False
|
||||||
uobj.save()
|
uobj.save()
|
||||||
|
except:
|
||||||
|
functions_general.print_errmsg('Destroying object %s but no matching player.' % (self,))
|
||||||
|
|
||||||
# Set the object type to GOING
|
# Set the object type to GOING
|
||||||
self.type = 5
|
self.type = 5
|
||||||
|
|
@ -600,4 +603,5 @@ class Object(models.Model):
|
||||||
return global_defines.OBJECT_TYPES[otype][1][0]
|
return global_defines.OBJECT_TYPES[otype][1][0]
|
||||||
|
|
||||||
import functions_db
|
import functions_db
|
||||||
|
import functions_general
|
||||||
import session_mgr
|
import session_mgr
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -5,6 +5,13 @@ import commands_unloggedin
|
||||||
"""
|
"""
|
||||||
General commonly used functions.
|
General commonly used functions.
|
||||||
"""
|
"""
|
||||||
|
def print_errmsg(errormsg):
|
||||||
|
"""
|
||||||
|
Prints/logs an error message. Pipe any errors to be logged through here.
|
||||||
|
For now we're just printing to standard out.
|
||||||
|
"""
|
||||||
|
print 'ERROR: %s' % (errormsg,)
|
||||||
|
|
||||||
def command_list():
|
def command_list():
|
||||||
"""
|
"""
|
||||||
Return a list of all commands.
|
Return a list of all commands.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export DJANGO_SETTINGS_MODULE="settings"
|
export DJANGO_SETTINGS_MODULE="settings"
|
||||||
python2.5 -m cProfile -o profiler.log -s time server.py
|
#python2.5 -m cProfile -o profiler.log -s time server.py
|
||||||
|
python2.5 server.py
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue