Lots of cleanup and bug fixes. Still some issues with reconnecting to the right location in multisession_mode 0.

This commit is contained in:
Griatch 2013-04-03 18:31:53 +02:00
parent e86c127903
commit 9eb1903f02
8 changed files with 73 additions and 83 deletions

View file

@ -61,6 +61,7 @@ def create_objects():
god_character.save()
god_character.set_attribute("_superuser_character", True)
gor_character.set_attribute("_first_login", True)
# Limbo is the default "nowhere" starting room

View file

@ -143,7 +143,7 @@ class ServerSession(Session):
return
if self.logged_in:
# the inmsg handler will relay to the right place
self.player.inmsg(command_string, self.sessid)
self.player.inmsg(command_string, sessid=self.sessid)
else:
# we are not logged in. Use the session directly
# (it uses the settings.UNLOGGEDIN cmdset)

View file

@ -233,7 +233,7 @@ class ServerSessionHandler(SessionHandler):
player.at_pre_login()
session.log(_('Logged in: %(self)s') % {'self': self})
session.log(_('Logged in: %(self)s') % {'self': player})
# start (persistent) scripts on this object
#ScriptDB.objects.validate(obj=self.player.character)
@ -275,12 +275,12 @@ class ServerSessionHandler(SessionHandler):
def disconnect_duplicate_sessions(self, curr_session, reason = _("Logged in from elsewhere. Disconnecting.") ):
"""
Disconnects any existing sessions with the same game object.
Disconnects any existing sessions with the same user.
"""
curr_char = curr_session.get_character()
uid = curr_session.uid
doublet_sessions = [sess for sess in self.sessions.values()
if sess.logged_in
and sess.get_character() == curr_char
and sess.uid == uid
and sess != curr_session]
for session in doublet_sessions:
self.disconnect(session, reason)