Don't send delayed CMD_LOGINSTART if session already logged in (to handle autologins)

This commit is contained in:
Griatch 2018-01-03 22:37:52 +01:00
parent 74e8c74f80
commit 82e12f15ff

View file

@ -274,6 +274,16 @@ class ServerSessionHandler(SessionHandler):
self.server = None
self.server_data = {"servername": _SERVERNAME}
def _run_cmd_login(self, session):
"""
Launch the CMD_LOGINSTART command. This is wrapped
for delays.
"""
if not session.logged_in:
self.data_in(session, text=[[CMD_LOGINSTART], {}])
def portal_connect(self, portalsessiondata):
"""
Called by Portal when a new session has connected.
@ -314,8 +324,7 @@ class ServerSessionHandler(SessionHandler):
# this delay is necessary notably for Mudlet, which will fail on the connection screen
# unless the MXP protocol has been negotiated. Unfortunately this may be too short for some
# networks, the symptom is that < and > are not parsed by mudlet on first connection.
delay(0.3, self.data_in, sess, text=[[CMD_LOGINSTART], {}])
# self.data_in(sess, text=[[CMD_LOGINSTART], {}])
delay(0.3, self._run_cmd_login, sess)
def portal_session_sync(self, portalsessiondata):
"""