Skip to content

Commit 1aecfa9

Browse files
committed
Neatened up Debug 'summary', adding subheadings
1 parent 949f460 commit 1aecfa9

File tree

3 files changed

+42
-27
lines changed

3 files changed

+42
-27
lines changed

doc.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,6 @@ CString str;
10201020
m_iInputPacketCount = 0;
10211021
m_iOutputPacketCount = 0;
10221022
m_iUTF8ErrorCount = 0;
1023-
m_iOutputWindowRedrawCount = 0;
10241023

10251024
str = TFormat ("Connecting to %s, port %d",
10261025
(const char *) m_mush_name, m_port);

doc_construct.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ int i;
410410
m_nCount_IAC_WONT = 0;
411411
m_nCount_IAC_SB = 0;
412412

413-
413+
m_iOutputWindowRedrawCount = 0;
414414

415415
// set up some default triggers for MUSHes
416416

world_debug.cpp

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
838838

839839
Note (CFormat ("%03i: %s = %s", InfoTypes [iCount].iInfoType,
840840
InfoTypes [iCount].sDescription,
841-
CString (v.bstrVal)));
841+
(LPCTSTR) CString (v.bstrVal)));
842842

843843
v.Clear (); // get rid of string (is this necessary?)
844844
} // end of not VT_NULL
@@ -871,7 +871,7 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
871871

872872

873873
Note ("");
874-
Note ("-------------- MUSHclient summary --------------");
874+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-------------- MUSHclient summary --------------");
875875
Note ("");
876876
Note (TFormat ("MUSHclient version: %s", MUSHCLIENT_VERSION));
877877
// show compilation date
@@ -939,13 +939,10 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
939939
Note (TFormat ("World name: '%s', ID: %s",
940940
(LPCTSTR) m_mush_name, (LPCTSTR) m_strWorldID));
941941

942-
CString strStatus = GetConnectionStatus (m_iConnectPhase);
943-
944-
Note (TFormat ("Connect phase: %i (%s)",
945-
m_iConnectPhase, (LPCTSTR) strStatus));
946942

947943
// scripting info
948944

945+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Scripting --");
949946
Note (TFormat ("Script language: %s, enabled: %s",
950947
(LPCTSTR) m_strLanguage,
951948
SHOW_TRUE (m_bEnableScripts)
@@ -964,6 +961,7 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
964961
Note (TFormat ("Scripting for: %1.6f seconds.", elapsed_time));
965962
}
966963

964+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Triggers, aliases, timers, variables --");
967965

968966
// count number of triggers matched
969967
for (pos = m_TriggerMap.GetStartPosition(); pos; )
@@ -1090,6 +1088,8 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
10901088

10911089
Note (TFormat ("** Variables: %ld.", nTotal));
10921090

1091+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- MCCP --");
1092+
10931093
if (m_bCompress)
10941094
{
10951095
Note (TFormat ("MCCP active, took %1.6f seconds to decompress", elapsed_time));
@@ -1103,6 +1103,8 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11031103
else
11041104
Note (Translate ("MCCP not active."));
11051105

1106+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Plugins --");
1107+
11061108
// count and display plugins
11071109

11081110
nTotal = 0;
@@ -1126,8 +1128,15 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11261128

11271129
Note (TFormat ("** Plugins: %ld loaded, %ld enabled.", nTotal, nEnabled));
11281130

1131+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Comms --");
1132+
11291133
// show bytes sent/received
11301134

1135+
CString strStatus = GetConnectionStatus (m_iConnectPhase);
1136+
1137+
Note (TFormat ("Connect phase: %i (%s)",
1138+
m_iConnectPhase, (LPCTSTR) strStatus));
1139+
11311140
__int64 nInK = m_nBytesIn / (__int64) 1024;
11321141
__int64 nOutK = m_nBytesOut / (__int64) 1024;
11331142
Note (TFormat ("Received: %I64d bytes (%I64d Kb)", m_nBytesIn, nInK));
@@ -1142,6 +1151,17 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11421151

11431152
Note (TFormat ("This connection: Sent %ld lines, received %ld lines.", m_nTotalLinesSent, m_nTotalLinesReceived));
11441153

1154+
// telnet negotiation
1155+
1156+
Note (TFormat ("Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld",
1157+
m_nCount_IAC_DO,
1158+
m_nCount_IAC_DONT,
1159+
m_nCount_IAC_WILL,
1160+
m_nCount_IAC_WONT,
1161+
m_nCount_IAC_SB));
1162+
1163+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- MXP --");
1164+
11451165
//MXP
11461166

11471167
Note (TFormat ("MXP active: %s, Pueblo mode: %s",
@@ -1152,6 +1172,7 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11521172
Note (TFormat ("MXP entities received: %I64d", m_iMXPentities));
11531173
Note (TFormat ("MXP errors: %I64d", m_iMXPerrors));
11541174

1175+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Commands --");
11551176

11561177
// commands typed
11571178

@@ -1171,7 +1192,13 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11711192
} // end of being a CSendView
11721193
} // end of loop through views
11731194

1174-
Note (TFormat ("** Commands in command history: %ld", nTotal));
1195+
Note (TFormat ("Commands in command history: %ld", nTotal));
1196+
1197+
// accelerators
1198+
1199+
Note (TFormat ("Accelerators defined: %ld", m_AcceleratorToCommandMap.size ()));
1200+
1201+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Miniwindows --");
11751202

11761203
// miniwindows
11771204
nTotal = 0;
@@ -1227,6 +1254,8 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
12271254

12281255
Note (TFormat ("** Miniwindows: %ld loaded, %ld shown.", nTotal, nEnabled));
12291256

1257+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Output window --");
1258+
12301259
// output window info
12311260

12321261
CRect r (0, 0, 0, 0);
@@ -1235,27 +1264,15 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
12351264
if (pmyView)
12361265
pmyView->GetClientRect(&r);
12371266

1238-
Note (TFormat ("** Output pixels: width %ld, height: %ld, font width: %ld, font height: %ld",
1267+
Note (TFormat ("Output pixels: width %ld, height: %ld, font width: %ld, font height: %ld",
12391268
r.right, r.bottom, m_FontWidth, m_FontHeight));
12401269

12411270
if (m_FontWidth > 0 && m_FontHeight > 0)
1242-
Note (TFormat (" width %ld characters, wrap at column %ld, height %ld lines.",
1271+
Note (TFormat (" width %ld characters, wrap at column %ld, height %ld lines.",
12431272
r.right / m_FontWidth, m_nWrapColumn, r.bottom / m_FontHeight));
12441273

12451274

1246-
// accelerators
1247-
1248-
Note (TFormat ("Accelerators defined: %ld", m_AcceleratorToCommandMap.size ()));
1249-
1250-
// telnet negotiation
1251-
1252-
Note (TFormat ("Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld",
1253-
m_nCount_IAC_DO,
1254-
m_nCount_IAC_DONT,
1255-
m_nCount_IAC_WILL,
1256-
m_nCount_IAC_WONT,
1257-
m_nCount_IAC_SB));
1258-
1275+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Miscellaneous --");
12591276

12601277
// logging?
12611278

@@ -1273,13 +1290,12 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
12731290
if (m_pDirectSoundSecondaryBuffer [i])
12741291
nTotal++;
12751292

1276-
Note (TFormat ("DirectSound buffers in use: %ld", nTotal));
1277-
1293+
Note (TFormat ("Sound buffers in use: %ld", nTotal));
12781294

12791295
// end summary
12801296

12811297
Note ("");
1282-
Note ("-------------- End summary --------------");
1298+
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-------------- End summary --------------");
12831299

12841300
} // end of summary
12851301

0 commit comments

Comments
 (0)