Implemented xterm256 colours. If not supported by client, converts to normal ANSI, as per kaViir's snippet. Integrates into Evennia's normal ansi parser and collaborates with TTYPE protocol to determine if the client supports it.

This commit is contained in:
Griatch 2011-11-20 14:56:07 +01:00
parent fb78758356
commit 4cd80284c9
6 changed files with 194 additions and 146 deletions

View file

@ -47,7 +47,7 @@ class Ttype(object):
self.protocol.negotiationMap[TTYPE] = self.do_ttype
# ask if client will ttype, connect callback if it does.
self.protocol.will(TTYPE).addCallbacks(self.do_ttype, self.no_ttype)
def no_ttype(self, option):
"""
Callback if ttype is not supported by client.
@ -79,7 +79,7 @@ class Ttype(object):
elif self.ttype_step == 3:
self.protocol.protocol_flags['TTYPE']['TERM'] = option
self.protocol.requestNegotiation(TTYPE, SEND)
elif self.ttype_step == 4 and option.startswith('MTTS'):
elif self.ttype_step == 4:
option = int(option.strip('MTTS '))
self.protocol.protocol_flags['TTYPE']['MTTS'] = option
for codenum, standard in MTTS: