299 writeChan (sendChan $ clients ! clID) ["DUMP", show serverInfo, showTree clients, showTree rooms] |
299 writeChan (sendChan $ clients ! clID) ["DUMP", show serverInfo, showTree clients, showTree rooms] |
300 return (clID, serverInfo, clients, rooms) |
300 return (clID, serverInfo, clients, rooms) |
301 |
301 |
302 |
302 |
303 processAction (clID, serverInfo, clients, rooms) (ProcessAccountInfo info) = do |
303 processAction (clID, serverInfo, clients, rooms) (ProcessAccountInfo info) = do |
304 processAction (clID, serverInfo, clients, rooms) SendServerMessage |
|
305 case info of |
304 case info of |
306 HasAccount passwd isAdmin -> do |
305 HasAccount passwd isAdmin -> do |
307 infoM "Clients" $ show clID ++ " has account" |
306 infoM "Clients" $ show clID ++ " has account" |
308 writeChan (sendChan $ clients ! clID) ["ASKPASSWORD"] |
307 writeChan (sendChan $ clients ! clID) ["ASKPASSWORD"] |
309 return (clID, serverInfo, adjust (\cl -> cl{webPassword = passwd, isAdministrator = isAdmin}) clID clients, rooms) |
308 return (clID, serverInfo, adjust (\cl -> cl{webPassword = passwd, isAdministrator = isAdmin}) clID clients, rooms) |
317 |
316 |
318 processAction (clID, serverInfo, clients, rooms) (MoveToLobby) = do |
317 processAction (clID, serverInfo, clients, rooms) (MoveToLobby) = do |
319 foldM processAction (clID, serverInfo, clients, rooms) $ |
318 foldM processAction (clID, serverInfo, clients, rooms) $ |
320 (RoomAddThisClient 0) |
319 (RoomAddThisClient 0) |
321 : answerLobbyNicks |
320 : answerLobbyNicks |
|
321 ++ [SendServerMessage] |
|
322 |
322 -- ++ (answerServerMessage client clients) |
323 -- ++ (answerServerMessage client clients) |
323 where |
324 where |
324 lobbyNicks = Prelude.map nick $ Prelude.filter logonPassed $ elems clients |
325 lobbyNicks = Prelude.map nick $ Prelude.filter logonPassed $ elems clients |
325 answerLobbyNicks = if not $ Prelude.null lobbyNicks then |
326 answerLobbyNicks = if not $ Prelude.null lobbyNicks then |
326 [AnswerThisClient (["LOBBY:JOINED"] ++ lobbyNicks)] |
327 [AnswerThisClient (["LOBBY:JOINED"] ++ lobbyNicks)] |