gameServer/HWProtoLobbyState.hs
changeset 2408 41ebdb5f1e6e
parent 2352 7eaf82cf0890
child 2867 9be6693c78cb
equal deleted inserted replaced
2407:9f413bd5150e 2408:41ebdb5f1e6e
    26 		roomsInfoList = concatMap roomInfo sameProtoRooms
    26 		roomsInfoList = concatMap roomInfo sameProtoRooms
    27 		sameProtoRooms = filter (\r -> (roomProto r == protocol) && not (isRestrictedJoins r)) roomsList
    27 		sameProtoRooms = filter (\r -> (roomProto r == protocol) && not (isRestrictedJoins r)) roomsList
    28 		roomsList = IntMap.elems rooms
    28 		roomsList = IntMap.elems rooms
    29 		protocol = clientProto client
    29 		protocol = clientProto client
    30 		client = clients IntMap.! clID
    30 		client = clients IntMap.! clID
    31 		roomInfo room = [
    31 		roomInfo room
       
    32 			| clientProto client < 28 = [
    32 				name room,
    33 				name room,
    33 				show (playersIn room) ++ "(" ++ show (length $ teams room) ++ ")",
    34 				show (playersIn room) ++ "(" ++ show (length $ teams room) ++ ")",
    34 				show $ gameinprogress room
    35 				show $ gameinprogress room
    35 				]
    36 				]
    36 
    37 			| otherwise = [
       
    38 				show $ gameinprogress room,
       
    39 				name room,
       
    40 				show $ playersIn room,
       
    41 				show $ length $ teams room,
       
    42 				nick $ clients IntMap.! (masterID room),
       
    43 				head (Map.findWithDefault ["+gen+"] "MAP" (params room)),
       
    44 				head (Map.findWithDefault ["Default"] "SCHEME" (params room)),
       
    45 				head (Map.findWithDefault ["Default"] "AMMO" (params room))
       
    46 				]
    37 
    47 
    38 handleCmd_lobby clID clients _ ["CHAT", msg] =
    48 handleCmd_lobby clID clients _ ["CHAT", msg] =
    39 	[AnswerOthersInRoom ["CHAT", clientNick, msg]]
    49 	[AnswerOthersInRoom ["CHAT", clientNick, msg]]
    40 	where
    50 	where
    41 		clientNick = nick $ clients IntMap.! clID
    51 		clientNick = nick $ clients IntMap.! clID