Ran black
This commit is contained in:
parent
67967b8aeb
commit
a8d569979d
4 changed files with 13 additions and 7 deletions
|
|
@ -606,6 +606,7 @@ def msdp_send(session, *args, **kwargs):
|
||||||
out[varname] = _monitorable[varname.lower()]
|
out[varname] = _monitorable[varname.lower()]
|
||||||
session.msg(send=((), out))
|
session.msg(send=((), out))
|
||||||
|
|
||||||
|
|
||||||
# client specific
|
# client specific
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ class Mssp(object):
|
||||||
"NAME": settings.SERVERNAME,
|
"NAME": settings.SERVERNAME,
|
||||||
"PLAYERS": self.get_player_count,
|
"PLAYERS": self.get_player_count,
|
||||||
"UPTIME": self.get_uptime,
|
"UPTIME": self.get_uptime,
|
||||||
"PORT": list(str(port) for port in
|
"PORT": list(
|
||||||
reversed(settings.TELNET_PORTS)
|
str(port) for port in reversed(settings.TELNET_PORTS)
|
||||||
), # most important port should be last in list
|
), # most important port should be last in list
|
||||||
# Evennia auto-filled
|
# Evennia auto-filled
|
||||||
"CRAWL DELAY": "-1",
|
"CRAWL DELAY": "-1",
|
||||||
|
|
@ -120,10 +120,15 @@ class Mssp(object):
|
||||||
if utils.is_iter(value):
|
if utils.is_iter(value):
|
||||||
for partval in value:
|
for partval in value:
|
||||||
varlist += (
|
varlist += (
|
||||||
MSSP_VAR + bytes(str(variable), "utf-8") + MSSP_VAL + bytes(str(partval), "utf-8")
|
MSSP_VAR
|
||||||
|
+ bytes(str(variable), "utf-8")
|
||||||
|
+ MSSP_VAL
|
||||||
|
+ bytes(str(partval), "utf-8")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
varlist += MSSP_VAR + bytes(str(variable), "utf-8") + MSSP_VAL + bytes(str(value), "utf-8")
|
varlist += (
|
||||||
|
MSSP_VAR + bytes(str(variable), "utf-8") + MSSP_VAL + bytes(str(value), "utf-8")
|
||||||
|
)
|
||||||
|
|
||||||
# send to crawler by subnegotiation
|
# send to crawler by subnegotiation
|
||||||
self.protocol.requestNegotiation(MSSP, varlist)
|
self.protocol.requestNegotiation(MSSP, varlist)
|
||||||
|
|
|
||||||
|
|
@ -197,8 +197,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
if option == LINEMODE:
|
if option == LINEMODE:
|
||||||
# make sure to activate line mode with local editing for all clients
|
# make sure to activate line mode with local editing for all clients
|
||||||
self.requestNegotiation(
|
self.requestNegotiation(
|
||||||
LINEMODE, MODE + bytes(chr(ord(LINEMODE_EDIT) +
|
LINEMODE, MODE + bytes(chr(ord(LINEMODE_EDIT) + ord(LINEMODE_TRAPSIG)), "ascii")
|
||||||
ord(LINEMODE_TRAPSIG)), "ascii")
|
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
@ -258,6 +257,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
return super().disableLocal(option)
|
return super().disableLocal(option)
|
||||||
except Exception:
|
except Exception:
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
|
|
||||||
logger.log_trace()
|
logger.log_trace()
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import re
|
||||||
import json
|
import json
|
||||||
from evennia.utils.utils import is_iter
|
from evennia.utils.utils import is_iter
|
||||||
from twisted.python.compat import _bytesChr as bchr
|
from twisted.python.compat import _bytesChr as bchr
|
||||||
|
|
||||||
# General Telnet
|
# General Telnet
|
||||||
from twisted.conch.telnet import IAC, SB, SE
|
from twisted.conch.telnet import IAC, SB, SE
|
||||||
|
|
||||||
|
|
@ -46,7 +47,6 @@ MSDP_ARRAY_CLOSE = bchr(6)
|
||||||
GMCP = bchr(201)
|
GMCP = bchr(201)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# pre-compiled regexes
|
# pre-compiled regexes
|
||||||
# returns 2-tuple
|
# returns 2-tuple
|
||||||
msdp_regex_table = re.compile(
|
msdp_regex_table = re.compile(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue