Esempio n. 1
0
        public override bool TakeAction()
        {
            if (!m_RequestPacket.Accept)
            {
                m_ResponsePacket.Accept          = false;
                m_ResponsePacket.InviterPlayerId = m_RequestPacket.InviterPlayerId;
                m_ResponsePacket.TeamId          = m_RequestPacket.TeamId;
                return(true);
            }
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            if (!pf.JoinRoom(m_RequestPacket.TeamId))
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "Room is full";
                return(false);
            }
            m_ResponsePacket.Accept          = true;
            m_ResponsePacket.Data            = pf.GetAllFoundryData();
            m_ResponsePacket.InviterPlayerId = m_RequestPacket.InviterPlayerId;
            m_ResponsePacket.TeamId          = m_RequestPacket.TeamId;
            pf.PushRoomPlayerChangedNotify();
            return(true);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        public override bool TakeAction()
        {
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            PBGearFoundryInfo roomInfo = pf.MatchRoom(m_RequestPacket.MatchMode);

            if (roomInfo == null)
            {
                return(true);
            }
            else
            {
                m_ResponsePacket.Data = roomInfo;
            }

            pf.PushRoomPlayerChangedNotify(roomInfo.TeamId, false);
            return(true);
        }