diff --git a/evennia/commands/default/player.py b/evennia/commands/default/player.py index 4d03fb8138..296618334b 100644 --- a/evennia/commands/default/player.py +++ b/evennia/commands/default/player.py @@ -560,7 +560,7 @@ class CmdOption(COMMAND_DEFAULT_CLASS): "CLIENTNAME": utils.to_str, "ENCODING": validate_encoding, "MCCP": validate_bool, - "MUDPROMPT": validate_bool, + "NOGOAHEAD": validate_bool, "MXP": validate_bool, "NOCOLOR": validate_bool, "NOPKEEPALIVE": validate_bool, diff --git a/evennia/server/inputfuncs.py b/evennia/server/inputfuncs.py index 509d84be4d..c956db0870 100644 --- a/evennia/server/inputfuncs.py +++ b/evennia/server/inputfuncs.py @@ -194,7 +194,7 @@ def client_options(session, *args, **kwargs): "MCCP", "SCREENHEIGHT", "SCREENWIDTH", "INPUTDEBUG", "RAW", "NOCOLOR", - "MUDPROMPT")) + "NOGOAHEAD")) session.msg(client_options=options) return @@ -245,6 +245,8 @@ def client_options(session, *args, **kwargs): flags["NOCOLOR"] = validate_bool(value) elif key == "raw": flags["RAW"] = validate_bool(value) + elif key == "nogoahead": + flags["NOGOAHEAD"] = validate_bool(value) elif key in ('Char 1', 'Char.Skills 1', 'Char.Items 1', 'Room 1', 'IRE.Rift 1', 'IRE.Composer 1'): # ignore mudlet's default send (aimed at IRE games) diff --git a/evennia/server/portal/telnet.py b/evennia/server/portal/telnet.py index e9f43443df..d79a6da948 100644 --- a/evennia/server/portal/telnet.py +++ b/evennia/server/portal/telnet.py @@ -13,7 +13,7 @@ from twisted.conch.telnet import Telnet, StatefulTelnetProtocol from twisted.conch.telnet import IAC, NOP, LINEMODE, GA, WILL, WONT, ECHO, NULL from django.conf import settings from evennia.server.session import Session -from evennia.server.portal import ttype, mssp, telnet_oob, naws +from evennia.server.portal import ttype, mssp, telnet_oob, naws, suppress_ga from evennia.server.portal.mccp import Mccp, mccp_compress, MCCP from evennia.server.portal.mxp import Mxp, mxp_parse from evennia.utils import ansi @@ -47,9 +47,11 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session): client_address = client_address[0] if client_address else None # this number is counted down for every handshake that completes. # when it reaches 0 the portal/server syncs their data - self.handshakes = 7 # naws, ttype, mccp, mssp, msdp, gmcp, mxp + self.handshakes = 8 # suppress-go-ahead, naws, ttype, mccp, mssp, msdp, gmcp, mxp self.init_session(self.protocol_name, client_address, self.factory.sessionhandler) + # suppress go-ahead + self.sga = suppress_ga.SuppressGA(self) # negotiate client size self.naws = naws.Naws(self) # negotiate ttype (client info) @@ -128,7 +130,8 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session): option == ttype.TTYPE or option == naws.NAWS or option == MCCP or - option == mssp.MSSP) + option == mssp.MSSP or + option == suppress_ga.SUPPRESS_GA) def enableLocal(self, option): """ @@ -141,7 +144,9 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session): enable (bool): If this option should be enabled. """ - return option == MCCP or option == ECHO + return (option == MCCP or + option == ECHO or + option == suppress_ga.SUPPRESS_GA) def disableLocal(self, option): """ @@ -221,8 +226,8 @@ 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') - if self.protocol_flags.get("MUDPROMPT", False): - line = line + IAC + GA + if not self.protocol_flags.get("NOGOAHEAD", True): + line += IAC + GA return self.transport.write(mccp_compress(self, line)) # Session hooks