Skip to content

Commit 6fd17d9

Browse files
committed
Fixed bug re OnPluginPacketReceived and MXP processing
1 parent 15926e6 commit 6fd17d9

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

doc.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ CString str = strText;
13461346

13471347
SendPacket (str, str.GetLength ());
13481348

1349-
}
1349+
} // end of CMUSHclientDoc::DoSendMsg
13501350

13511351
void CMUSHclientDoc::ReceiveMsg()
13521352
{
@@ -1846,7 +1846,7 @@ void CMUSHclientDoc::SetNewLineColour (const int flags)
18461846

18471847
} // end of CMUSHclientDoc::SetNewLineColour
18481848

1849-
void CMUSHclientDoc::DisplayMsg(LPCTSTR lpszText, int size, const int flags)
1849+
void CMUSHclientDoc::DisplayMsg(LPCTSTR lpszText, int size, const int flags, const bool fake)
18501850
{
18511851
const char * p ;
18521852
unsigned char c;
@@ -1874,13 +1874,15 @@ CString strLine (lpszText, size);
18741874
Debug_MUD ("++Received from MUD: ", strLine);
18751875
#endif
18761876

1877-
// hex debug (debug packets)
1878-
if (m_bDebugIncomingPackets)
1877+
// hex debug (debug packets) - unless we have faked an input line from MXP processing or similar
1878+
if (m_bDebugIncomingPackets && !fake)
18791879
Debug_Packets ("Incoming", lpszText, size, m_iInputPacketCount);
18801880

18811881
m_iCurrentActionSource = eInputFromServer;
18821882

1883-
SendToAllPluginCallbacksRtn (ON_PLUGIN_PACKET_RECEIVED, strLine);
1883+
// let plugin change the input packet unless we have faked an input line from MXP processing or similar
1884+
if (!fake)
1885+
SendToAllPluginCallbacksRtn (ON_PLUGIN_PACKET_RECEIVED, strLine);
18841886

18851887
m_iCurrentActionSource = eUnknownActionSource;
18861888

doc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ class CMUSHclientDoc : public CDocument
14291429
const bool bQueueIt,
14301430
const bool bLogIt);
14311431
void ReceiveMsg();
1432-
void DisplayMsg(LPCTSTR lpszText, int size, const int flags);
1432+
void DisplayMsg(LPCTSTR lpszText, int size, const int flags, const bool fake = false);
14331433
void AddToLine (LPCTSTR lpszText, const int flags);
14341434
void StartNewLine_KeepPreviousStyle (const int flags);
14351435
void Phase_ESC (const unsigned char c);

mxp/mxpEntities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ CString strEntityContents = MXP_GetEntity (m_strMXPstring);
5050
{
5151
// if the entity happens to be < & > etc. don't reprocess it
5252
m_bMXP = false;
53-
DisplayMsg (strEntityContents, strEntityContents.GetLength (), 0);
53+
DisplayMsg (strEntityContents, strEntityContents.GetLength (), 0, true); // fake packet
5454
m_bMXP = true;
5555
}
5656

0 commit comments

Comments
 (0)