124 } |
124 } |
125 |
125 |
126 data ClientInfo = |
126 data ClientInfo = |
127 ClientInfo |
127 ClientInfo |
128 { |
128 { |
129 clUID :: Unique, |
129 clUID :: !Unique, |
130 sendChan :: ClientChan, |
130 sendChan :: !ClientChan, |
131 clientSocket :: Socket, |
131 clientSocket :: !Socket, |
132 host :: B.ByteString, |
132 host :: !B.ByteString, |
133 connectTime :: UTCTime, |
133 connectTime :: !UTCTime, |
134 nick :: B.ByteString, |
134 nick :: !B.ByteString, |
135 webPassword :: B.ByteString, |
135 webPassword :: !B.ByteString, |
136 serverSalt :: B.ByteString, |
136 serverSalt :: !B.ByteString, |
137 logonPassed :: Bool, |
137 logonPassed :: !Bool, |
138 isVisible :: Bool, |
138 isVisible :: !Bool, |
139 clientProto :: !Word16, |
139 clientProto :: !Word16, |
140 pingsQueue :: !Word, |
140 pingsQueue :: !Word, |
141 isMaster :: Bool, |
141 isMaster :: !Bool, |
142 isReady :: !Bool, |
142 isReady :: !Bool, |
143 isInGame :: Bool, |
143 isInGame :: !Bool, |
144 isAdministrator :: Bool, |
144 isAdministrator :: !Bool, |
145 isChecker :: Bool, |
145 isChecker :: !Bool, |
146 isContributor :: Bool, |
146 isContributor :: !Bool, |
147 isKickedFromServer :: Bool, |
147 isKickedFromServer :: !Bool, |
148 isJoinedMidGame :: Bool, |
148 isJoinedMidGame :: !Bool, |
|
149 hasAskedList :: !Bool, |
149 clientClan :: !(Maybe B.ByteString), |
150 clientClan :: !(Maybe B.ByteString), |
150 checkInfo :: Maybe CheckInfo, |
151 checkInfo :: !(Maybe CheckInfo), |
151 eiLobbyChat, |
152 eiLobbyChat, |
152 eiEM, |
153 eiEM, |
153 eiJoin :: EventsInfo, |
154 eiJoin :: !EventsInfo, |
154 teamsInGame :: Word |
155 teamsInGame :: !Word |
155 } |
156 } |
156 |
157 |
157 instance Eq ClientInfo where |
158 instance Eq ClientInfo where |
158 (==) = (==) `on` clientSocket |
159 (==) = (==) `on` clientSocket |
159 |
160 |
162 deriving (Show, Read) |
163 deriving (Show, Read) |
163 |
164 |
164 data TeamInfo = |
165 data TeamInfo = |
165 TeamInfo |
166 TeamInfo |
166 { |
167 { |
167 teamowner :: B.ByteString, |
168 teamowner :: !B.ByteString, |
168 teamname :: B.ByteString, |
169 teamname :: !B.ByteString, |
169 teamcolor :: B.ByteString, |
170 teamcolor :: !B.ByteString, |
170 teamgrave :: B.ByteString, |
171 teamgrave :: !B.ByteString, |
171 teamfort :: B.ByteString, |
172 teamfort :: !B.ByteString, |
172 teamvoicepack :: B.ByteString, |
173 teamvoicepack :: !B.ByteString, |
173 teamflag :: B.ByteString, |
174 teamflag :: !B.ByteString, |
174 isOwnerRegistered :: Bool, |
175 isOwnerRegistered :: !Bool, |
175 difficulty :: Int, |
176 difficulty :: !Int, |
176 hhnum :: Int, |
177 hhnum :: !Int, |
177 hedgehogs :: [HedgehogInfo] |
178 hedgehogs :: ![HedgehogInfo] |
178 } |
179 } |
179 deriving (Show, Read) |
180 deriving (Show, Read) |
180 |
181 |
181 instance Eq TeamInfo where |
182 instance Eq TeamInfo where |
182 (==) = (==) `on` teamname |
183 (==) = (==) `on` teamname |
212 |
213 |
213 |
214 |
214 data RoomInfo = |
215 data RoomInfo = |
215 RoomInfo |
216 RoomInfo |
216 { |
217 { |
217 masterID :: Maybe ClientIndex, |
218 masterID :: !(Maybe ClientIndex), |
218 name :: B.ByteString, |
219 name :: !B.ByteString, |
219 password :: B.ByteString, |
220 password :: !B.ByteString, |
220 roomProto :: Word16, |
221 roomProto :: !Word16, |
221 teams :: [TeamInfo], |
222 teams :: ![TeamInfo], |
222 gameInfo :: Maybe GameInfo, |
223 gameInfo :: !(Maybe GameInfo), |
223 playersIn :: !Int, |
224 playersIn :: !Int, |
224 readyPlayers :: !Int, |
225 readyPlayers :: !Int, |
225 isRestrictedJoins :: Bool, |
226 isRestrictedJoins :: !Bool, |
226 isRestrictedTeams :: Bool, |
227 isRestrictedTeams :: !Bool, |
227 isRegisteredOnly :: Bool, |
228 isRegisteredOnly :: !Bool, |
228 isSpecial :: Bool, |
229 isSpecial :: !Bool, |
229 defaultHedgehogsNumber :: Int, |
230 defaultHedgehogsNumber :: !Int, |
230 teamsNumberLimit :: Int, |
231 teamsNumberLimit :: !Int, |
231 greeting :: B.ByteString, |
232 greeting :: !B.ByteString, |
232 voting :: Maybe Voting, |
233 voting :: !(Maybe Voting), |
233 roomBansList :: ![B.ByteString], |
234 roomBansList :: ![B.ByteString], |
234 mapParams :: Map.Map B.ByteString B.ByteString, |
235 mapParams :: !(Map.Map B.ByteString B.ByteString), |
235 params :: Map.Map B.ByteString [B.ByteString], |
236 params :: !(Map.Map B.ByteString [B.ByteString]), |
236 roomSaves :: Map.Map B.ByteString (Map.Map B.ByteString B.ByteString, Map.Map B.ByteString [B.ByteString]) |
237 roomSaves :: !(Map.Map B.ByteString (Map.Map B.ByteString B.ByteString, Map.Map B.ByteString [B.ByteString])) |
237 } |
238 } |
238 |
239 |
239 newRoom :: RoomInfo |
240 newRoom :: RoomInfo |
240 newRoom = |
241 newRoom = |
241 RoomInfo |
242 RoomInfo |