Add safety-measure to ensure clients disconnect at server stop

This commit is contained in:
Thor77 2016-11-06 19:23:00 +01:00
parent c8955bee5e
commit 03c0941962
1 changed files with 7 additions and 0 deletions

View File

@ -159,6 +159,13 @@ def _parse_details(log_path, ident_map=None, clients=None, online_dc=True):
invoker.ban(client) invoker.ban(client)
else: else:
invoker.kick(client) invoker.kick(client)
elif message == 'stopped':
# make sure all clients are disconnected at server stop
[
client.disconnect(logdatetime)
for client in clients
if client.connected
]
if online_dc: if online_dc:
def _reconnect(client): def _reconnect(client):
client.disconnect(datetime.utcnow()) client.disconnect(datetime.utcnow())