示例#1
0
        private void AddArenaToken(int token)
        {
            PlayerLogic p = new PlayerLogic();

            p.SetUser(m_UserId);
            p.AddArenaToken(token);
            m_ResponsePacket.PlayerInfo = new PBPlayerInfo()
            {
                Id         = p.MyPlayer.Id,
                ArenaToken = p.MyPlayer.ArenaToken
            };
        }
示例#2
0
        public override bool TakeAction()
        {
            PlayerArenaLogic pa = new PlayerArenaLogic();

            pa.SetUser(m_UserId);
            m_ResponsePacket.ChallengeCount = pa.MyArena.ChallengeCount;
            int token;

            if (!pa.EndBattle(m_RequestPacket.EnemyPlayerId, m_RequestPacket.Win, m_RequestPacket.IsRevenge, out token))
            {
                ErrorCode = (int)ErrorType.CannotOpenChance;
                ErrorInfo = "player is not in battle";
                return(false);
            }
            PlayerLogic p = new PlayerLogic();

            p.SetUser(m_UserId);
            p.AddArenaToken(token);
            m_ResponsePacket.Me = new PBPlayerInfo()
            {
                Id         = m_UserId,
                ArenaToken = p.MyPlayer.ArenaToken
            };
            p.SetUser(m_RequestPacket.EnemyPlayerId);
            ArenaRankLogic ar = new ArenaRankLogic();

            m_ResponsePacket.MyRank = ar.GetPlayerRank(m_UserId);
            m_ResponsePacket.Win    = m_RequestPacket.Win;
            m_ResponsePacket.Enemy  = new PBArenaPlayerAndTeamInfo()
            {
                Rank = ar.GetPlayerRank(m_RequestPacket.EnemyPlayerId)
            };
            m_ResponsePacket.Enemy.PlayerInfo = new PBPlayerInfo()
            {
                Id           = m_RequestPacket.EnemyPlayerId,
                Name         = p.MyPlayer.Name,
                PortraitType = p.MyPlayer.PortraitType,
                Level        = p.MyPlayer.Level
            };

            return(true);
        }