Minor refactoring and stabilizing
This commit is contained in:
parent
ff7fae3c07
commit
42f74dc553
1 changed files with 6 additions and 6 deletions
|
|
@ -50,6 +50,9 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
# when it reaches 0 the portal/server syncs their data
|
# when it reaches 0 the portal/server syncs their data
|
||||||
self.handshakes = 8 # suppress-go-ahead, 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)
|
self.init_session(self.protocol_name, client_address, self.factory.sessionhandler)
|
||||||
|
# add this new connection to sessionhandler so
|
||||||
|
# the Server becomes aware of it.
|
||||||
|
self.sessionhandler.connect(self)
|
||||||
|
|
||||||
# suppress go-ahead
|
# suppress go-ahead
|
||||||
self.sga = suppress_ga.SuppressGA(self)
|
self.sga = suppress_ga.SuppressGA(self)
|
||||||
|
|
@ -66,12 +69,9 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
self.oob = telnet_oob.TelnetOOB(self)
|
self.oob = telnet_oob.TelnetOOB(self)
|
||||||
# mxp support
|
# mxp support
|
||||||
self.mxp = Mxp(self)
|
self.mxp = Mxp(self)
|
||||||
# add this new connection to sessionhandler so
|
|
||||||
# the Server becomes aware of it.
|
|
||||||
self.sessionhandler.connect(self)
|
|
||||||
|
|
||||||
# timeout the handshakes in case the client doesn't reply at all
|
|
||||||
from evennia.utils.utils import delay
|
from evennia.utils.utils import delay
|
||||||
|
# timeout the handshakes in case the client doesn't reply at all
|
||||||
delay(2, callback=self.handshake_done, timeout=True)
|
delay(2, callback=self.handshake_done, timeout=True)
|
||||||
|
|
||||||
# TCP/IP keepalive watches for dead links
|
# TCP/IP keepalive watches for dead links
|
||||||
|
|
@ -306,8 +306,8 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
# handle arguments
|
# handle arguments
|
||||||
options = kwargs.get("options", {})
|
options = kwargs.get("options", {})
|
||||||
flags = self.protocol_flags
|
flags = self.protocol_flags
|
||||||
xterm256 = options.get("xterm256", flags.get('XTERM256', False) if flags["TTYPE"] else True)
|
xterm256 = options.get("xterm256", flags.get('XTERM256', False) if flags.get("TTYPE", False) else True)
|
||||||
useansi = options.get("ansi", flags.get('ANSI', False) if flags["TTYPE"] else True)
|
useansi = options.get("ansi", flags.get('ANSI', False) if flags.get("TTYPE", False) else True)
|
||||||
raw = options.get("raw", flags.get("RAW", False))
|
raw = options.get("raw", flags.get("RAW", False))
|
||||||
nocolor = options.get("nocolor", flags.get("NOCOLOR") or not (xterm256 or useansi))
|
nocolor = options.get("nocolor", flags.get("NOCOLOR") or not (xterm256 or useansi))
|
||||||
echo = options.get("echo", None)
|
echo = options.get("echo", None)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue