Пример #1
0
        public void initialize(Player player)
        {
            if (player != null)
            {
                this.clear();
                Singleton <EventRouter> .instance.AddEventHandler <Player>(EventID.PlayerRunAway, new Action <Player>(this.onPlayerRunAway));

                Singleton <EventRouter> .instance.AddEventHandler <HANGUP_TYPE, uint>(EventID.HangupNtf, new Action <HANGUP_TYPE, uint>(this, (IntPtr)this.OnHangupNtf));

                Singleton <EventRouter> .instance.AddEventHandler <bool, uint>(EventID.DisConnectNtf, new Action <bool, uint>(this, (IntPtr)this.OnDisConnect));

                Singleton <EventRouter> .instance.AddEventHandler <Player>(EventID.FirstMoved, new Action <Player>(this.OnFirstMoved));

                Singleton <EventRouter> .instance.AddEventHandler <Player>(EventID.PlayerReviveTime, new Action <Player>(this.OnReviveTime));

                Singleton <EventRouter> .instance.AddEventHandler <COM_PLAYERCAMP>(EventID.CampTowerFirstAttackTime, new Action <COM_PLAYERCAMP>(this.OnCampTowerFirstAttackTime));

                this.PlayerId     = player.PlayerId;
                this.PlayerCamp   = player.PlayerCamp;
                this.PlayerName   = player.Name;
                this.IsComputer   = player.Computer;
                this.WorldId      = player.LogicWrold;
                this.PlayerUid    = player.PlayerUId;
                this.IsHost       = (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null) && (player.PlayerId == Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerId);
                this.PlayerLv     = player.Level;
                this.PlayerVipLv  = player.VipLv;
                this.PlayerOpenId = player.OpenId;
                ReadonlyContext <PoolObjHandle <ActorRoot> > .Enumerator enumerator = player.GetAllHeroes().GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current != 0)
                    {
                        HeroKDA item = new HeroKDA();
                        item.Initialize(enumerator.Current);
                        this.m_HeroKDA.Add(item);
                    }
                }
            }
        }
Пример #2
0
 private void GetTeamInfoByPlayerKda(PlayerKDA kda)
 {
     if (kda == null)
     {
         return;
     }
     if (kda.PlayerCamp != 1 && kda.PlayerCamp != 2)
     {
         return;
     }
     ListView <HeroKDA> .Enumerator enumerator = kda.GetEnumerator();
     while (enumerator.MoveNext())
     {
         HeroKDA current = enumerator.get_Current();
         if (current != null)
         {
             this.m_campTotalDamage[kda.PlayerCamp - 1]       += (uint)current.hurtToEnemy;
             this.m_campTotalTakenDamage[kda.PlayerCamp - 1]  += (uint)current.hurtTakenByEnemy;
             this.m_campTotalToHeroDamage[kda.PlayerCamp - 1] += (uint)current.hurtToHero;
         }
     }
 }
Пример #3
0
        public void GenerateStatData()
        {
            DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator();
            HeroKDA okda  = null;
            HeroKDA okda2 = null;
            HeroKDA okda3 = null;
            HeroKDA okda4 = null;
            HeroKDA okda5 = null;
            HeroKDA okda6 = null;

            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, PlayerKDA> current     = enumerator.Current;
                IEnumerator <HeroKDA>          enumerator2 = current.Value.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    if (okda == null)
                    {
                        okda = enumerator2.Current;
                    }
                    if (okda.numKill < enumerator2.Current.numKill)
                    {
                        okda = enumerator2.Current;
                    }
                    if (okda2 == null)
                    {
                        okda2 = enumerator2.Current;
                    }
                    if (okda2.hurtToEnemy < enumerator2.Current.hurtToEnemy)
                    {
                        okda2 = enumerator2.Current;
                    }
                    if (okda3 == null)
                    {
                        okda3 = enumerator2.Current;
                    }
                    if (okda3.hurtTakenByEnemy < enumerator2.Current.hurtTakenByEnemy)
                    {
                        okda3 = enumerator2.Current;
                    }
                    if (okda4 == null)
                    {
                        okda4 = enumerator2.Current;
                    }
                    if (okda4.numAssist < enumerator2.Current.numAssist)
                    {
                        okda4 = enumerator2.Current;
                    }
                    if (okda5 == null)
                    {
                        okda5 = enumerator2.Current;
                    }
                    if (okda5.TotalCoin < enumerator2.Current.TotalCoin)
                    {
                        okda5 = enumerator2.Current;
                    }
                    if (okda6 == null)
                    {
                        okda6 = enumerator2.Current;
                    }
                    if (okda6.numKillOrgan < enumerator2.Current.numKillOrgan)
                    {
                        okda6 = enumerator2.Current;
                    }
                }
            }
            if ((okda != null) && (okda.numKill >= 5))
            {
                okda.bKillMost = true;
            }
            if ((okda2 != null) && (okda2.hurtToEnemy > 0))
            {
                okda2.bHurtMost = true;
            }
            if ((okda3 != null) && (okda3.hurtTakenByEnemy > 0))
            {
                okda3.bHurtTakenMost = true;
            }
            if ((okda4 != null) && (okda4.numAssist >= 10))
            {
                okda4.bAsssistMost = true;
            }
            if ((okda5 != null) && (okda4.TotalCoin > 0))
            {
                okda5.bGetCoinMost = true;
            }
            if ((okda6 != null) && (okda6.numKillOrgan > 0))
            {
                okda6.bKillOrganMost = true;
            }
        }