- Frontend: don't reset playing teams list after end of round
authorunc0rr
Thu, 16 Oct 2008 19:48:11 +0000
changeset 1368 a734715a777a
parent 1367 e1aaa1a4901f
child 1369 f5b1b3fd70cc
- Frontend: don't reset playing teams list after end of round - Server: same + don't allow team adding while round in progress
QTfrontend/hwform.cpp
netserver/HWProto.hs
--- a/QTfrontend/hwform.cpp	Thu Oct 16 16:57:51 2008 +0000
+++ b/QTfrontend/hwform.cpp	Thu Oct 16 19:48:11 2008 +0000
@@ -278,7 +278,7 @@
 		  if (editedTeam) {
 		    curTeamSelWidget->addTeam(*editedTeam);
 		  }
-		} else {
+		} else if(lastid != ID_PAGE_GAMESTATS && lastid != ID_PAGE_INGAME) {
 		  curTeamSelWidget->resetPlayingTeams(teamsList);
 		}
 	}
--- a/netserver/HWProto.hs	Thu Oct 16 16:57:51 2008 +0000
+++ b/netserver/HWProto.hs	Thu Oct 16 19:48:11 2008 +0000
@@ -34,7 +34,7 @@
 	where
 		toAnswer (paramName, paramStrs) =
 			(clientOnly, "CONFIG_PARAM" : paramName : paramStrs)
-answerCantAdd = [(clientOnly, ["WARNING", "Too many teams or hedgehogs, or same name team"])]
+answerCantAdd = [(clientOnly, ["WARNING", "Too many teams or hedgehogs, or same name team, or round in progress"])]
 answerTeamAccepted team = [(clientOnly, ["TEAM_ACCEPTED", teamname team])]
 answerAddTeam team = [(othersInRoom, teamToNet team)]
 answerHHNum teamName hhNumber = [(othersInRoom, ["HH_NUM", teamName, show hhNumber])]
@@ -157,7 +157,7 @@
 
 handleCmd_inRoom client _ rooms ("ADD_TEAM" : name : color : grave : fort : difStr : hhsInfo)
 	| length hhsInfo == 16 =
-	if length (teams clRoom) == 6 || canAddNumber <= 0 || isJust findTeam then
+	if length (teams clRoom) == 6 || canAddNumber <= 0 || isJust findTeam || gameinprogress clRoom then
 		(noChangeClients, noChangeRooms, answerCantAdd)
 	else
 		(noChangeClients, modifyRoom clRoom{teams = teams clRoom ++ [newTeam]}, answerTeamAccepted newTeam ++ answerAddTeam newTeam ++ answerTeamColor name color)
@@ -222,7 +222,7 @@
 
 handleCmd_inRoom client _ rooms ["ROUNDFINISHED"] =
 	if isMaster client then
-		(noChangeClients, modifyRoom clRoom{teams = [], gameinprogress = False}, [])
+		(noChangeClients, modifyRoom clRoom{gameinprogress = False}, [])
 	else
 		(noChangeClients, noChangeRooms, [])
 	where