QTfrontend/newnetclient.cpp
changeset 352 4665bfe25470
parent 349 5b37d6a39829
child 354 60e4af0a4375
equal deleted inserted replaced
351:29bc9c36ad5f 352:4665bfe25470
   166     emit AddNetTeam(lst);
   166     emit AddNetTeam(lst);
   167     return;
   167     return;
   168   }
   168   }
   169 
   169 
   170   if (lst[0] == "REMOVETEAM:") {
   170   if (lst[0] == "REMOVETEAM:") {
   171     if(lst.size()<2) return;
   171     if(lst.size()<3) return;
   172     m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1], true));
   172     m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1], lst[2].toUInt()));
   173     return;
   173     return;
   174   }
   174   }
   175 
   175 
   176   if(lst[0]=="SLAVE") {
   176   if(lst[0]=="SLAVE") {
   177     m_pGameCFGWidget->setEnabled(false);
   177     m_pGameCFGWidget->setEnabled(false);
   227   	}
   227   	}
   228   	if (lst[1] == "FORTSMODE") {
   228   	if (lst[1] == "FORTSMODE") {
   229 	  emit fortsModeChanged(lst[2].toInt() != 0);
   229 	  emit fortsModeChanged(lst[2].toInt() != 0);
   230 	  return;
   230 	  return;
   231   	}
   231   	}
       
   232   	if (lst[1] == "HHNUM") {
       
   233 	  HWTeam tmptm(lst[2], lst[3].toUInt());
       
   234 	  tmptm.numHedgehogs=lst[4].toUInt();
       
   235 	  emit hhnumChanged(tmptm);
       
   236 	  return;
       
   237   	}
   232   	qDebug() << "unknow config param: " << lst[1];
   238   	qDebug() << "unknow config param: " << lst[1];
   233     return;
   239     return;
   234   }
   240   }
   235 
   241 
   236 
   242 
   263   connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
   269   connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
   264   connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &)));
   270   connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &)));
   265   game->StartNet();
   271   game->StartNet();
   266 }
   272 }
   267 
   273 
       
   274 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team)
       
   275 {
       
   276   qDebug() << team.getNetID() << ":" << team.numHedgehogs;
       
   277   RawSendNet(QString("CONFIG_PARAM%1HHNUM%1%2%1%3%1%4").arg(delimeter).arg(team.TeamName).arg(team.getNetID()).arg(team.numHedgehogs));
       
   278 }
       
   279 
   268 void HWNewNet::onSeedChanged(const QString & seed)
   280 void HWNewNet::onSeedChanged(const QString & seed)
   269 {
   281 {
   270   RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed));
   282   RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed));
   271 }
   283 }
   272 
   284