# HG changeset patch # User unc0rr # Date 1296408992 -10800 # Node ID cc3485866b93009229412769f43e0b7c3188685d # Parent 26661bf28dd5c12a9a5567cb64ad6c54d7124c00 Reimplement FOLLOW diff -r 26661bf28dd5 -r cc3485866b93 gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Sun Jan 30 20:32:23 2011 +0300 +++ b/gameServer/HWProtoLobbyState.hs Sun Jan 30 20:36:32 2011 +0300 @@ -119,19 +119,18 @@ handleCmd_lobby ["JOIN_ROOM", roomName] = handleCmd_lobby ["JOIN_ROOM", roomName, ""] + +handleCmd_lobby ["FOLLOW", asknick] = do + (_, rnc) <- ask + ci <- clientByNick asknick + let ri = clientRoom rnc $ fromJust ci + let clRoom = room rnc ri + if isNothing ci || ri == lobbyId then + return [] + else + handleCmd_lobby ["JOIN_ROOM", name clRoom] + {- -handleCmd_lobby clID clients rooms ["FOLLOW", asknick] = - if noSuchClient || roomID followClient == 0 then - [] - else - handleCmd_lobby clID clients rooms ["JOIN_ROOM", roomName] - where - maybeClient = Foldable.find (\cl -> asknick == nick cl) clients - noSuchClient = isNothing maybeClient - followClient = fromJust maybeClient - roomName = name $ rooms IntMap.! roomID followClient - - --------------------------- -- Administrator's stuff --