mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 03:57:17 +02:00
Further refactor when an extra endline is added with the FORCEDENDLINE option
This commit is contained in:
parent
9d34cd9956
commit
3a3f2bfe9e
2 changed files with 4 additions and 5 deletions
|
|
@ -234,12 +234,10 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
# escape IAC in line mode, and correctly add \r\n (the TELNET end-of-line)
|
||||
line = line.replace(IAC, IAC + IAC)
|
||||
line = line.replace('\n', '\r\n')
|
||||
if not self.protocol_flags.get("NOGOAHEAD", True):
|
||||
if self.protocol_flags.get("FORCEDENDLINE", False):
|
||||
line += "\r\n"
|
||||
line += IAC + GA
|
||||
elif not line.endswith("\r\n"):
|
||||
if not line.endswith("\r\n") and self.protocol_flags.get("FORCEDENDLINE", True):
|
||||
line += "\r\n"
|
||||
if not self.protocol_flags.get("NOGOAHEAD", True):
|
||||
line += IAC + GA
|
||||
return self.transport.write(mccp_compress(self, line))
|
||||
|
||||
# Session hooks
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ class Ttype(object):
|
|||
# only support after a certain version, but all support
|
||||
# it since at least 4 years. We assume recent client here for now.
|
||||
cupper = clientname.upper()
|
||||
xterm256 = False
|
||||
if cupper.startswith("MUDLET"):
|
||||
# supports xterm256 stably since 1.1 (2010?)
|
||||
xterm256 = cupper.split("MUDLET", 1)[1].strip() >= "1.1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue