# HG changeset patch # User unc0rr # Date 1357844095 -14400 # Node ID 31033e5216535c6a8a4efc199a3913a23d190341 # Parent 6feae80739659146bc98ba1a2198cc5eb5d550bb Throw away stupid Data.Seq diff -r 6feae8073965 -r 31033e521653 gameServer/Actions.hs --- a/gameServer/Actions.hs Wed Jan 09 10:16:10 2013 +0400 +++ b/gameServer/Actions.hs Thu Jan 10 22:54:55 2013 +0400 @@ -4,7 +4,6 @@ import Control.Concurrent import qualified Data.Set as Set -import qualified Data.Sequence as Seq import qualified Data.List as L import qualified Control.Exception as Exception import System.Log.Logger @@ -374,7 +373,7 @@ ModifyRoom (\r -> r{ gameInfo = liftM (\g -> g{ teamsInGameNumber = teamsInGameNumber g - 1 - , roundMsgs = roundMsgs g Seq.|> rmTeamMsg + , roundMsgs = rmTeamMsg : roundMsgs g }) $ gameInfo r }) ] diff -r 6feae8073965 -r 31033e521653 gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Wed Jan 09 10:16:10 2013 +0400 +++ b/gameServer/CoreTypes.hs Thu Jan 10 22:54:55 2013 +0400 @@ -4,7 +4,6 @@ import Control.Concurrent import Data.Word import qualified Data.Map as Map -import Data.Sequence(Seq, empty) import Data.Time import Network import Data.Function @@ -68,7 +67,7 @@ data GameInfo = GameInfo { - roundMsgs :: Seq B.ByteString, + roundMsgs :: [B.ByteString], leftTeams :: [B.ByteString], teamsAtStart :: [TeamInfo], teamsInGameNumber :: Int, @@ -85,7 +84,7 @@ -> GameInfo newGameInfo = GameInfo - Data.Sequence.empty + [] [] data RoomInfo = diff -r 6feae8073965 -r 31033e521653 gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Wed Jan 09 10:16:10 2013 +0400 +++ b/gameServer/HWProtoInRoomState.hs Thu Jan 10 22:54:55 2013 +0400 @@ -2,13 +2,11 @@ module HWProtoInRoomState where import qualified Data.Map as Map -import Data.Sequence((|>)) import Data.List as L import Data.Maybe import qualified Data.ByteString.Char8 as B import Control.Monad import Control.Monad.Reader -import Control.DeepSeq -------------------------------------- import CoreTypes import Actions @@ -214,7 +212,8 @@ chans <- roomOthersChans if teamsInGame cl > 0 && (isJust $ gameInfo rm) && isLegal then - return $ AnswerClients chans ["EM", msg] : [ModifyRoom (\r -> r{gameInfo = liftM (\g -> g{roundMsgs = roundMsgs g |> msg}) $ gameInfo r}) | not isKeepAlive] + return $ AnswerClients chans ["EM", msg] + : [ModifyRoom (\r -> r{gameInfo = liftM (\g -> g{roundMsgs = msg : roundMsgs g}) $ gameInfo r}) | not isKeepAlive] else return [] where diff -r 6feae8073965 -r 31033e521653 gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Wed Jan 09 10:16:10 2013 +0400 +++ b/gameServer/HWProtoLobbyState.hs Thu Jan 10 22:54:55 2013 +0400 @@ -2,11 +2,9 @@ module HWProtoLobbyState where import qualified Data.Map as Map -import qualified Data.Foldable as Foldable import Data.Maybe import Data.List import Control.Monad.Reader -import qualified Data.ByteString.Char8 as B -------------------------------------- import CoreTypes import Actions @@ -128,7 +126,7 @@ [AnswerClients [sendChan cl] ["RUN_GAME"] , AnswerClients chans ["CLIENT_FLAGS", "+g", nick cl] , ModifyClient (\c -> c{isInGame = True}) - , AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : Foldable.toList (roundMsgs . fromJust . gameInfo $ jRoom)] + , AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : (reverse . roundMsgs . fromJust . gameInfo $ jRoom)] handleCmd_lobby ["JOIN_ROOM", roomName] =