QTfrontend/newnetclient.cpp
changeset 1245 d2eca4a053f5
parent 1189 f66cdbbfc4b6
child 1302 4290ba4a14ca
--- a/QTfrontend/newnetclient.cpp	Sun Aug 31 18:36:26 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Sun Aug 31 19:23:29 2008 +0000
@@ -67,15 +67,21 @@
 
 void HWNewNet::AddTeam(const HWTeam & team)
 {
-  RawSendNet(QString("ADDTEAM:") + delimeter +
+	QString cmd = QString("ADDTEAM:") + delimeter +
 	     team.TeamName + delimeter +
 	     team.teamColor.name() + delimeter +
 	     team.Grave + delimeter +
 	     team.Fort + delimeter +
-	     QString::number(team.difficulty) + delimeter +
-	     team.HHName[0] + delimeter + team.HHName[1] + delimeter +
-	     team.HHName[2] + delimeter + team.HHName[3] + delimeter + team.HHName[4] + delimeter +
-	     team.HHName[5] + delimeter + team.HHName[6] + delimeter + team.HHName[7]);
+	     QString::number(team.difficulty);
+
+	for(int i = 0; i < 8; ++i)
+	{
+		cmd.append(delimeter);
+		cmd.append(team.HHName[i]);
+		cmd.append(delimeter);
+		cmd.append(team.HHHat[i]);
+	}
+	RawSendNet(cmd);
 }
 
 void HWNewNet::RemoveTeam(const HWTeam & team)
@@ -190,7 +196,7 @@
   }
 
   if (lst[0] == "ADDTEAM:") {
-    if(lst.size() < 14)
+    if(lst.size() < 22)
     {
 	  qWarning("Net: Too short ADDTEAM message");
 	  return;