Ejemplo n.º 1
0
        public override bool TakeAction()
        {
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            if (CacheSet.FoundryRoomCache.FindKey(pf.MyFoundry.CurrentRoomId).Players[0] != m_UserId)
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "You have not this permission";
                return(false);
            }
            pf.SetUser(m_RequestPacket.PlayerId);
            pf.QuitRoom();
            pf.SetUser(m_UserId);
            pf.PushRoomPlayerChangedNotify();
            var target = GameSession.Get(m_RequestPacket.PlayerId);

            if (target != null)
            {
                LCKickedFromGearFoundryTeam package = new LCKickedFromGearFoundryTeam();
                byte[] buffer = CustomActionDispatcher.GeneratePackageStream(package.PacketActionId, ProtoBufUtils.Serialize(package));
                target.SendAsync(buffer, 0, buffer.Length);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public override bool TakeAction()
        {
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            int roomId = pf.MyFoundry.CurrentRoomId;

            pf.QuitRoom();
            pf.PushRoomPlayerChangedNotify(roomId);
            return(true);
        }