gameServer/HWProtoLobbyState.hs
changeset 7537 833a0c34fafc
parent 7321 57bd4f201401
child 7668 4cb423f42105
equal deleted inserted replaced
7535:87e5838103ff 7537:833a0c34fafc
    68     let jRoom = irnc `room` jRI
    68     let jRoom = irnc `room` jRI
    69     let sameProto = clientProto cl == roomProto jRoom
    69     let sameProto = clientProto cl == roomProto jRoom
    70     let jRoomClients = map (client irnc) $ roomClients irnc jRI
    70     let jRoomClients = map (client irnc) $ roomClients irnc jRI
    71     let nicks = map nick jRoomClients
    71     let nicks = map nick jRoomClients
    72     let chans = map sendChan (cl : jRoomClients)
    72     let chans = map sendChan (cl : jRoomClients)
       
    73     let isBanned = host cl `elem` roomBansList jRoom
    73     return $
    74     return $
    74         if isNothing maybeRI || not sameProto then
    75         if isNothing maybeRI || not sameProto then
    75             [Warning "No such room"]
    76             [Warning "No such room"]
    76             else if isRestrictedJoins jRoom then
    77             else if isRestrictedJoins jRoom then
    77             [Warning "Joining restricted"]
    78             [Warning "Joining restricted"]
       
    79             else if isBanned then
       
    80             [Warning "You are banned in this room"]
    78             else if roomPassword /= password jRoom then
    81             else if roomPassword /= password jRoom then
    79             [NoticeMessage WrongPassword]
    82             [NoticeMessage WrongPassword]
    80             else
    83             else
    81             [
    84             [
    82                 MoveToRoom jRI,
    85                 MoveToRoom jRI,
   181     cl <- thisClient
   184     cl <- thisClient
   182     return [ClearAccountsCache | isAdministrator cl]
   185     return [ClearAccountsCache | isAdministrator cl]
   183 
   186 
   184 handleCmd_lobby ["RESTART_SERVER"] = do
   187 handleCmd_lobby ["RESTART_SERVER"] = do
   185     cl <- thisClient
   188     cl <- thisClient
   186     return [RestartServer]
   189     return [RestartServer | isAdministrator cl]
   187 
   190 
   188 
   191 
   189 handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"]
   192 handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"]