Skip to content

Commit 949f460

Browse files
committed
Improvements to Debug 'summary'
1 parent 7990fdc commit 949f460

File tree

1 file changed

+63
-19
lines changed

1 file changed

+63
-19
lines changed

world_debug.cpp

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -853,12 +853,31 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
853853
else if (strcmp (Command, "summary") == 0)
854854
{
855855

856+
POSITION pos;
857+
CString strName;
858+
CTrigger * pTrigger;
859+
CAlias * pAlias;
860+
CTimer * pTimer;
861+
CPlugin * pPlugin;
862+
863+
__int64 nTotalMatches = 0;
864+
__int64 nTotalMatchAttempts = 0;
865+
long nTotal = 0;
866+
long nEnabled = 0;
867+
long nRegexp = 0;
868+
LONGLONG iTimeTaken = 0;
869+
double elapsed_time;
870+
int i;
871+
872+
856873
Note ("");
857874
Note ("-------------- MUSHclient summary --------------");
858875
Note ("");
859876
Note (TFormat ("MUSHclient version: %s", MUSHCLIENT_VERSION));
860877
// show compilation date
861878
Note (TFormat ("Compiled: %s.", __DATE__));
879+
Note (CTime::GetCurrentTime().Format (TranslateTime ("Time now: %A, %B %d, %Y, %#I:%M %p")));
880+
862881

863882
OSVERSIONINFO ver;
864883
// see which OS we are using
@@ -920,6 +939,11 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
920939
Note (TFormat ("World name: '%s', ID: %s",
921940
(LPCTSTR) m_mush_name, (LPCTSTR) m_strWorldID));
922941

942+
CString strStatus = GetConnectionStatus (m_iConnectPhase);
943+
944+
Note (TFormat ("Connect phase: %i (%s)",
945+
m_iConnectPhase, (LPCTSTR) strStatus));
946+
923947
// scripting info
924948

925949
Note (TFormat ("Script language: %s, enabled: %s",
@@ -932,24 +956,15 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
932956
(LPCTSTR) m_strScriptFilename
933957
));
934958

935-
// count triggers, aliases, timers
936-
937-
POSITION pos;
938-
CString strName;
939-
CTrigger * pTrigger;
940-
CAlias * pAlias;
941-
CTimer * pTimer;
942-
CPlugin * pPlugin;
943-
944-
__int64 nTotalMatches = 0;
945-
__int64 nTotalMatchAttempts = 0;
946-
long nTotal = 0;
947-
long nEnabled = 0;
948-
long nRegexp = 0;
949-
LONGLONG iTimeTaken = 0;
950-
double elapsed_time;
959+
// time taken to execute scripts
960+
if (App.m_iCounterFrequency > 0)
961+
{
962+
elapsed_time = ((double) m_iScriptTimeTaken) /
963+
((double) App.m_iCounterFrequency);
964+
Note (TFormat ("Scripting for: %1.6f seconds.", elapsed_time));
965+
}
951966

952-
967+
953968
// count number of triggers matched
954969
for (pos = m_TriggerMap.GetStartPosition(); pos; )
955970
{
@@ -1076,11 +1091,18 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
10761091
Note (TFormat ("** Variables: %ld.", nTotal));
10771092

10781093
if (m_bCompress)
1094+
{
10791095
Note (TFormat ("MCCP active, took %1.6f seconds to decompress", elapsed_time));
1096+
Note (TFormat ("MCCP received %I64d compressed bytes, decompressed to %I64d bytes.", m_nTotalCompressed, m_nTotalUncompressed));
1097+
if (m_nTotalUncompressed)
1098+
{
1099+
double fRatio = (double) m_nTotalCompressed / (double) m_nTotalUncompressed * 100.0;
1100+
Note (TFormat ("MCCP compression ratio was: %6.1f%% (lower is better)", fRatio));
1101+
}
1102+
}
10801103
else
10811104
Note (Translate ("MCCP not active."));
10821105

1083-
10841106
// count and display plugins
10851107

10861108
nTotal = 0;
@@ -1110,13 +1132,16 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
11101132
__int64 nOutK = m_nBytesOut / (__int64) 1024;
11111133
Note (TFormat ("Received: %I64d bytes (%I64d Kb)", m_nBytesIn, nInK));
11121134
Note (TFormat ("Sent: %I64d bytes (%I64d Kb)", m_nBytesOut, nOutK));
1135+
Note (TFormat ("Received %I64d packets, sent %I64d packets.", m_iInputPacketCount, m_iOutputPacketCount));
11131136

11141137
Note (TFormat ("Output buffer: %i of %ld lines.",
11151138
m_LineList.GetCount (),
11161139
m_maxlines));
11171140

11181141
Note (TFormat ("Total lines received: %ld", m_total_lines));
11191142

1143+
Note (TFormat ("This connection: Sent %ld lines, received %ld lines.", m_nTotalLinesSent, m_nTotalLinesReceived));
1144+
11201145
//MXP
11211146

11221147
Note (TFormat ("MXP active: %s, Pueblo mode: %s",
@@ -1224,14 +1249,33 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command)
12241249

12251250
// telnet negotiation
12261251

1227-
Note (TFormat ("** Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld",
1252+
Note (TFormat ("Telnet (IAC) received: DO: %ld, DONT: %ld, WILL: %ld, WONT: %ld, SB: %ld",
12281253
m_nCount_IAC_DO,
12291254
m_nCount_IAC_DONT,
12301255
m_nCount_IAC_WILL,
12311256
m_nCount_IAC_WONT,
12321257
m_nCount_IAC_SB));
12331258

12341259

1260+
// logging?
1261+
1262+
Note (TFormat ("Logging: %s, tracing: %s",
1263+
SHOW_TRUE (m_logfile), SHOW_TRUE (m_bTrace) ));
1264+
1265+
// databases?
1266+
Note (TFormat ("SQLite3 databases: %i", m_Databases.size ()));
1267+
1268+
// sound buffers?
1269+
1270+
nTotal = 0;
1271+
1272+
for (i = 0; i < MAX_SOUND_BUFFERS; i++)
1273+
if (m_pDirectSoundSecondaryBuffer [i])
1274+
nTotal++;
1275+
1276+
Note (TFormat ("DirectSound buffers in use: %ld", nTotal));
1277+
1278+
12351279
// end summary
12361280

12371281
Note ("");

0 commit comments

Comments
 (0)