Example #1
0
        public override bool TakeAction()
        {
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            var playerFoundryInfo = pf.GetPlayerFoundryInfo();

            m_ResponsePacket.Data = pf.GetAllFoundryData();
            return(true);
        }
Example #2
0
        public override bool TakeAction()
        {
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            if (!pf.CreateRoom())
            {
                ErrorCode = (int)ErrorType.CanNotCreateRoom;
                ErrorInfo = "You must quit your room before you create a room";
                return(false);
            }
            m_ResponsePacket.TeamId = pf.GetPlayerFoundryInfo().CurrentRoomId;
            return(true);
        }
Example #3
0
        public override bool TakeAction()
        {
            GameSession target = GameSession.Get(m_RequestPacket.FriendPlayerId);

            if (target == null)
            {
                ErrorCode = (int)ErrorType.PlayerNotOnline;
                ErrorInfo = "Player is not online";
                return(false);
            }
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            PlayerLogic p = new PlayerLogic();

            p.SetUser(m_UserId);
            int teamId = pf.GetPlayerFoundryInfo().CurrentRoomId;

            if (teamId < 0)
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "You are not in a room";
                return(false);
            }
            if (CacheSet.FoundryRoomCache.FindKey(teamId).Players[0] != m_UserId)
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "You have not this permission";
                return(false);
            }
            LCInvitedForGearFoundry package = new LCInvitedForGearFoundry();

            package.TeamId        = teamId;
            package.InviterPlayer = new PBPlayerInfo()
            {
                Id           = m_UserId,
                Name         = p.MyPlayer.Name,
                Level        = p.MyPlayer.Level,
                PortraitType = p.MyPlayer.PortraitType
            };
            byte[] buffer = CustomActionDispatcher.GeneratePackageStream(2112, ProtoBufUtils.Serialize(package));
            target.SendAsync(buffer, 0, buffer.Length);
            m_ResponsePacket.FriendPlayerId = m_RequestPacket.FriendPlayerId;
            return(true);
        }