Possible fix to bad disconnection issue.
This commit is contained in:
parent
e79f68bbe1
commit
1a26552600
1 changed files with 10 additions and 4 deletions
|
|
@ -146,10 +146,16 @@ class ServerSessionHandler(SessionHandler):
|
||||||
from the portal side.
|
from the portal side.
|
||||||
"""
|
"""
|
||||||
session = self.sessions.get(sessid, None)
|
session = self.sessions.get(sessid, None)
|
||||||
if session:
|
if not session:
|
||||||
session.disconnect()
|
return
|
||||||
del self.sessions[session.sessid]
|
player = session.player
|
||||||
self.session_count(-1)
|
if player:
|
||||||
|
nsess = len(self.sessions_from_player(player))
|
||||||
|
remaintext = nsess and "%i session%s remaining" % (nsess, nsess > 1 and "s" or "") or "no more sessions"
|
||||||
|
session.log(_('Connection dropped: %s %s (%s)' % (session.player, session.address, remaintext)))
|
||||||
|
session.at_disconnect()
|
||||||
|
session.disconnect()
|
||||||
|
del self.sessions[session.sessid]
|
||||||
|
|
||||||
def portal_session_sync(self, portalsessions):
|
def portal_session_sync(self, portalsessions):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue