Don't set Default scheme/ammo when switching script if not room admin. Prevents game config desync.
authorunc0rr
Wed, 10 Apr 2013 00:13:26 +0400
changeset 8893 8f92e94d0b32
parent 8891 bf67b4d7d7b4
child 8895 95177c18e38c
Don't set Default scheme/ammo when switching script if not room admin. Prevents game config desync.
QTfrontend/hwform.cpp
QTfrontend/ui/widget/gamecfgwidget.cpp
--- a/QTfrontend/hwform.cpp	Mon Apr 08 23:34:12 2013 +0400
+++ b/QTfrontend/hwform.cpp	Wed Apr 10 00:13:26 2013 +0400
@@ -1247,7 +1247,7 @@
 
 // room status stuff
     connect(hwnet, SIGNAL(roomMaster(bool)),
-            this, SLOT(NetGameChangeStatus(bool)), Qt::QueuedConnection);
+            this, SLOT(NetGameChangeStatus(bool)));
 
 // net page stuff
     connect(hwnet, SIGNAL(roomNameUpdated(const QString &)),
@@ -1754,9 +1754,6 @@
 
 void HWForm::NetGameChangeStatus(bool isMaster)
 {
-    ui.pageNetGame->pGameCFG->setMaster(isMaster);
-    ui.pageNetGame->pNetTeamsWidget->setInteractivity(isMaster);
-
     if (isMaster)
         NetGameMaster();
     else
@@ -1808,6 +1805,7 @@
     {
         NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet);
         connect(hwnet, SIGNAL(netSchemeConfig(QStringList &)), netAmmo, SLOT(setNetSchemeConfig(QStringList &)));
+
         ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo);
 
         ui.pageNetGame->setRoomName(hwnet->getRoom());
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp	Mon Apr 08 23:34:12 2013 +0400
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp	Wed Apr 10 00:13:26 2013 +0400
@@ -599,7 +599,7 @@
             GameSchemes->setEnabled(false);
             GameSchemes->setCurrentIndex(GameSchemes->findText("Default"));
         }
-        else
+        else if (m_master)
         {
             GameSchemes->setEnabled(true);
             int num = GameSchemes->findText(scheme);
@@ -614,7 +614,7 @@
             WeaponsName->setEnabled(false);
             WeaponsName->setCurrentIndex(WeaponsName->findText("Default"));
         }
-        else
+        else if (m_master)
         {
             WeaponsName->setEnabled(true);
             int num = WeaponsName->findText(weapons);