27 sameProtoRooms = filter (\r -> (roomProto r == protocol) && not (isRestrictedJoins r)) roomsList |
28 sameProtoRooms = filter (\r -> (roomProto r == protocol) && not (isRestrictedJoins r)) roomsList |
28 roomsList = IntMap.elems rooms |
29 roomsList = IntMap.elems rooms |
29 protocol = clientProto client |
30 protocol = clientProto client |
30 client = clients IntMap.! clID |
31 client = clients IntMap.! clID |
31 roomInfo room |
32 roomInfo room |
32 | clientProto client < 28 = [ |
33 | clientProto client < 30 = [ |
33 name room, |
34 name room, |
34 show (playersIn room) ++ "(" ++ show (length $ teams room) ++ ")", |
35 show (playersIn room) ++ "(" ++ show (length $ teams room) ++ ")", |
35 show $ gameinprogress room |
36 show $ gameinprogress room |
36 ] |
37 ] |
37 | otherwise = [ |
38 | otherwise = [ |
150 BanClient banNick : handleCmd_lobby clID clients rooms ["KICK", banNick] |
151 BanClient banNick : handleCmd_lobby clID clients rooms ["KICK", banNick] |
151 where |
152 where |
152 client = clients IntMap.! clID |
153 client = clients IntMap.! clID |
153 |
154 |
154 |
155 |
155 handleCmd_lobby clID clients rooms ["SET_SERVER_MESSAGE", newMessage] = |
156 handleCmd_lobby clID clients rooms ["SET_SERVER_MESSAGE", "NEW", newMessage] = |
156 [ModifyServerInfo (\si -> si{serverMessage = newMessage}) | isAdministrator client] |
157 [ModifyServerInfo (\si -> si{serverMessage = newMessage}) | isAdministrator client] |
157 where |
158 where |
158 client = clients IntMap.! clID |
159 client = clients IntMap.! clID |
159 |
160 |
|
161 handleCmd_lobby clID clients rooms ["SET_SERVER_MESSAGE", "OLD", newMessage] = |
|
162 [ModifyServerInfo (\si -> si{serverMessageForOldVersions = newMessage}) | isAdministrator client] |
|
163 where |
|
164 client = clients IntMap.! clID |
|
165 |
|
166 handleCmd_lobby clID clients rooms ["SET_RELEASE_PROTOCOL_NUMBER", protoNum] = |
|
167 [ModifyServerInfo (\si -> si{latestReleaseVersion = fromJust readNum}) | isAdministrator client && isJust readNum] |
|
168 where |
|
169 client = clients IntMap.! clID |
|
170 readNum = maybeRead protoNum :: Maybe Word16 |
160 |
171 |
161 handleCmd_lobby clID clients rooms ["CLEAR_ACCOUNTS_CACHE"] = |
172 handleCmd_lobby clID clients rooms ["CLEAR_ACCOUNTS_CACHE"] = |
162 [ClearAccountsCache | isAdministrator client] |
173 [ClearAccountsCache | isAdministrator client] |
163 where |
174 where |
164 client = clients IntMap.! clID |
175 client = clients IntMap.! clID |