gameServer/CoreTypes.hs
changeset 6101 5a4ea2c7b9df
parent 6069 d59745e525ec
child 6403 477034740077
equal deleted inserted replaced
5801:531f64292489 6101:5a4ea2c7b9df
    60         difficulty :: Int,
    60         difficulty :: Int,
    61         hhnum :: Int,
    61         hhnum :: Int,
    62         hedgehogs :: [HedgehogInfo]
    62         hedgehogs :: [HedgehogInfo]
    63     }
    63     }
    64     deriving (Show, Read)
    64     deriving (Show, Read)
       
    65     
       
    66 data GameInfo =
       
    67     GameInfo
       
    68     {
       
    69         roundMsgs :: Seq B.ByteString,
       
    70         leftTeams :: [B.ByteString],
       
    71         teamsAtStart :: [TeamInfo],
       
    72         allPlayersHaveRegisteredAccounts :: Bool,
       
    73         giMapParams :: Map.Map B.ByteString B.ByteString,
       
    74         giParams :: Map.Map B.ByteString [B.ByteString]
       
    75     } deriving (Show, Read)
       
    76     
       
    77 --newGameInfo ::  -> GameInfo 
       
    78 newGameInfo = 
       
    79     GameInfo
       
    80         Data.Sequence.empty
       
    81         []
       
    82         []
    65 
    83 
    66 data RoomInfo =
    84 data RoomInfo =
    67     RoomInfo
    85     RoomInfo
    68     {
    86     {
    69         masterID :: ClientIndex,
    87         masterID :: ClientIndex,
    70         name :: B.ByteString,
    88         name :: B.ByteString,
    71         password :: B.ByteString,
    89         password :: B.ByteString,
    72         roomProto :: Word16,
    90         roomProto :: Word16,
    73         teams :: [TeamInfo],
    91         teams :: [TeamInfo],
    74         gameinprogress :: Bool,
    92         gameInfo :: Maybe GameInfo,
    75         playersIn :: !Int,
    93         playersIn :: !Int,
    76         readyPlayers :: !Int,
    94         readyPlayers :: !Int,
    77         isRestrictedJoins :: Bool,
    95         isRestrictedJoins :: Bool,
    78         isRestrictedTeams :: Bool,
    96         isRestrictedTeams :: Bool,
    79         roundMsgs :: Seq B.ByteString,
       
    80         leftTeams :: [B.ByteString],
       
    81         teamsAtStart :: [TeamInfo],
       
    82         mapParams :: Map.Map B.ByteString B.ByteString,
    97         mapParams :: Map.Map B.ByteString B.ByteString,
    83         params :: Map.Map B.ByteString [B.ByteString]
    98         params :: Map.Map B.ByteString [B.ByteString]
    84     }
    99     }
    85 
   100 
    86 newRoom :: RoomInfo
   101 newRoom :: RoomInfo
    89         (error "No room master defined")
   104         (error "No room master defined")
    90         ""
   105         ""
    91         ""
   106         ""
    92         0
   107         0
    93         []
   108         []
    94         False
   109         Nothing
    95         0
   110         0
    96         0
   111         0
    97         False
   112         False
    98         False
   113         False
    99         Data.Sequence.empty
       
   100         []
       
   101         []
       
   102         (
   114         (
   103             Map.fromList $ Prelude.zipWith (,)
   115             Map.fromList $ Prelude.zipWith (,)
   104                 ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
   116                 ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
   105                 ["+rnd+", "0", "0", "seed", "0"]
   117                 ["+rnd+", "0", "0", "seed", "0"]
   106         )
   118         )