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 } |
|
74 |
|
75 newGameInfo :: Bool -> GameInfo |
|
76 newGameInfo = |
|
77 GameInfo |
|
78 Data.Sequence.empty |
|
79 [] |
|
80 [] |
65 |
81 |
66 data RoomInfo = |
82 data RoomInfo = |
67 RoomInfo |
83 RoomInfo |
68 { |
84 { |
69 masterID :: ClientIndex, |
85 masterID :: ClientIndex, |
70 name :: B.ByteString, |
86 name :: B.ByteString, |
71 password :: B.ByteString, |
87 password :: B.ByteString, |
72 roomProto :: Word16, |
88 roomProto :: Word16, |
73 teams :: [TeamInfo], |
89 teams :: [TeamInfo], |
74 gameinprogress :: Bool, |
90 gameInfo :: Maybe GameInfo, |
75 playersIn :: !Int, |
91 playersIn :: !Int, |
76 readyPlayers :: !Int, |
92 readyPlayers :: !Int, |
77 isRestrictedJoins :: Bool, |
93 isRestrictedJoins :: Bool, |
78 isRestrictedTeams :: Bool, |
94 isRestrictedTeams :: Bool, |
79 roundMsgs :: Seq B.ByteString, |
|
80 leftTeams :: [B.ByteString], |
|
81 teamsAtStart :: [TeamInfo], |
|
82 mapParams :: Map.Map B.ByteString B.ByteString, |
95 mapParams :: Map.Map B.ByteString B.ByteString, |
83 params :: Map.Map B.ByteString [B.ByteString] |
96 params :: Map.Map B.ByteString [B.ByteString] |
84 } |
97 } |
85 |
98 |
86 newRoom :: RoomInfo |
99 newRoom :: RoomInfo |
89 (error "No room master defined") |
102 (error "No room master defined") |
90 "" |
103 "" |
91 "" |
104 "" |
92 0 |
105 0 |
93 [] |
106 [] |
94 False |
107 Nothing |
95 0 |
108 0 |
96 0 |
109 0 |
97 False |
110 False |
98 False |
111 False |
99 Data.Sequence.empty |
|
100 [] |
|
101 [] |
|
102 ( |
112 ( |
103 Map.fromList $ Prelude.zipWith (,) |
113 Map.fromList $ Prelude.zipWith (,) |
104 ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"] |
114 ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"] |
105 ["+rnd+", "0", "0", "seed", "0"] |
115 ["+rnd+", "0", "0", "seed", "0"] |
106 ) |
116 ) |