Send JOINING message in response to FOLLOW. Actual join may still fail due to room restrictions. Not tested.
authorunc0rr
Sun, 10 Feb 2013 01:52:13 +0400
changeset 8486 9a65baafd7d7
parent 8485 7cae79214537
child 8487 ec8391680132
Send JOINING message in response to FOLLOW. Actual join may still fail due to room restrictions. Not tested.
gameServer/HWProtoLobbyState.hs
--- a/gameServer/HWProtoLobbyState.hs	Sun Feb 10 01:45:25 2013 +0400
+++ b/gameServer/HWProtoLobbyState.hs	Sun Feb 10 01:52:13 2013 +0400
@@ -135,13 +135,14 @@
 
 handleCmd_lobby ["FOLLOW", asknick] = do
     (_, rnc) <- ask
+    clChan <- liftM sendChan thisClient
     ci <- clientByNick asknick
     let ri = clientRoom rnc $ fromJust ci
-    let clRoom = room rnc ri
+    let roomName = name $ room rnc ri
     if isNothing ci || ri == lobbyId then
         return []
         else
-        handleCmd_lobby ["JOIN_ROOM", name clRoom]
+        liftM ((:) (AnswerClients [clChan] ["JOINING", roomName])) $ handleCmd_lobby ["JOIN_ROOM", roomName]
 
     ---------------------------
     -- Administrator's stuff --