# HG changeset patch # User unc0rr # Date 1370290806 -14400 # Node ID 5ce3cfe45476940438f45b91d967858bb8ea619e # Parent 5cf87143b188767ea4eaa337b3c38454877341db# Parent 3f5e0280db4d28e480a015e0f54dc931902e249c Merge default to 0.9.19 diff -r 5cf87143b188 -r 5ce3cfe45476 CMakeLists.txt diff -r 5cf87143b188 -r 5ce3cfe45476 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Mon Jun 03 16:25:30 2013 +0200 +++ b/QTfrontend/hwform.cpp Tue Jun 04 00:20:06 2013 +0400 @@ -1374,6 +1374,9 @@ connect(ui.pageNetGame->pGameCFG, SIGNAL(paramChanged(const QString &, const QStringList &)), hwnet, SLOT(onParamChanged(const QString &, const QStringList &))); connect(hwnet, SIGNAL(configAsked()), ui.pageNetGame->pGameCFG, SLOT(fullNetConfig())); + // using proxy slot to prevent loss of game messages when they're sent to not yet connected slot of game object + connect(hwnet, SIGNAL(FromNet(const QByteArray &)), this, SLOT(FromNetProxySlot(const QByteArray &)), Qt::QueuedConnection); + //nick and pass stuff hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT); if (hwnet->m_private_game == false && AskForNickAndPwd() != 0) @@ -1726,6 +1729,11 @@ void HWForm::CreateNetGame() { + // go back in pages to prevent user from being stuck on certain pages + if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS || + ui.Pages->currentIndex() == ID_PAGE_INGAME) + GoBack(); + QString ammo; ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData( ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() @@ -1736,7 +1744,6 @@ connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &))); connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &))); connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &))); - connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)), Qt::QueuedConnection); connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection); game->StartNet(); @@ -1828,6 +1835,13 @@ ui.pageNetGame->setMasterMode(false); } +void HWForm::FromNetProxySlot(const QByteArray & msg) +{ + if(game) + game->FromNet(msg); + +} + void HWForm::selectFirstNetScheme() { ui.pageNetGame->pGameCFG->GameSchemes->setCurrentIndex(0); diff -r 5cf87143b188 -r 5ce3cfe45476 QTfrontend/hwform.h --- a/QTfrontend/hwform.h Mon Jun 03 16:25:30 2013 +0200 +++ b/QTfrontend/hwform.h Tue Jun 04 00:20:06 2013 +0400 @@ -145,6 +145,8 @@ void startGame(); void restartGame(); + void FromNetProxySlot(const QByteArray &); + private: void _NetConnect(const QString & hostName, quint16 port, QString nick); int AskForNickAndPwd(void);