1
0

Console logging supports cCompositeChat as its parameters.

This commit is contained in:
madmaxoft
2014-03-31 22:51:14 +02:00
parent 55d0db1606
commit 8126d9e66e
5 changed files with 78 additions and 34 deletions

View File

@@ -239,32 +239,11 @@ void cProtocol125::SendChat(const AString & a_Message)
void cProtocol125::SendChat(const cCompositeChat & a_Message)
{
// This version doesn't support composite messages, just extract each part's text and use it:
AString Msg;
const cCompositeChat::cParts & Parts = a_Message.GetParts();
for (cCompositeChat::cParts::const_iterator itr = Parts.begin(), end = Parts.end(); itr != end; ++itr)
{
switch ((*itr)->m_PartType)
{
case cCompositeChat::ptText:
case cCompositeChat::ptClientTranslated:
case cCompositeChat::ptRunCommand:
case cCompositeChat::ptSuggestCommand:
{
Msg.append((*itr)->m_Text);
break;
}
case cCompositeChat::ptUrl:
{
Msg.append(((cCompositeChat::cUrlPart *)(*itr))->m_Url);
break;
}
} // switch (PartType)
} // for itr - Parts[]
// Send the message:
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_CHAT);
WriteString(Msg);
WriteString(a_Message.ExtractText());
Flush();
}