QTfrontend/newnetclient.cpp
changeset 1838 00a5fc50aa43
parent 1829 0cd14c9b1fe0
child 1841 fba7210b438b
equal deleted inserted replaced
1837:650884b2e8c1 1838:00a5fc50aa43
   199 	{
   199 	{
   200 		qWarning("Net client: Bad message");
   200 		qWarning("Net client: Bad message");
   201 		return;
   201 		return;
   202 	}
   202 	}
   203 
   203 
   204 	if ((lst[0] == "NICK") || (lst[0] == "PROTO"))
   204 	if (lst[0] == "NICK")
   205 	{
   205 	{
   206 		loginStep++;
   206 		mynick = lst[1];
   207 		if (loginStep == 2)
       
   208 		{
       
   209 			netClientState = 2;
       
   210 			RawSendNet(QString("LIST"));
       
   211 		}
       
   212 		return ;
   207 		return ;
   213 	}
   208 	}
   214 
   209 
   215 	if (lst[0] == "ERROR") {
   210 	if (lst[0] == "ERROR") {
   216 		if (lst.size() == 2)
   211 		if (lst.size() == 2)
   337 		}
   332 		}
   338 		m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1]));
   333 		m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1]));
   339 		return;
   334 		return;
   340 	}
   335 	}
   341 
   336 
   342 	if(lst[0]=="ROOMABANDONED") {
   337 	if(lst[0] == "ROOMABANDONED") {
   343 		netClientState = 2;
   338 		netClientState = 2;
   344 		emit showMessage(HWNewNet::tr("Room destroyed"));
   339 		emit showMessage(HWNewNet::tr("Room destroyed"));
   345 		emit LeftRoom();
   340 		emit LeftRoom();
   346 		return;
   341 		return;
   347 	}
   342 	}
   348 
   343 
   349 	if(lst[0]=="JOINED") {
   344 	if(lst[0] == "JOINED") {
   350 		if(lst.size() < 2)
   345 		if(lst.size() < 2)
   351 		{
   346 		{
   352 			qWarning("Net: Bad JOINED message");
   347 			qWarning("Net: Bad JOINED message");
   353 			return;
   348 			return;
   354 		}
   349 		}
   366 			emit chatStringFromNet(QString(tr("*** %1 joined")).arg(lst[i]));
   361 			emit chatStringFromNet(QString(tr("*** %1 joined")).arg(lst[i]));
   367 		}
   362 		}
   368 		return;
   363 		return;
   369 	}
   364 	}
   370 
   365 
   371 	if(lst[0]=="LOBBY:JOINED") {
   366 	if(lst[0] == "LOBBY:JOINED") {
   372 		if(lst.size() < 2)
   367 		if(lst.size() < 2)
   373 		{
   368 		{
   374 			qWarning("Net: Bad JOINED message");
   369 			qWarning("Net: Bad JOINED message");
   375 			return;
   370 			return;
   376 		}
   371 		}
   377 		
   372 		
   378 		for(int i = 1; i < lst.size(); ++i)
   373 		for(int i = 1; i < lst.size(); ++i)
   379 		{
   374 		{
       
   375 			if (lst[i] == mynick)
       
   376 			{
       
   377 				netClientState = 2;
       
   378 				RawSendNet(QString("LIST"));
       
   379 			}
       
   380 
   380 			emit nickAddedLobby(lst[i]);
   381 			emit nickAddedLobby(lst[i]);
   381 			emit chatStringLobby(QString(tr("*** %1 joined")).arg(lst[i]));
   382 			emit chatStringLobby(QString(tr("*** %1 joined")).arg(lst[i]));
   382 		}
   383 		}
   383 		return;
   384 		return;
   384 	}
   385 	}