QTfrontend/newnetclient.cpp
changeset 1305 453882eb4467
parent 1302 4290ba4a14ca
child 1307 ce26e16d18ab
equal deleted inserted replaced
1304:05cebf68ebd8 1305:453882eb4467
   161 		}
   161 		}
   162 }
   162 }
   163 
   163 
   164 void HWNewNet::ParseCmd(const QStringList & lst)
   164 void HWNewNet::ParseCmd(const QStringList & lst)
   165 {
   165 {
   166   qDebug() << "Server: " << lst;
   166 	qDebug() << "Server: " << lst;
   167 
   167 
   168   if(!lst.size())
   168 	if(!lst.size())
   169   {
   169 	{
   170     qWarning("Net client: Bad message");
   170 		qWarning("Net client: Bad message");
   171     return;
   171 		return;
   172   }
   172 	}
   173 
   173 
   174   if (lst[0] == "ERRONEUSNICKNAME") {
   174 	if (lst[0] == "ERROR") {
   175     QMessageBox::information(0, 0, "Your net nickname is in use or cannot be used");
   175 		if (lst.size() == 2)
   176     return;
   176 			QMessageBox::information(0, 0, lst[1]);
   177   }
   177 		else
       
   178 			QMessageBox::information(0, 0, "Unknown error");
       
   179 		return;
       
   180 	}
   178 
   181 
   179   if (lst[0] == "CONNECTED") {
   182   if (lst[0] == "CONNECTED") {
   180     m_game_connected=true;
   183     m_game_connected=true;
   181     emit Connected();
   184     emit Connected();
   182     emit EnteredGame();
   185     emit EnteredGame();