QTfrontend/newnetclient.cpp
changeset 1592 5ee77ee470a6
parent 1591 1db9b654f880
child 1600 305e13c5f327
equal deleted inserted replaced
1591:1db9b654f880 1592:5ee77ee470a6
   138   RawSendNet(str.toUtf8());
   138   RawSendNet(str.toUtf8());
   139 }
   139 }
   140 
   140 
   141 void HWNewNet::RawSendNet(const QByteArray & buf)
   141 void HWNewNet::RawSendNet(const QByteArray & buf)
   142 {
   142 {
   143 	//qDebug() << "Client: " << QString(buf).split("\n");
   143 	qDebug() << "Client: " << QString(buf).split("\n");
   144 	NetSocket.write(buf);
   144 	NetSocket.write(buf);
   145 	NetSocket.write("\n\n", 2);
   145 	NetSocket.write("\n\n", 2);
   146 }
   146 }
   147 
   147 
   148 void HWNewNet::ClientRead()
   148 void HWNewNet::ClientRead()
   330 			emit FromNet(em);
   330 			emit FromNet(em);
   331 		}
   331 		}
   332 		return;
   332 		return;
   333 	}
   333 	}
   334 
   334 
       
   335 	if(lst[0]=="ROOMABANDONED") {
       
   336 		netClientState = 2;
       
   337 		emit LeftRoom();
       
   338 		return;
       
   339 	}
       
   340 
   335 	if(lst[0]=="JOINED") {
   341 	if(lst[0]=="JOINED") {
   336 		if(lst.size() < 2)
   342 		if(lst.size() < 2)
   337 		{
   343 		{
   338 			qWarning("Net: Bad JOINED message");
   344 			qWarning("Net: Bad JOINED message");
   339 			return;
   345 			return;
   685 
   691 
   686 void HWNewNet::toggleRestrictTeamAdds()
   692 void HWNewNet::toggleRestrictTeamAdds()
   687 {
   693 {
   688 	RawSendNet(QString("TOGGLE_RESTRICT_TEAMS"));
   694 	RawSendNet(QString("TOGGLE_RESTRICT_TEAMS"));
   689 }
   695 }
       
   696 
       
   697 void HWNewNet::partRoom()
       
   698 {
       
   699 	netClientState = 2;
       
   700 	RawSendNet(QString("PART"));
       
   701 }