Cleaning up the duplicate session disconnector.

This commit is contained in:
Greg Taylor 2009-01-22 00:17:43 +00:00
parent 1045d0fabf
commit 8909b9d2c0

View file

@ -38,16 +38,16 @@ def disconnect_duplicate_session(session):
Disconnects any existing session under the same object. This is used in
connection recovery to help with record-keeping.
"""
sess_list = get_session_list()
new_pobj = session.get_pobject()
for sess in sess_list:
if new_pobj == sess.get_pobject() and sess != session:
sess.msg("Your account has been logged in from elsewhere, disconnecting.")
sess.disconnectClient()
session_list = get_session_list()
session_pobj = session.get_pobject()
for other_session in session_list:
other_pobject = other_session.get_pobject()
if session_pobj == other_pobject and other_session != session:
other_session.msg("Your account has been logged in from elsewhere, disconnecting.")
other_session.disconnectClient()
return True
return False
def check_all_sessions():
"""
Check all currently connected sessions and see if any are dead.