Don't allow to join other protocol room using FOLLOW command (not tested)
authorunc0rr
Mon, 15 Aug 2011 20:31:31 +0400
changeset 5573 cc409ee3ad2e
parent 5572 47cc28299baa
child 5574 3d7438991ed8
Don't allow to join other protocol room using FOLLOW command (not tested)
gameServer/HWProtoLobbyState.hs
--- a/gameServer/HWProtoLobbyState.hs	Mon Aug 15 20:18:18 2011 +0400
+++ b/gameServer/HWProtoLobbyState.hs	Mon Aug 15 20:31:31 2011 +0400
@@ -132,9 +132,10 @@
 handleCmd_lobby ["FOLLOW", asknick] = do
     (_, rnc) <- ask
     ci <- clientByNick asknick
+    cl <- thisClient
     let ri = clientRoom rnc $ fromJust ci
     let clRoom = room rnc ri
-    if isNothing ci || ri == lobbyId then
+    if isNothing ci || ri == lobbyId || clientProto cl /= roomProto clRoom then
         return []
         else
         handleCmd_lobby ["JOIN_ROOM", name clRoom]