mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 12:07:17 +02:00
Resolved issue122. Also clarified the functional sequence for disconnecting a session cleanly (avoiding circular calls that might happen if disconnection happens manually or automatically due to server shutdown). Removed the specific stopping callback from the webclient and put it in the mai
n server process instead, so all protocols can get a message when server shuts down with Ctrl-C.
This commit is contained in:
parent
6ecbda03ea
commit
939307a5c1
6 changed files with 118 additions and 68 deletions
|
|
@ -97,13 +97,14 @@ class SessionHandler(object):
|
|||
else:
|
||||
return self.loggedin
|
||||
|
||||
def disconnect_all_sessions(self, reason=None):
|
||||
def disconnect_all_sessions(self, reason="You have been disconnected."):
|
||||
"""
|
||||
Cleanly disconnect all of the connected sessions.
|
||||
"""
|
||||
sessions = self.get_sessions(include_unloggedin=True)
|
||||
sessions = self.get_sessions(include_unloggedin=True)
|
||||
for session in sessions:
|
||||
session.session_disconnect(reason)
|
||||
session.at_data_out(reason)
|
||||
session.session_disconnect()
|
||||
self.session_count(0)
|
||||
|
||||
def disconnect_duplicate_sessions(self, session):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue