QTfrontend/newnetclient.cpp
changeset 1568 15a446307993
parent 1566 6b63c75fdc68
child 1569 4456a0dfc647
equal deleted inserted replaced
1567:95d7aab0df3f 1568:15a446307993
   259 		if(lst.size() < 3)
   259 		if(lst.size() < 3)
   260 		{
   260 		{
   261 			qWarning("Net: Empty CHAT_STRING message");
   261 			qWarning("Net: Empty CHAT_STRING message");
   262 			return;
   262 			return;
   263 		}
   263 		}
   264 		emit chatStringFromNet(formatChatMsg(lst[1], lst[2]));
   264 		if (netClientState == 2)
       
   265 			emit chatStringLobby(formatChatMsg(lst[1], lst[2]));
       
   266 		else
       
   267 			emit chatStringFromNet(formatChatMsg(lst[1], lst[2]));
   265 		return;
   268 		return;
   266 	}
   269 	}
   267 
   270 
   268 	if (lst[0] == "READY") {
   271 	if (lst[0] == "READY") {
   269 		if(lst.size() != 2)
   272 		if(lst.size() != 2)
   342 		}
   345 		}
   343 		
   346 		
   344 		for(int i = 1; i < lst.size(); ++i)
   347 		for(int i = 1; i < lst.size(); ++i)
   345 		{
   348 		{
   346 			emit nickAddedLobby(lst[i]);
   349 			emit nickAddedLobby(lst[i]);
   347 			//emit chatStringFromNet(QString(tr("*** %1 joined")).arg(lst[i]));
   350 			emit chatStringLobby(QString(tr("*** %1 joined")).arg(lst[i]));
   348 		}
   351 		}
   349 		return;
   352 		return;
   350 	}
   353 	}
   351 
   354 
   352 	if(lst[0] == "LEFT") {
   355 	if(lst[0] == "LEFT") {
   368 		{
   371 		{
   369 			qWarning("Net: Bad LEFT message");
   372 			qWarning("Net: Bad LEFT message");
   370 			return;
   373 			return;
   371 		}
   374 		}
   372 		emit nickRemovedLobby(lst[1]);
   375 		emit nickRemovedLobby(lst[1]);
   373 		/*if (lst.size() < 3)
   376 		if (lst.size() < 3)
   374 			emit chatStringFromNet(QString(tr("*** %1 left")).arg(lst[1]));
   377 			emit chatStringLobby(QString(tr("*** %1 left")).arg(lst[1]));
   375 		else
   378 		else
   376 			emit chatStringFromNet(QString(tr("*** %1 left (%2)")).arg(lst[1], lst[2]));*/
   379 			emit chatStringLobby(QString(tr("*** %1 left (%2)")).arg(lst[1], lst[2]));
   377 		return;
   380 		return;
   378 	}
   381 	}
   379 
   382 
   380 	if (lst[0] == "RUN_GAME") {
   383 	if (lst[0] == "RUN_GAME") {
   381 		netClientState = 5;
   384 		netClientState = 5;
   588 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   591 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   589 }
   592 }
   590 
   593 
   591 void HWNewNet::chatLineToNet(const QString& str)
   594 void HWNewNet::chatLineToNet(const QString& str)
   592 {
   595 {
   593   if(str!="") {
   596 	if(str != "") {
   594     RawSendNet(QString("CHAT_STRING")+delimeter+str);
   597 		RawSendNet(QString("CHAT_STRING") + delimeter + str);
   595     emit(chatStringFromMe(formatChatMsg(mynick, str)));
   598 		emit(chatStringFromMe(formatChatMsg(mynick, str)));
   596   }
   599 	}
       
   600 }
       
   601 
       
   602 void HWNewNet::chatLineToLobby(const QString& str)
       
   603 {
       
   604 	if(str != "") {
       
   605 		RawSendNet(QString("CHAT_STRING") + delimeter + str);
       
   606 		emit(chatStringFromMeLobby(formatChatMsg(mynick, str)));
       
   607 	}
   597 }
   608 }
   598 
   609 
   599 void HWNewNet::askRoomsList()
   610 void HWNewNet::askRoomsList()
   600 {
   611 {
   601 	if(netClientState != 2)
   612 	if(netClientState != 2)