mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 21:17:17 +02:00
Cleaning up the duplicate session disconnector.
This commit is contained in:
parent
1045d0fabf
commit
8909b9d2c0
1 changed files with 7 additions and 7 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue