# HG changeset patch # User unc0rr # Date 1351765913 -14400 # Node ID be11c26a3a0be8a2e062d5bf6a746e9a08eac472 # Parent e3f61d848985db2aaaa8b448072391a4aef2b27e Fix 0.9.18 desync: CreateNetGame() slot creates signal-slot connections from hwnet to hwgame. The problem is that this slot is called asynchronously using queued connection, and hwnet could send some signals to hwgame before hwgame object is created and connected. Changed this to direct connection. Also changed connections to hwgame object to queued, but this is unrelated. Sorry, it is frontend patch. Maybe a little delay on server side could help, but not much, as tcp packets could get glued on client's side, and that greately depends on pc and internet connection performance. Frontend should be reworked to be safe for queued connections, as it is extemely dangerous to have a mix of queued/direct connections. diff -r e3f61d848985 -r be11c26a3a0b QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Thu Nov 01 04:25:03 2012 +0100 +++ b/QTfrontend/hwform.cpp Thu Nov 01 14:31:53 2012 +0400 @@ -1070,7 +1070,7 @@ GoToPage(ID_PAGE_CONNECTING); - connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection); + connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame())); connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection); connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection); connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection); @@ -1473,8 +1473,8 @@ 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 &))); - connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(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(); }