Skip to content

Commit c8ff618

Browse files
committed
Count newlines received. Available as GetInfo (310).
1 parent e1a8672 commit c8ff618

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

ProcessPreviousLine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ assemble the full text of the original line.
536536

537537

538538
m_sRecentLines.push_back ((const char *) strCurrentLine);
539+
m_newlines_received++;
539540

540541
// too many? remove oldest one
541542
if (m_sRecentLines.size () > MAX_RECENT_LINES)

doc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6635,6 +6635,8 @@ void CMUSHclientDoc::ConnectionEstablished (void)
66356635
m_iTimersFiredThisSessionCount = 0;
66366636
m_bSuppressNewline = false;
66376637
m_iLastCommandCount = 0;
6638+
m_sRecentLines.clear ();
6639+
m_newlines_received = 0;
66386640
m_strLastCommandSent.Empty (); // no command sent yet
66396641
m_iNoteStyle = NORMAL; // back to default style
66406642

doc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ class CMUSHclientDoc : public CDocument
988988

989989
long m_total_lines;
990990
long m_new_lines; // lines they haven't read yet (if not active view)
991+
long m_newlines_received; // lines pushed into m_sRecentLines
991992
long m_nTotalLinesSent; // lines sent this connection
992993
long m_nTotalLinesReceived; // lines they received this connection
993994
long m_last_line_with_IAC_GA;

doc_construct.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ int i;
196196
m_InputFontHeight = 0;
197197
m_InputFontWidth = 0;
198198
m_total_lines = 0;
199+
m_newlines_received = 0;
199200
m_last_line_with_IAC_GA = 0;
200201
m_nTotalLinesSent = 0;
201202
m_nTotalLinesReceived = 0;

scripting/methods/methods_info.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ tInfoTypeMapping InfoTypes [] =
328328
{ 306, "When this world was created/opened" },
329329

330330

331+
// more numbers
332+
333+
{ 310, "Newlines received" },
334+
335+
331336
{ 0, "" }, // end of table marker
332337

333338
};
@@ -1044,6 +1049,8 @@ VARIANT CMUSHclientDoc::GetInfo(long InfoType)
10441049
break;
10451050

10461051

1052+
// dates
1053+
10471054
case 301:
10481055
if (m_tConnectTime.GetTime ()) // only if non-zero, otherwise return empty
10491056
SetUpVariantDate (vaResult, COleDateTime (m_tConnectTime.GetTime ()));
@@ -1069,6 +1076,12 @@ VARIANT CMUSHclientDoc::GetInfo(long InfoType)
10691076
SetUpVariantDate (vaResult, COleDateTime (m_whenWorldStarted.GetTime ()));
10701077
break;
10711078

1079+
// more numbers
1080+
1081+
case 310:
1082+
SetUpVariantLong (vaResult, m_newlines_received); // newlines received
1083+
break;
1084+
10721085
default:
10731086
vaResult.vt = VT_NULL;
10741087
break;

0 commit comments

Comments
 (0)