Skip to content

Commit

Permalink
Neatened up Debug 'summary', adding subheadings
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Jul 21, 2010
1 parent 949f460 commit 1aecfa9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
1 change: 0 additions & 1 deletion doc.cpp
Expand Up @@ -1020,7 +1020,6 @@ CString str;
m_iInputPacketCount = 0;
m_iOutputPacketCount = 0;
m_iUTF8ErrorCount = 0;
m_iOutputWindowRedrawCount = 0;

str = TFormat ("Connecting to %s, port %d",
(const char *) m_mush_name, m_port);
Expand Down
2 changes: 1 addition & 1 deletion doc_construct.cpp
Expand Up @@ -410,7 +410,7 @@ int i;
m_nCount_IAC_WONT = 0;
m_nCount_IAC_SB = 0;


m_iOutputWindowRedrawCount = 0;

// set up some default triggers for MUSHes

Expand Down
66 changes: 41 additions & 25 deletions world_debug.cpp
Expand Up @@ -838,7 +838,7 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)

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

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


Note ("");
Note ("-------------- MUSHclient summary --------------");
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-------------- MUSHclient summary --------------");
Note ("");
Note (TFormat ("MUSHclient version: %s", MUSHCLIENT_VERSION));
// show compilation date
Expand Down Expand Up @@ -939,13 +939,10 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
Note (TFormat ("World name: '%s', ID: %s",
(LPCTSTR) m_mush_name, (LPCTSTR) m_strWorldID));

CString strStatus = GetConnectionStatus (m_iConnectPhase);

Note (TFormat ("Connect phase: %i (%s)",
m_iConnectPhase, (LPCTSTR) strStatus));

// scripting info

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

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

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

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

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- MCCP --");

if (m_bCompress)
{
Note (TFormat ("MCCP active, took %1.6f seconds to decompress", elapsed_time));
Expand All @@ -1103,6 +1103,8 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
else
Note (Translate ("MCCP not active."));

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Plugins --");

// count and display plugins

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

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

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Comms --");

// show bytes sent/received

CString strStatus = GetConnectionStatus (m_iConnectPhase);

Note (TFormat ("Connect phase: %i (%s)",
m_iConnectPhase, (LPCTSTR) strStatus));

__int64 nInK = m_nBytesIn / (__int64) 1024;
__int64 nOutK = m_nBytesOut / (__int64) 1024;
Note (TFormat ("Received: %I64d bytes (%I64d Kb)", m_nBytesIn, nInK));
Expand All @@ -1142,6 +1151,17 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)

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

// telnet negotiation

Note (TFormat ("Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld",
m_nCount_IAC_DO,
m_nCount_IAC_DONT,
m_nCount_IAC_WILL,
m_nCount_IAC_WONT,
m_nCount_IAC_SB));

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- MXP --");

//MXP

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

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Commands --");

// commands typed

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

Note (TFormat ("** Commands in command history: %ld", nTotal));
Note (TFormat ("Commands in command history: %ld", nTotal));

// accelerators

Note (TFormat ("Accelerators defined: %ld", m_AcceleratorToCommandMap.size ()));

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Miniwindows --");

// miniwindows
nTotal = 0;
Expand Down Expand Up @@ -1227,6 +1254,8 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)

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

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Output window --");

// output window info

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

Note (TFormat ("** Output pixels: width %ld, height: %ld, font width: %ld, font height: %ld",
Note (TFormat ("Output pixels: width %ld, height: %ld, font width: %ld, font height: %ld",
r.right, r.bottom, m_FontWidth, m_FontHeight));

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


// accelerators

Note (TFormat ("Accelerators defined: %ld", m_AcceleratorToCommandMap.size ()));

// telnet negotiation

Note (TFormat ("Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld",
m_nCount_IAC_DO,
m_nCount_IAC_DONT,
m_nCount_IAC_WILL,
m_nCount_IAC_WONT,
m_nCount_IAC_SB));

ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-- Miscellaneous --");

// logging?

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

Note (TFormat ("DirectSound buffers in use: %ld", nTotal));

Note (TFormat ("Sound buffers in use: %ld", nTotal));

// end summary

Note ("");
Note ("-------------- End summary --------------");
ColourNote (SCRIPTERRORCONTEXTFORECOLOUR, "", "-------------- End summary --------------");

} // end of summary

Expand Down

0 comments on commit 1aecfa9

Please sign in to comment.