advanced_telopt | index /mud/nakedmud-mod/lib/pymodules/advanced_telopt.py |
advanced_telopt.py
Adds advanced TELOPT negotiations to the MUD, including support for:
* TELOPT_NAWS - Negotiate About Window Size
Determine the size of the client window in columns and rows.
* TELOPT_TTYPE - Terminal Type
Determine the connected client to estimate its capabilities.
* TELOPT_EOR - End-of-Record
Mark the end of text transmission from the server with IAC EOR to let a
client know the exact point. If enabled, this is automatically appended
to the end of the prompt.
* TELOPT_MSP - MUD Sound Protocol
Trigger the playback of sounds and music on the client. Only basic support
is included... negotiation and the triggering of hooks when it's enabled
or disabled. The rest of the implementation is up to the MUD creator, though
it consists merely of sending your own MSP commands to the client.
* TELOPT_MSDP - MUD Server Data Protocol
MSDP allows you to easilly send variables to the client.
* TELOPT_MXP - MUD eXtension Protocol
MXP is, for those who don't know, an application of HTML-like tags to the
MUD itself, allowing for richer interaction with the user. It is in no way
critical to playing and enjoying the game, but it is a nice touch.
Note that this implementation of MXP isn't complete, as it doesn't handle
asking the client which tags it supports. I'd recommend keeping yourself
limited to simple tags like <SEND> if you don't add <SUPPORTS> support.
For more information about MXP, visit http://www.zuggsoft.com/zmud/mxp.htm
* Window Title Text
Set a custom string to the window's title bar. This also works together
with TELOPT_TTYPE to avoid sending the code to clients that wouldn't
properly interpret it.
If the bell() function of a socket is called, the title will be flashed
with two prepended asterisks until the next command is recieved. This can
be used to notify a distracted player when the MUD needs their input.
* XTERM 256 and ANSI Colors
This file also handles color code parsing, taking that functionality away
from colour.py as to combine color formatting and MXP conversion into one
post-processing function. I haven't tested it, but I can only assume that
one less function call makes things easier on the server.
Modules | ||||||
|
Classes | ||||||||||||||||
|
Functions | ||
|
Data | ||
MSDP = 'E' MSDP_VAL = '\x02' MSDP_VAR = '\x01' MSP = 'Z' MXP = '[' client_do_eor = '\xff\xfd\x19' client_do_msdp = '\xff\xfdE' client_do_msp = '\xff\xfdZ' client_do_mxp = '\xff\xfd[' client_dont_eor = '\xff\xfe\x19' client_dont_msdp = '\xff\xfeE' client_dont_msp = '\xff\xfeZ' client_dont_mxp = '\xff\xfe[' client_naws = '\xff\xfa\x1f' client_ttype_is = '\xff\xfa\x18' client_will_naws = '\xff\xfb\x1f' client_will_ttype = '\xff\xfb\x18' clients = ['jmud', 'xterm', 'fmud', 'zmud', 'mushclient', 'tintin++', 'ansi', 'unknown'] clients256 = ['jmud', 'zmud', 'mushclient', 'tintin++', 'xterm'] coloreg = <_sre.SRE_Pattern object> colorletters = 'drgybpcwDRGYBPCW' colors = {'b': '34', 'c': '36', 'd': '30', 'g': '32', 'n': '0', 'p': '35', 'r': '31', 'w': '37', 'y': '33'} colorvalues = [0, 95, 135, 175, 215, 255] copyover_file = '../lib/misc/copyover' extcolors = ['0;30', '0;31', '0;32', '0;33', '0;34', '0;35', '0;36', '0;37', '1;30', '1;31', '1;32', '1;33', '1;34', '1;35', '1;36', '1;37', '0;30', '0;34', '0;34', '0;34', ...] htmlcolors = ['#000000', '#800000', '#008000', '#808000', '#000080', '#800080', '#008080', '#C0C0C0', '#808080', '#FF0000', '#00FF00', '#FFFF00', '#0000FF', '#FF00FF', '#00FFFF', '#FFFFFF', '#000000', '#00005f', '#000087', '#0000af', ...] linkreg = <_sre.SRE_Pattern object> msdp_end = '\xff\xf0' msdp_start = '\xff\xfaE' mxp_and = '\x04MXP\x03' mxp_escape = '\x1b[' mxp_lock_locked = '\x1b[7z' mxp_lock_open = '\x1b[5z' mxp_lock_secure = '\x1b[6z' mxp_locked_line = '\x1b[2z' mxp_open_line = '\x1b[0z' mxp_reset = '\x1b[3z' mxp_secure_line = '\x1b[1z' mxp_secure_tags = ['SEND', 'A', 'VAR', 'NOBR', 'P', 'BR', 'SBR', 'EXPIRE', 'VERSION', 'SUPPORT', 'GAUGE', 'STAT', 'SOUND', 'MUSIC', 'FRAME', 'DEST', 'RELOCATE', 'IMAGE', 'FILTER'] mxp_tag_end = '\x02MXP\x03' mxp_tag_start = '\x01MXP\x03' mxp_tags = [] mxp_temp_secure = '\x1b[4z' mxpreg = <_sre.SRE_Pattern object> no_title = ['fmud', 'zmud', 'mushclient', 'ansi', 'unknown'] server_do_naws = '\xff\xfd\x1f' server_do_ttype = '\xff\xfd\x18' server_eor_code = '\xff\xef' server_send_ttype = '\xff\xfa\x18\x01\xff\xf0' server_start_mxp = '\xff\xfa[\xff\xf0' server_will_eor = '\xff\xfb\x19' server_will_msdp = '\xff\xfbE' server_will_msp = '\xff\xfbZ' server_will_mxp = '\xff\xfb[' server_wont_eor = '\xff\xfc\x19' server_wont_msp = '\xff\xfcZ' server_wont_mxp = '\xff\xfc[' |