gameServer/HWProtoLobbyState.hs
changeset 15878 fc3cb23fd26f
parent 14381 32e8c81ca35c
child 15983 2c92499daa67
equal deleted inserted replaced
15877:6cb7330113d8 15878:fc3cb23fd26f
    38 
    38 
    39 handleCmd_lobby ["LIST"] = do
    39 handleCmd_lobby ["LIST"] = do
    40     (ci, irnc) <- ask
    40     (ci, irnc) <- ask
    41     let cl = irnc `client` ci
    41     let cl = irnc `client` ci
    42     rooms <- allRoomInfos
    42     rooms <- allRoomInfos
    43     let roomsInfoList = concatMap (\r -> roomInfo (clientProto cl) (maybeNick . liftM (client irnc) $ masterID r) r) . filter (\r -> (roomProto r == clientProto cl))
    43     let roomsInfoList = concatMap (\r -> roomInfo (clientProto cl) (maybeNick . liftM (client irnc) $ masterID r) r) . filter ((/=) 0 . roomProto)
    44     return $ if hasAskedList cl then [] else
    44     return $ if hasAskedList cl then [] else
    45         [ ModifyClient (\c -> c{hasAskedList = True})
    45         [ ModifyClient (\c -> c{hasAskedList = True})
    46         , AnswerClients [sendChan cl] ("ROOMS" : roomsInfoList rooms)]
    46         , AnswerClients [sendChan cl] ("ROOMS" : roomsInfoList rooms)]
    47 
    47 
    48 handleCmd_lobby ["CHAT", msg] = do
    48 handleCmd_lobby ["CHAT", msg] = do
    89                 filter (\t -> teamowner t == nick cl) . teamsAtStart . fromJust $ gameInfo jRoom 
    89                 filter (\t -> teamowner t == nick cl) . teamsAtStart . fromJust $ gameInfo jRoom 
    90                 else
    90                 else
    91                 []
    91                 []
    92     let clTeamsNames = map teamname clTeams
    92     let clTeamsNames = map teamname clTeams
    93     return $
    93     return $
    94         if isNothing maybeRI then
    94         if isNothing maybeRI && clientProto cl < 60 && B.isPrefixOf "[v" roomName then
       
    95             [Warning $ loc "Room version incompatible to your Hedgewars version!"]
       
    96             else if isNothing maybeRI then
    95             [Warning $ loc "No such room."]
    97             [Warning $ loc "No such room."]
    96             else if (not sameProto) && (not $ isAdministrator cl) then
    98             else if (not sameProto) && (not $ isAdministrator cl) then
    97             [Warning $ loc "Room version incompatible to your Hedgewars version!"]
    99             [Warning $ loc "Room version incompatible to your Hedgewars version!"]
    98             else if isRestrictedJoins jRoom && not (hasSuperPower cl) then
   100             else if isRestrictedJoins jRoom && not (hasSuperPower cl) then
    99             [Warning $ loc "Access denied. This room currently doesn't allow joining."]
   101             [Warning $ loc "Access denied. This room currently doesn't allow joining."]