# HG changeset patch # User unc0rr # Date 1365619694 -14400 # Node ID d6c310c65c915a988545cf5a3c528b9c4c51782d # Parent 95177c18e38c0e122d143a77c6519dcfcbd9f90f - Revert server workaround over desync from r98e2dbdda8c0 - Don't allow more than 48 hedgehogs diff -r 95177c18e38c -r d6c310c65c91 gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Wed Apr 10 07:44:51 2013 +0300 +++ b/gameServer/CoreTypes.hs Wed Apr 10 22:48:14 2013 +0400 @@ -108,8 +108,7 @@ isKickedFromServer :: Bool, clientClan :: !(Maybe B.ByteString), checkInfo :: Maybe CheckInfo, - teamsInGame :: Word, - actionsPending :: [Action] + teamsInGame :: Word } instance Eq ClientInfo where diff -r 95177c18e38c -r d6c310c65c91 gameServer/HWProtoCore.hs --- a/gameServer/HWProtoCore.hs Wed Apr 10 07:44:51 2013 +0300 +++ b/gameServer/HWProtoCore.hs Wed Apr 10 22:48:14 2013 +0400 @@ -30,7 +30,7 @@ handleCmd ["PONG"] = do cl <- thisClient if pingsQueue cl == 0 then - return $ actionsPending cl ++ [ModifyClient (\c -> c{actionsPending = []})] + return [ProtocolError "Protocol violation"] else return [ModifyClient (\c -> c{pingsQueue = pingsQueue c - 1})] diff -r 95177c18e38c -r d6c310c65c91 gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Wed Apr 10 07:44:51 2013 +0300 +++ b/gameServer/HWProtoInRoomState.hs Wed Apr 10 22:48:14 2013 +0400 @@ -59,7 +59,7 @@ else liftM (head . (L.\\) (map B.singleton ['0'..]) . map teamcolor . teams) thisRoom let roomTeams = teams rm - let hhNum = let p = if not $ null roomTeams then hhnum $ head roomTeams else 4 in newTeamHHNum roomTeams p + let hhNum = let p = if not $ null roomTeams then minimum [hhnum $ head roomTeams, canAddNumber roomTeams] else 4 in newTeamHHNum roomTeams p let newTeam = clNick `seq` TeamInfo ci clNick tName teamColor grave fort voicepack flag dif hhNum (hhsList hhsInfo) return $ if not . null . drop (maxTeams rm - 1) $ roomTeams then @@ -79,9 +79,7 @@ AnswerClients clChan ["TEAM_ACCEPTED", tName], AnswerClients othChans $ teamToNet $ newTeam, AnswerClients roomChans ["TEAM_COLOR", tName, teamColor], - ModifyClient $ \c -> c{actionsPending = actionsPending cl - ++ [AnswerClients clChan ["HH_NUM", tName, showB $ hhnum newTeam]] - }, + AnswerClients roomChans ["HH_NUM", tName, showB $ hhnum newTeam], AnswerClients [sendChan cl] ["PING"] ] where diff -r 95177c18e38c -r d6c310c65c91 gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Wed Apr 10 07:44:51 2013 +0300 +++ b/gameServer/HWProtoLobbyState.hs Wed Apr 10 22:48:14 2013 +0400 @@ -92,12 +92,9 @@ , AnswerClients [sendChan cl] $ ["CLIENT_FLAGS", "+h", ownerNick] ] ++ (if clientProto cl < 38 then map (readynessMessage cl) jRoomClients else [sendStateFlags cl jRoomClients]) - ++ [AnswerClients [sendChan cl] ["PING"] - , ModifyClient $ \c -> c{actionsPending = actionsPending cl - ++ answerFullConfig cl (mapParams jRoom) (params jRoom) - ++ answerTeams cl jRoom - ++ watchRound cl jRoom chans} - ] + ++ answerFullConfig cl (mapParams jRoom) (params jRoom) + ++ answerTeams cl jRoom + ++ watchRound cl jRoom chans where readynessMessage cl c = AnswerClients [sendChan cl] [if isReady c then "READY" else "NOT_READY", nick c] diff -r 95177c18e38c -r d6c310c65c91 gameServer/NetRoutines.hs --- a/gameServer/NetRoutines.hs Wed Apr 10 07:44:51 2013 +0300 +++ b/gameServer/NetRoutines.hs Wed Apr 10 22:48:14 2013 +0400 @@ -47,7 +47,6 @@ Nothing Nothing 0 - [] ) writeChan chan $ Accept newClient