Maybe this caused server crashes? Add more strictness on team owner record field
authorunc0rr
Tue, 06 Nov 2012 22:35:08 +0400
changeset 7986 53b1da5ee7f4
parent 7984 619a399bece8
child 7988 4b428183d946
Maybe this caused server crashes? Add more strictness on team owner record field
gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Tue Nov 06 11:01:18 2012 -0500
+++ b/gameServer/HWProtoInRoomState.hs	Tue Nov 06 22:35:08 2012 +0400
@@ -59,6 +59,7 @@
                 return color
                 else
                 liftM (head . (L.\\) (map B.singleton ['0'..]) . map teamcolor . teams) thisRoom
+        let newTeam = clNick `seq` TeamInfo ci clNick tName teamColor grave fort voicepack flag dif (newTeamHHNum rm) (hhsList hhsInfo)
         return $
             if not . null . drop (maxTeams rm - 1) $ teams rm then
                 [Warning "too many teams"]
@@ -71,17 +72,16 @@
             else if isRestrictedTeams rm then
                 [Warning "restricted"]
             else
-                [ModifyRoom (\r -> r{teams = teams r ++ [newTeam ci clNick r teamColor]}),
+                [ModifyRoom (\r -> r{teams = teams r ++ [newTeam]}),
                 SendUpdateOnThisRoom,
                 ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = Just teamColor}),
                 AnswerClients clChan ["TEAM_ACCEPTED", tName],
-                AnswerClients othChans $ teamToNet $ newTeam ci clNick rm teamColor,
+                AnswerClients othChans $ teamToNet $ newTeam,
                 AnswerClients roomChans ["TEAM_COLOR", tName, teamColor]
                 ]
         where
         canAddNumber r = 48 - (sum . map hhnum $ teams r)
         findTeam = find (\t -> tName == teamname t) . teams
-        newTeam ci clNick r tColor = TeamInfo ci clNick tName tColor grave fort voicepack flag dif (newTeamHHNum r) (hhsList hhsInfo)
         dif = readInt_ difStr
         hhsList [] = []
         hhsList [_] = error "Hedgehogs list with odd elements number"