gameServer/HWProtoLobbyState.hs
changeset 8486 9a65baafd7d7
parent 8403 fbc6e7602e05
child 8519 98e2dbdda8c0
equal deleted inserted replaced
8485:7cae79214537 8486:9a65baafd7d7
   133     handleCmd_lobby ["JOIN_ROOM", roomName, ""]
   133     handleCmd_lobby ["JOIN_ROOM", roomName, ""]
   134 
   134 
   135 
   135 
   136 handleCmd_lobby ["FOLLOW", asknick] = do
   136 handleCmd_lobby ["FOLLOW", asknick] = do
   137     (_, rnc) <- ask
   137     (_, rnc) <- ask
       
   138     clChan <- liftM sendChan thisClient
   138     ci <- clientByNick asknick
   139     ci <- clientByNick asknick
   139     let ri = clientRoom rnc $ fromJust ci
   140     let ri = clientRoom rnc $ fromJust ci
   140     let clRoom = room rnc ri
   141     let roomName = name $ room rnc ri
   141     if isNothing ci || ri == lobbyId then
   142     if isNothing ci || ri == lobbyId then
   142         return []
   143         return []
   143         else
   144         else
   144         handleCmd_lobby ["JOIN_ROOM", name clRoom]
   145         liftM ((:) (AnswerClients [clChan] ["JOINING", roomName])) $ handleCmd_lobby ["JOIN_ROOM", roomName]
   145 
   146 
   146     ---------------------------
   147     ---------------------------
   147     -- Administrator's stuff --
   148     -- Administrator's stuff --
   148 
   149 
   149 handleCmd_lobby ["KICK", kickNick] = do
   150 handleCmd_lobby ["KICK", kickNick] = do