Command revamp broke the create command in a funky way. Fixed.

This commit is contained in:
Greg Taylor 2009-02-04 18:14:25 +00:00
parent ef371aaee2
commit 51edc17d59
2 changed files with 10 additions and 11 deletions

View file

@ -290,7 +290,7 @@ class ObjectManager(models.Manager):
# Rooms have a NULL location. # Rooms have a NULL location.
if not new_object.is_room(): if not new_object.is_room():
new_object.move_to(odat['location']) new_object.move_to(odat['location'], force_look=False)
return new_object return new_object
@ -298,8 +298,6 @@ class ObjectManager(models.Manager):
""" """
Handles the creation of new users. Handles the creation of new users.
""" """
session = command.session
server = command.server
start_room = int(ConfigValue.objects.get_configvalue('player_dbnum_start')) start_room = int(ConfigValue.objects.get_configvalue('player_dbnum_start'))
start_room_obj = self.get_object_from_dbref(start_room) start_room_obj = self.get_object_from_dbref(start_room)
@ -318,7 +316,7 @@ class ObjectManager(models.Manager):
# It stinks to have to do this but it's the only trivial way now. # It stinks to have to do this but it's the only trivial way now.
user.save() user.save()
# Update the session to use the newly created User object's ID. # Update the session to use the newly created User object's ID.
session.uid = user.id command.session.uid = user.id
# We can't use the user model to change the id because of the way keys # We can't use the user model to change the id because of the way keys
# are handled, so we actually need to fall back to raw SQL. Boo hiss. # are handled, so we actually need to fall back to raw SQL. Boo hiss.
@ -338,9 +336,9 @@ class ObjectManager(models.Manager):
user_object = self.create_object(odat) user_object = self.create_object(odat)
# Activate the player's session and set them loose. # Activate the player's session and set them loose.
session.login(user) command.session.login(user)
print 'Registration: %s' % (session,) print 'Registration: %s' % (command.session, user_object.get_name())
session.msg("Welcome to %s, %s.\n\r" % ( user_object.emit_to("Welcome to %s, %s.\n\r" % (
ConfigValue.objects.get_configvalue('site_name'), ConfigValue.objects.get_configvalue('site_name'),
session.get_pobject().get_name(show_dbref=False))) user_object.get_name(show_dbref=False)))
session.add_default_channels() command.session.add_default_channels()

View file

@ -861,8 +861,9 @@ class Object(models.Model):
self.get_location().emit_to_contents(arrival_message, exclude=self) self.get_location().emit_to_contents(arrival_message, exclude=self)
if self.location.is_player(): if self.location.is_player():
self.location.emit_to("%s is now in your inventory." % (self.get_name())) self.location.emit_to("%s is now in your inventory." % (self.get_name()))
self.execute_cmd('look') if force_look:
self.execute_cmd('look')
def dbref_match(self, oname): def dbref_match(self, oname):
""" """