# HG changeset patch # User unc0rr # Date 1224087934 0 # Node ID 99ba722e5a09ae105f025be38b1348d398e7b297 # Parent 5b9012dd4a052c40933fcb7247470f63ee0a855e Fix chat messages in saves and demos diff -r 5b9012dd4a05 -r 99ba722e5a09 QTfrontend/game.cpp --- a/QTfrontend/game.cpp Wed Oct 15 15:59:19 2008 +0000 +++ b/QTfrontend/game.cpp Wed Oct 15 16:25:34 2008 +0000 @@ -157,6 +157,7 @@ void HWGame::ParseMessage(const QByteArray & msg) { +qDebug() << msg; switch(msg.at(1)) { case '?': { SendIPC("!"); @@ -165,11 +166,11 @@ case 'C': { switch (gameType) { case gtLocal: { - SendConfig(); + SendConfig(); break; } case gtQLocal: { - SendQuickConfig(); + SendQuickConfig(); break; } case gtDemo: break; @@ -178,7 +179,7 @@ break; } case gtTraining: { - SendTrainingConfig(); + SendTrainingConfig(); break; } } @@ -216,13 +217,19 @@ } case 's': { int size = msg.size(); - emit SendChat(QString::fromUtf8(msg.mid(2).left(size - 4))); + QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4)); + emit SendChat(msgbody); + QByteArray buf; + HWProto::addStringToBuffer(buf, QString("s%1: %2\x20\x20").arg(config->netNick()).arg(msgbody)); + demo.append(buf); + break; } default: { if (gameType == gtNet) { emit SendNet(msg); } + if (msg.at(1) != 's') demo.append(msg); } }