QTfrontend/newnetclient.cpp
changeset 574 1cafd9eb1a21
parent 573 e0cf483e68d6
child 655 e58a77556878
equal deleted inserted replaced
573:e0cf483e68d6 574:1cafd9eb1a21
   108   }
   108   }
   109 }
   109 }
   110 
   110 
   111 void HWNewNet::OnConnect()
   111 void HWNewNet::OnConnect()
   112 {
   112 {
   113   RawSendNet(QString("USER") + delimeter + "hwgame 1 2 Hedgewars game");
       
   114   RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick));
   113   RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick));
   115 }
   114 }
   116 
   115 
   117 void HWNewNet::OnDisconnect()
   116 void HWNewNet::OnDisconnect()
   118 {
   117 {
   167     emit chatStringFromNet(lst);
   166     emit chatStringFromNet(lst);
   168     return;
   167     return;
   169   }
   168   }
   170 
   169 
   171   if (lst[0] == "ADDTEAM:") {
   170   if (lst[0] == "ADDTEAM:") {
       
   171     if(lst.size() < 14)
       
   172     {
       
   173 	  qWarning("Net: Too short ADDTEAM message");
       
   174 	  return;
       
   175     }
   172     lst.pop_front();
   176     lst.pop_front();
   173     emit AddNetTeam(lst);
   177     emit AddNetTeam(lst);
   174     return;
   178     return;
   175   }
   179   }
   176 
   180 
   319 }
   323 }
   320 
   324 
   321 
   325 
   322 void HWNewNet::ConfigAsked()
   326 void HWNewNet::ConfigAsked()
   323 {
   327 {
       
   328   QString map = m_pGameCFGWidget->getCurrentMap();
       
   329   if (map.size())
       
   330     onMapChanged(map);
       
   331 
   324   onSeedChanged(m_pGameCFGWidget->getCurrentSeed());
   332   onSeedChanged(m_pGameCFGWidget->getCurrentSeed());
   325   onMapChanged(m_pGameCFGWidget->getCurrentMap());
       
   326   onThemeChanged(m_pGameCFGWidget->getCurrentTheme());
   333   onThemeChanged(m_pGameCFGWidget->getCurrentTheme());
   327   onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   334   onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   328   onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   335   onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   329   onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   336   onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   330 }
   337 }