gameServer/HWProtoLobbyState.hs
changeset 7682 f6bfbe829008
parent 7677 f63c55db82eb
child 7748 f160fbc139b1
equal deleted inserted replaced
7681:26978d581070 7682:f6bfbe829008
    68     let jRI = fromJust maybeRI
    68     let jRI = fromJust maybeRI
    69     let jRoom = irnc `room` jRI
    69     let jRoom = irnc `room` jRI
    70     let sameProto = clientProto cl == roomProto jRoom
    70     let sameProto = clientProto cl == roomProto jRoom
    71     let jRoomClients = map (client irnc) $ roomClients irnc jRI
    71     let jRoomClients = map (client irnc) $ roomClients irnc jRI
    72     let nicks = map nick jRoomClients
    72     let nicks = map nick jRoomClients
    73     let owner = fromJust $ find isMaster jRoomClients
    73     let ownerNick = nick . fromJust $ find isMaster jRoomClients
    74     let chans = map sendChan (cl : jRoomClients)
    74     let chans = map sendChan (cl : jRoomClients)
    75     let isBanned = host cl `elem` roomBansList jRoom
    75     let isBanned = host cl `elem` roomBansList jRoom
    76     return $
    76     return $
    77         if isNothing maybeRI || not sameProto then
    77         if isNothing maybeRI || not sameProto then
    78             [Warning "No such room"]
    78             [Warning "No such room"]
    82             [Warning "You are banned in this room"]
    82             [Warning "You are banned in this room"]
    83             else if roomPassword /= password jRoom then
    83             else if roomPassword /= password jRoom then
    84             [NoticeMessage WrongPassword]
    84             [NoticeMessage WrongPassword]
    85             else
    85             else
    86             [
    86             [
    87                 MoveToRoom jRI,
    87                 MoveToRoom jRI
    88                 AnswerClients [sendChan cl] $ "JOINED" : nicks,
    88                 , AnswerClients [sendChan cl] $ "JOINED" : nicks
    89                 AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl],
    89                 , AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl]
    90                 AnswerClients [sendChan cl] $ ["WARNING", "Room admin is " `B.append` nick owner]
    90                 , AnswerClients [sendChan cl] $ ["WARNING", "Room admin is " `B.append` ownerNick]
       
    91                 , AnswerClients [sendChan cl] $ ["CLIENT_FLAGS", "+h", ownerNick]
    91             ]
    92             ]
    92             ++ map (readynessMessage cl) jRoomClients
    93             ++ map (readynessMessage cl) jRoomClients
    93             ++ answerFullConfig cl (mapParams jRoom) (params jRoom)
    94             ++ answerFullConfig cl (mapParams jRoom) (params jRoom)
    94             ++ answerTeams cl jRoom
    95             ++ answerTeams cl jRoom
    95             ++ watchRound cl jRoom
    96             ++ watchRound cl jRoom