# HG changeset patch # User unc0rr # Date 1352226908 -14400 # Node ID 53b1da5ee7f4ec43c71521560c9f57def9f7787e # Parent 619a399bece81ba86b3e92137a56f7b13ce6d1d1 Maybe this caused server crashes? Add more strictness on team owner record field diff -r 619a399bece8 -r 53b1da5ee7f4 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"