QTfrontend/game.cpp
branchexperimental3D
changeset 4812 f924be23ffb4
parent 4004 b1c2c2f6fc5e
parent 4494 9585435e20f7
child 4849 e7b1f0aaf36f
--- a/QTfrontend/game.cpp	Mon Dec 27 23:57:44 2010 +0100
+++ b/QTfrontend/game.cpp	Tue Jan 04 12:53:46 2011 +0100
@@ -40,6 +40,7 @@
     this->config = config;
     this->gamecfg = gamecfg;
     TeamCount = 0;
+    netSuspend = false;
 }
 
 HWGame::~HWGame()
@@ -77,7 +78,7 @@
     }
     HWProto::addStringToBuffer(buf, gt);
 
-    HWProto::addStringListToBuffer(buf, gamecfg->getFullConfig());
+    buf += gamecfg->getFullConfig();
 
     if (m_pTeamSelWidget)
     {
@@ -88,7 +89,7 @@
             HWProto::addStringToBuffer(buf, QString("eammprob %1").arg(ammostr.mid(cAmmoNumber, cAmmoNumber)));
             HWProto::addStringToBuffer(buf, QString("eammdelay %1").arg(ammostr.mid(2 * cAmmoNumber, cAmmoNumber)));
             HWProto::addStringToBuffer(buf, QString("eammreinf %1").arg(ammostr.mid(3 * cAmmoNumber, cAmmoNumber)));
-            HWProto::addStringToBuffer(buf, QString("eammstore"));
+            if(!gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore"));
             HWProto::addStringListToBuffer(buf,
                 (*it).TeamGameConfig(gamecfg->getInitHealth()));
         }
@@ -245,7 +246,7 @@
             break;
         }
         default: {
-            if (gameType == gtNet)
+            if (gameType == gtNet && !netSuspend)
             {
                 emit SendNet(msg);
             }
@@ -378,3 +379,15 @@
     gameState = state;
     emit GameStateChanged(state);
 }
+
+void HWGame::KillAllTeams()
+{
+    if (m_pTeamSelWidget)
+    {
+        QByteArray buf;
+        QList<HWTeam> teams = m_pTeamSelWidget->getPlayingTeams();
+        for(QList<HWTeam>::iterator it = teams.begin(); it != teams.end(); ++it)
+            HWProto::addStringToBuffer(buf, QString("eteamgone %1").arg((*it).TeamName));
+        RawSendIPC(buf);
+    }
+}