Add a slight delay to telnet handshake to give mudlet a chance to catch up

This commit is contained in:
Griatch 2018-01-01 20:58:48 +01:00
parent 42f74dc553
commit a342353fd6
2 changed files with 12 additions and 4 deletions

View file

@ -16,7 +16,7 @@ import re
import types import types
from django.conf import settings from django.conf import settings
from mock import Mock from mock import Mock, mock
from evennia.commands.default.cmdset_character import CharacterCmdSet from evennia.commands.default.cmdset_character import CharacterCmdSet
from evennia.utils.test_resources import EvenniaTest from evennia.utils.test_resources import EvenniaTest
@ -37,12 +37,14 @@ _RE = re.compile(r"^\+|-+\+|\+-+|--*|\|(?:\s|$)", re.MULTILINE)
# Command testing # Command testing
# ------------------------------------------------------------ # ------------------------------------------------------------
@mock.patch("evennia.utils.utils.delay")
class CommandTest(EvenniaTest): class CommandTest(EvenniaTest):
""" """
Tests a command Tests a command
""" """
def call(self, cmdobj, args, msg=None, cmdset=None, noansi=True, caller=None,
def call(self, cmdobj, args, msg=None, cmdset=None, noansi=True, caller=None, receiver=None, cmdstring=None, obj=None): receiver=None, cmdstring=None, obj=None):
""" """
Test a command by assigning all the needed Test a command by assigning all the needed
properties to cmdobj and running properties to cmdobj and running

View file

@ -310,7 +310,13 @@ class ServerSessionHandler(SessionHandler):
sess.uid = None sess.uid = None
# show the first login command # show the first login command
self.data_in(sess, text=[[CMD_LOGINSTART], {}])
# 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.
from evennia.utils.utils import delay
delay(0.3, self.data_in, sess, text=[[CMD_LOGINSTART], {}])
# self.data_in(sess, text=[[CMD_LOGINSTART], {}])
def portal_session_sync(self, portalsessiondata): def portal_session_sync(self, portalsessiondata):
""" """