QTfrontend/newnetclient.cpp
changeset 339 7535ab6c3820
parent 338 d1e75dcd285f
child 341 184230eb4151
--- a/QTfrontend/newnetclient.cpp	Sun Jan 14 23:13:24 2007 +0000
+++ b/QTfrontend/newnetclient.cpp	Mon Jan 15 18:45:07 2007 +0000
@@ -27,9 +27,10 @@
 
 char delimeter='\t';
 
-HWNewNet::HWNewNet(GameUIConfig * config, GameCFGWidget* pGameCFGWidget) :
+HWNewNet::HWNewNet(GameUIConfig * config, GameCFGWidget* pGameCFGWidget, TeamSelWidget* pTeamSelWidget) :
   config(config),
   m_pGameCFGWidget(pGameCFGWidget),
+  m_pTeamSelWidget(pTeamSelWidget),
   isChief(false)
 {
   connect(&NetSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
@@ -147,7 +148,7 @@
 
   if (lst[0] == "ADDTEAM:") {
     lst.pop_front();
-    emit AddNetTeam(lst[0]);
+    emit AddNetTeam(lst);
     return;
   }
 
@@ -157,6 +158,14 @@
     return;
   }
 
+  if (lst[0] == "RUNGAME") {
+    HWGame* game = new HWGame(config, m_pGameCFGWidget, m_pTeamSelWidget); // FIXME: memory leak here (stackify it?)
+    connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &)));
+    connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
+    connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &)));
+    game->StartNet();
+  }
+
   if (lst[0] == "CONFIGURED") {
     lst.pop_front();
     if(lst.size()<5) return;