QTfrontend/newnetclient.cpp
changeset 1245 d2eca4a053f5
parent 1189 f66cdbbfc4b6
child 1302 4290ba4a14ca
equal deleted inserted replaced
1244:87b3931c70e9 1245:d2eca4a053f5
    65 	RawSendNet(QString("JOIN%1%2").arg(delimeter).arg(room));
    65 	RawSendNet(QString("JOIN%1%2").arg(delimeter).arg(room));
    66 }
    66 }
    67 
    67 
    68 void HWNewNet::AddTeam(const HWTeam & team)
    68 void HWNewNet::AddTeam(const HWTeam & team)
    69 {
    69 {
    70   RawSendNet(QString("ADDTEAM:") + delimeter +
    70 	QString cmd = QString("ADDTEAM:") + delimeter +
    71 	     team.TeamName + delimeter +
    71 	     team.TeamName + delimeter +
    72 	     team.teamColor.name() + delimeter +
    72 	     team.teamColor.name() + delimeter +
    73 	     team.Grave + delimeter +
    73 	     team.Grave + delimeter +
    74 	     team.Fort + delimeter +
    74 	     team.Fort + delimeter +
    75 	     QString::number(team.difficulty) + delimeter +
    75 	     QString::number(team.difficulty);
    76 	     team.HHName[0] + delimeter + team.HHName[1] + delimeter +
    76 
    77 	     team.HHName[2] + delimeter + team.HHName[3] + delimeter + team.HHName[4] + delimeter +
    77 	for(int i = 0; i < 8; ++i)
    78 	     team.HHName[5] + delimeter + team.HHName[6] + delimeter + team.HHName[7]);
    78 	{
       
    79 		cmd.append(delimeter);
       
    80 		cmd.append(team.HHName[i]);
       
    81 		cmd.append(delimeter);
       
    82 		cmd.append(team.HHHat[i]);
       
    83 	}
       
    84 	RawSendNet(cmd);
    79 }
    85 }
    80 
    86 
    81 void HWNewNet::RemoveTeam(const HWTeam & team)
    87 void HWNewNet::RemoveTeam(const HWTeam & team)
    82 {
    88 {
    83   RawSendNet(QString("REMOVETEAM:") + delimeter + team.TeamName);
    89   RawSendNet(QString("REMOVETEAM:") + delimeter + team.TeamName);
   188     emit chatStringFromNet(tmp);
   194     emit chatStringFromNet(tmp);
   189     return;
   195     return;
   190   }
   196   }
   191 
   197 
   192   if (lst[0] == "ADDTEAM:") {
   198   if (lst[0] == "ADDTEAM:") {
   193     if(lst.size() < 14)
   199     if(lst.size() < 22)
   194     {
   200     {
   195 	  qWarning("Net: Too short ADDTEAM message");
   201 	  qWarning("Net: Too short ADDTEAM message");
   196 	  return;
   202 	  return;
   197     }
   203     }
   198     QStringList tmp = lst;
   204     QStringList tmp = lst;