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

@ -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)