Change IAC + GA to key off of MUDPROMPT @option

Several clients interpret IAC + GA as a linefeed, in order
to support MUDs that always end a line with them.  This causes
Evennia to spew empty lines everywhere if IAC + GA is always on.
This commit is contained in:
Rachel Blackman 2017-06-04 18:46:31 -07:00
parent 90bd1a77dd
commit 5808377085
2 changed files with 5 additions and 2 deletions

View file

@ -193,7 +193,8 @@ def client_options(session, *args, **kwargs):
"UTF-8", "SCREENREADER", "ENCODING",
"MCCP", "SCREENHEIGHT",
"SCREENWIDTH", "INPUTDEBUG",
"RAW", "NOCOLOR"))
"RAW", "NOCOLOR",
"MUDPROMPT"))
session.msg(client_options=options)
return

View file

@ -221,7 +221,9 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
# escape IAC in line mode, and correctly add \r\n
line += self.delimiter
line = line.replace(IAC, IAC + IAC).replace('\n', '\r\n')
return self.transport.write(mccp_compress(self, line + IAC + GA))
if self.protocol_flags.get("MUDPROMPT", False):
line = line + IAC + GA
return self.transport.write(mccp_compress(self, line))
# Session hooks