@@ -25,6 +25,7 @@ extern CString strKeypadNames [eKeypad_Max_Items];
25
25
extern tInfoTypeMapping InfoTypes [];
26
26
27
27
#define SHOW_TRUE (x ) ((x) ? " yes" : " NO" )
28
+ #define SHOW_TRUE_LC (x ) ((x) ? " yes" : " no" )
28
29
29
30
static char * sColourNames [8 ] =
30
31
{
@@ -38,6 +39,15 @@ static char * sColourNames [8] =
38
39
" White"
39
40
};
40
41
42
+ static char * sMxpModes [] =
43
+ {
44
+ " On command" ,
45
+ " On query" ,
46
+ " Yes - always" ,
47
+ " No - never"
48
+ };
49
+
50
+
41
51
// compare-less for colours
42
52
struct colour_less : binary_function<COLORREF, COLORREF, bool >
43
53
{
@@ -1371,20 +1381,30 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
1371
1381
1372
1382
// telnet negotiation
1373
1383
1374
- Note (TFormat (" Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld" ,
1384
+ Tell (TFormat (" Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld [ " ,
1375
1385
m_nCount_IAC_DO,
1376
1386
m_nCount_IAC_DONT,
1377
1387
m_nCount_IAC_WILL,
1378
1388
m_nCount_IAC_WONT,
1379
1389
m_nCount_IAC_SB));
1380
1390
1391
+ Hyperlink (" !!" DEBUG_PLUGIN_ID " :telnetlist()" ,
1392
+ " List" , " Click to list IAC items" , " cyan" , " " , 0 );
1393
+ Note (" ]" );
1394
+
1381
1395
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, " " , " -- MXP --" );
1382
1396
1383
1397
// MXP
1384
1398
1385
- Note (TFormat (" MXP active: %s, Pueblo mode: %s" ,
1399
+ const char * sMode = " Unknown" ;
1400
+
1401
+ if (m_iUseMXP >= eOnCommandMXP && eOnCommandMXP <= eNoMXP)
1402
+ sMode = sMxpModes [m_iUseMXP];
1403
+
1404
+ Note (TFormat (" MXP active: %s, Pueblo mode: %s, Activated: %s" ,
1386
1405
SHOW_TRUE (m_bMXP ),
1387
- SHOW_TRUE (m_bPuebloActive) ));
1406
+ SHOW_TRUE (m_bPuebloActive),
1407
+ sMode ));
1388
1408
1389
1409
Note (TFormat (" MXP tags received: %I64d" , m_iMXPtags));
1390
1410
Note (TFormat (" MXP entities received: %I64d" , m_iMXPentities));
@@ -2045,6 +2065,85 @@ void CMUSHclientDoc::DebugHelper (const CString strAction, CString strArgument)
2045
2065
2046
2066
} // end of acceleratorlist
2047
2067
2068
+ // -----------------------------------------------------------------------
2069
+ // telnetlist
2070
+ // -----------------------------------------------------------------------
2071
+
2072
+ else if (strAction == " telnetlist" )
2073
+ {
2074
+
2075
+ ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, " " , " ------ Telnet negotiation List (numeric order) ------" );
2076
+ Note (" " );
2077
+
2078
+ map<int ,string> telnet_meanings;
2079
+
2080
+ // got these from Code_Chart.xml plugin
2081
+
2082
+ telnet_meanings [0x01 ] = " Echo" ; // 1 Echo
2083
+ telnet_meanings [0x03 ] = " Suppress Go-ahead (SGA)" ; // 3 Suppress go ahead
2084
+ telnet_meanings [0x05 ] = " Status" ; // 5 Status
2085
+ telnet_meanings [0x06 ] = " Timing Mark" ; // 6 Timing mark
2086
+ telnet_meanings [0x18 ] = " Termtype" ; // 24 Terminal type
2087
+ telnet_meanings [0x19 ] = " End of record (EOR)" ; // 25 EOR
2088
+ telnet_meanings [0x1F ] = " Window Size (NAWS)" ; // 31 Window size
2089
+ telnet_meanings [0x20 ] = " Terminal Speed" ; // 32 Terminal speed
2090
+ telnet_meanings [0x21 ] = " RFC" ; // 33 Remote flow control
2091
+ telnet_meanings [0x22 ] = " Line Mode" ; // 34 Line mode
2092
+ telnet_meanings [0x24 ] = " EV" ; // 36 Environment variables
2093
+ telnet_meanings [0x2A ] = " Charset" ; // 42 Character set
2094
+ telnet_meanings [0x55 ] = " MCCP1" ; // 85 MUD Compression Protocol v1
2095
+ telnet_meanings [0x56 ] = " MCCP2" ; // 86 MUD Compression Protocol v2
2096
+ telnet_meanings [0x5A ] = " MSP" ; // 90 (MUD Sound Protocol)
2097
+ telnet_meanings [0x5B ] = " MXP" ; // 91 (MUD eXtension Protocol)
2098
+ telnet_meanings [0x5D ] = " ZMP" ; // 93 (ZMP Protocol)
2099
+ telnet_meanings [0x66 ] = " Aardwolf" ; // 102 (Aardwolf telnet protocol)
2100
+ telnet_meanings [0xC8 ] = " ATCP" ; // 200 ATCP (Achaea Telnet Protocol)
2101
+ telnet_meanings [0xC9 ] = " ATCP2/GMCP" ; // 201 ATCP2/GMCP (Generic Mud Control Protocol)
2102
+ telnet_meanings [0xFF ] = " Extended Options" ; // for future expansion
2103
+
2104
+
2105
+ for (int i = 0 ; i < 256 ; i++)
2106
+ {
2107
+ if (m_bClient_sent_IAC_DO [i] ||
2108
+ m_bClient_sent_IAC_DONT [i] ||
2109
+ m_bClient_sent_IAC_WILL [i] ||
2110
+ m_bClient_sent_IAC_WONT [i] ||
2111
+ m_bClient_got_IAC_DO [i] ||
2112
+ m_bClient_got_IAC_DONT [i] ||
2113
+ m_bClient_got_IAC_WILL [i] ||
2114
+ m_bClient_got_IAC_WONT [i])
2115
+ {
2116
+
2117
+ string sMeaning = telnet_meanings [i];
2118
+ CString strMeaning;
2119
+ if (!sMeaning .empty ())
2120
+ {
2121
+ strMeaning = " (" ;
2122
+ strMeaning += sMeaning .c_str ();
2123
+ strMeaning += " )" ;
2124
+ }
2125
+
2126
+ Note (CFormat (" %3i%s" , i, (LPCTSTR) strMeaning));
2127
+ ColourTell (" cyan" , " " , " Got: " );
2128
+ Note (CFormat (" DO: %-3s, DONT: %-3s, WILL: %-3s, WONT: %-3s " ,
2129
+ SHOW_TRUE_LC (m_bClient_got_IAC_DO [i]),
2130
+ SHOW_TRUE_LC (m_bClient_got_IAC_DONT [i]),
2131
+ SHOW_TRUE_LC (m_bClient_got_IAC_WILL [i]),
2132
+ SHOW_TRUE_LC (m_bClient_got_IAC_WONT [i])));
2133
+
2134
+ ColourTell (" cyan" , " " , " Sent: " );
2135
+ Note (CFormat (" WILL: %-3s, WONT: %-3s, DO: %-3s, DONT: %-3s " ,
2136
+ SHOW_TRUE_LC (m_bClient_sent_IAC_WILL [i]),
2137
+ SHOW_TRUE_LC (m_bClient_sent_IAC_WONT [i]),
2138
+ SHOW_TRUE_LC (m_bClient_sent_IAC_DO [i]),
2139
+ SHOW_TRUE_LC (m_bClient_sent_IAC_DONT [i])));
2140
+
2141
+ } // end of something true
2142
+
2143
+ } // end of loop
2144
+
2145
+ } // end of telnetlist
2146
+
2048
2147
// -----------------------------------------------------------------------
2049
2148
// showtrigger
2050
2149
// -----------------------------------------------------------------------
0 commit comments