QTfrontend/newnetclient.cpp
changeset 1351 aa7aefec5c1b
parent 1344 4004e597f1bf
child 1354 a8dcdeb88a43
equal deleted inserted replaced
1350:99a921e292f4 1351:aa7aefec5c1b
   260 		{
   260 		{
   261 			qWarning("Net: Bad REMOVETEAM message");
   261 			qWarning("Net: Bad REMOVETEAM message");
   262 			return;
   262 			return;
   263 		}
   263 		}
   264 		m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1]));
   264 		m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1]));
       
   265 		if (netClientState == 5) // we're in game, need to tell the engine about this
       
   266 		{
       
   267 			QByteArray em;
       
   268 			HWProto::addStringToBuffer(em, "F" + lst[1]);
       
   269 			emit FromNet(em);
       
   270 		}
   265 		return;
   271 		return;
   266 	}
   272 	}
   267 
   273 
   268 	if(lst[0]=="JOINED") {
   274 	if(lst[0]=="JOINED") {
   269 		if(lst.size() < 2)
   275 		if(lst.size() < 2)
   295 		emit nickRemoved(lst[1]);
   301 		emit nickRemoved(lst[1]);
   296 		return;
   302 		return;
   297 	}
   303 	}
   298 
   304 
   299 	if (lst[0] == "RUN_GAME") {
   305 	if (lst[0] == "RUN_GAME") {
       
   306 		netClientState = 5;
   300 		RunGame();
   307 		RunGame();
   301 		return;
   308 		return;
   302 	}
   309 	}
   303 
   310 
   304 	if (lst[0] == "TEAM_ACCEPTED") {
   311 	if (lst[0] == "TEAM_ACCEPTED") {
   379 		tmptm.teamColor = QColor(lst[2]);
   386 		tmptm.teamColor = QColor(lst[2]);
   380 		emit teamColorChanged(tmptm);
   387 		emit teamColorChanged(tmptm);
   381 		return;
   388 		return;
   382 	}
   389 	}
   383 
   390 
   384   if (lst[0] == "GAMEMSG") {
   391 	if (lst[0] == "GAMEMSG") {
   385     if(lst.size() < 2)
   392 		if(lst.size() < 2)
   386     {
   393 		{
   387       qWarning("Net: Bad GAMEMSG message");
   394 			qWarning("Net: Bad GAMEMSG message");
   388       return;
   395 			return;
   389     }
   396 		}
   390     QByteArray em = QByteArray::fromBase64(lst[1].toAscii());
   397 		QByteArray em = QByteArray::fromBase64(lst[1].toAscii());
   391     emit FromNet(em);
   398 		emit FromNet(em);
   392     return;
   399 		return;
   393   }
   400 	}
   394 
   401 
   395   qWarning() << "Net: Unknown message:" << lst;
   402 	qWarning() << "Net: Unknown message:" << lst;
   396 }
   403 }
   397 
   404 
   398 
   405 
   399 void HWNewNet::ConfigAsked()
   406 void HWNewNet::ConfigAsked()
   400 {
   407 {
   492 	return isChief;
   499 	return isChief;
   493 }
   500 }
   494 
   501 
   495 void HWNewNet::gameFinished()
   502 void HWNewNet::gameFinished()
   496 {
   503 {
       
   504 	netClientState = 3;
   497 	RawSendNet(QString("ROUNDFINISHED"));
   505 	RawSendNet(QString("ROUNDFINISHED"));
   498 }
   506 }