public TValue[] GetValuesAll() { ListLinqView <TValue> listLinqView = new ListLinqView <TValue>(); DictionaryView <TKey, ListView <TValue> > .Enumerator enumerator = base.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <TKey, ListView <TValue> > current = enumerator.get_Current(); ListView <TValue> value = current.get_Value(); if (value != null) { IEnumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { TValue tValue = (TValue)((object)enumerator2.get_Current()); listLinqView.Add(tValue); } } } return(listLinqView.ToArray()); }
public void OnHeroSoulLvlChange(PoolObjHandle <ActorRoot> hero, int level) { DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; ListView <HeroKDA> .Enumerator enumerator2 = current.Value.GetEnumerator(); while (enumerator2.MoveNext()) { if (hero == enumerator2.Current.actorHero) { enumerator2.Current.SoulLevel = Math.Max(level, 1); Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_KDA_CHANGED); Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_HERO_PROPERTY_CHANGED); return; } } } }
public void OnHeroBattleEquipChange(uint actorId, stEquipInfo[] equips) { DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; ListView <HeroKDA> .Enumerator enumerator2 = current.Value.GetEnumerator(); while (enumerator2.MoveNext()) { if ((enumerator2.Current != null) && (enumerator2.Current.actorHero.handle.ObjID == actorId)) { equips.CopyTo(enumerator2.Current.Equips, 0); Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_KDA_CHANGED); Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_HERO_PROPERTY_CHANGED); return; } } } }
private bool ReQuery(Agent pAgent) { Query query = base.GetNode() as Query; if (query != null) { List <Query.Descriptor_t> descriptors = query.GetDescriptors(); if (descriptors.get_Count() > 0) { DictionaryView <string, BehaviorTree> behaviorTrees = Workspace.GetBehaviorTrees(); BehaviorTree behaviorTree = null; float num = -1f; using (DictionaryView <string, BehaviorTree> .Enumerator enumerator = behaviorTrees.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <string, BehaviorTree> current = enumerator.get_Current(); BehaviorTree value = current.get_Value(); string domains = value.GetDomains(); if (string.IsNullOrEmpty(query.m_domain) || (!string.IsNullOrEmpty(domains) && domains.IndexOf(query.m_domain) != -1)) { List <BehaviorTree.Descriptor_t> descriptors2 = value.GetDescriptors(); float num2 = query.ComputeSimilarity(descriptors, descriptors2); if (num2 > num) { num = num2; behaviorTree = value; } } } } if (behaviorTree != null) { pAgent.btreferencetree(behaviorTree.GetName()); return(true); } } } return(false); }
public void OnActorDead(ref GameDeadEventParam prm) { if (prm.bImmediateRevive) { return; } DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.get_Current(); ListView <HeroKDA> .Enumerator enumerator2 = current.get_Value().GetEnumerator(); while (enumerator2.MoveNext()) { enumerator2.get_Current().OnActorDead(ref prm); } KeyValuePair <uint, PlayerKDA> current2 = enumerator.get_Current(); if (current2.get_Value().IsHost) { KeyValuePair <uint, PlayerKDA> current3 = enumerator.get_Current(); if (current3.get_Value().m_hostHeroDamage != null) { KeyValuePair <uint, PlayerKDA> current4 = enumerator.get_Current(); ListView <CHostHeroDamage> .Enumerator enumerator3 = current4.get_Value().m_hostHeroDamage.GetEnumerator(); while (enumerator3.MoveNext()) { if (enumerator3.get_Current() != null) { enumerator3.get_Current().OnActorDead(ref prm); } } } } } if (prm.src && prm.src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { Singleton <EventRouter> .get_instance().BroadCastEvent(EventID.BATTLE_KDA_CHANGED); Singleton <EventRouter> .get_instance().BroadCastEvent(EventID.BATTLE_KDA_CHANGED_BY_ACTOR_DEAD); } }
public void reset() { DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.get_Current(); current.get_Value().clear(); } this.m_PlayerKDA.Clear(); Singleton <EventRouter> .GetInstance().RemoveEventHandler <PoolObjHandle <ActorRoot>, sbyte, uint>("HeroLearnTalent", new Action <PoolObjHandle <ActorRoot>, sbyte, uint>(this.OnHeroLearnTalent)); Singleton <EventRouter> .GetInstance().RemoveEventHandler <PoolObjHandle <ActorRoot>, int>("HeroSoulLevelChange", new Action <PoolObjHandle <ActorRoot>, int>(this.OnHeroSoulLvlChange)); Singleton <EventRouter> .GetInstance().RemoveEventHandler <uint, stEquipInfo[], bool, int>("HeroEquipInBattleChange", new Action <uint, stEquipInfo[], bool, int>(this.OnHeroBattleEquipChange)); Singleton <GameEventSys> .get_instance().RmvEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.OnActorDead)); Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_GameEnd, new RefAction <DefaultGameEventParam>(this.OnGameEnd)); Singleton <GameEventSys> .get_instance().RmvEventHandler <HurtEventResultInfo>(GameEventDef.Event_ActorDamage, new RefAction <HurtEventResultInfo>(this.OnActorDamage)); Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_DoubleKill, new RefAction <DefaultGameEventParam>(this.OnActorDoubleKill)); Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_TripleKill, new RefAction <DefaultGameEventParam>(this.OnActorTripleKill)); Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_QuataryKill, new RefAction <DefaultGameEventParam>(this.OnActorQuataryKill)); Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_PentaKill, new RefAction <DefaultGameEventParam>(this.OnActorPentaKill)); Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_Odyssey, new RefAction <DefaultGameEventParam>(this.OnActorOdyssey)); Singleton <GameEventSys> .get_instance().RmvEventHandler <SkillChooseTargetEventParam>(GameEventDef.Event_ActorBeChosenAsTarget, new RefAction <SkillChooseTargetEventParam>(this.OnActorBeChosen)); Singleton <GameEventSys> .get_instance().RmvEventHandler <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, new RefAction <SkillChooseTargetEventParam>(this.OnHitTrigger)); Singleton <EventRouter> .GetInstance().RemoveEventHandler <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >("HeroGoldCoinInBattleChange", new Action <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >(this.OnActorBattleCoinChanged)); Singleton <GameEventSys> .get_instance().RmvEventHandler <HemophagiaEventResultInfo>(GameEventDef.Event_Hemophagia, new RefAction <HemophagiaEventResultInfo>(this.OnActorHemophagia)); }
public void LogStaticVariables(string agentClassName) { if (!string.IsNullOrEmpty(agentClassName)) { if (this.m_static_variables.ContainsKey(agentClassName)) { Variables variables = this.m_static_variables.get_Item(agentClassName); variables.Log(null, false); } } else { using (DictionaryView <string, Variables> .Enumerator enumerator = this.m_static_variables.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <string, Variables> current = enumerator.get_Current(); current.get_Value().Log(null, false); } } } }
public void ClearAll() { DictionaryView <uint, ListView <COMDT_FRIEND_INFO> > .Enumerator enumerator = this._map.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, ListView <COMDT_FRIEND_INFO> > current = enumerator.Current; ListView <COMDT_FRIEND_INFO> view = current.Value; if (view != null) { view.Clear(); } } this.gameStateList.Clear(); this._rankingFriend.Clear(); this.SnsReCallData.Clear(); this.HeartData.Clear(); this.m_friendVerifyList.Clear(); this.m_stFriendIntimacyList.Clear(); this.m_LBSList.Clear(); this.searchLBSZero = string.Empty; RemarkNames.Clear(); }
public void OnActorDead(ref GameDeadEventParam prm) { if (!prm.bImmediateRevive) { DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; ListView <HeroKDA> .Enumerator enumerator2 = current.Value.GetEnumerator(); while (enumerator2.MoveNext()) { enumerator2.Current.OnActorDead(ref prm); } } if ((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) { Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_KDA_CHANGED); Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_KDA_CHANGED_BY_ACTOR_DEAD); } } }
public string GetPlayerName(ulong playerUid, uint playerLogicWorldId) { if (this.m_playerKDAStat != null) { DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; if (playerUid == current.get_Value().PlayerUid) { long num = (long)((ulong)playerLogicWorldId); KeyValuePair <uint, PlayerKDA> current2 = enumerator.Current; if (num == (long)current2.get_Value().WorldId) { KeyValuePair <uint, PlayerKDA> current3 = enumerator.Current; return(current3.get_Value().PlayerName); } } } } return(string.Empty); }
public uint GetReveivableRedDot(RES_WEAL_ENTRANCE_TYPE entry) { uint num = 0; if (this._actvDict != null) { DictionaryView <uint, Activity> .Enumerator enumerator = this._actvDict.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, Activity> current = enumerator.Current; if (current.Value.Entrance == entry) { KeyValuePair <uint, Activity> pair2 = enumerator.Current; if (pair2.Value.ReadyForGet) { num++; } } } } return(num); }
public void InitData() { if (!this._inited) { this._inited = true; if (this._spDict == null) { this._spDict = new DictionaryView <uint, ShopProduct>(); } if (this._spList == null) { this._spList = new ListView <ShopProduct>(); } if (this._filteredSpList == null) { this._filteredSpList = new ListView <ShopProduct>(); } if (this._filteredSpDict == null) { this._filteredSpDict = new DictionaryView <uint, ShopProduct>(); } DictionaryView <uint, ResSpecSale> .Enumerator enumerator = GameDataMgr.specSaleDict.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, ResSpecSale> current = enumerator.Current; ResSpecSale config = current.Value; if (config != null) { CUseable useable = CUseableManager.CreateUseable((COM_ITEM_TYPE)config.dwSpecSaleType, config.dwSpecSaleId, 0); if ((useable != null) && (useable.m_baseID != 0)) { ShopProduct sp = new ShopProduct(config); this.FilterProduct(sp); } } } } }
private void LateUpdate() { if (!this.bActiveSys || MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover) { return; } DictionaryView <int, ListView <VoiceInteraction> > .Enumerator enumerator = this.Interactions.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, ListView <VoiceInteraction> > current = enumerator.get_Current(); ListView <VoiceInteraction> value = current.get_Value(); int num = -1; int num2 = 0; for (int i = 0; i < value.get_Count(); i++) { VoiceInteraction voiceInteraction = value.get_Item(i); if (voiceInteraction.isBeginTrigger && voiceInteraction.priority > num) { num = voiceInteraction.priority; num2++; } } if (num2 > 0) { float realtimeSinceStartup = Time.realtimeSinceStartup; for (int j = 0; j < value.get_Count(); j++) { VoiceInteraction voiceInteraction2 = value.get_Item(j); if (voiceInteraction2.isBeginTrigger && voiceInteraction2.priority == num) { voiceInteraction2.DoTrigger(); } voiceInteraction2.FinishTrigger(realtimeSinceStartup); } } } }
private void OnCampDragonChange() { if (this._root == null) { this.Clear(); } else { int num = 0; int num2 = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA rkda = current.Value; if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = rkda.GetEnumerator(); while (enumerator2.MoveNext()) { num += enumerator2.Current.numKillDragon + enumerator2.Current.numKillBaron; } } else if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = rkda.GetEnumerator(); while (enumerator3.MoveNext()) { num2 += enumerator3.Current.numKillDragon + enumerator3.Current.numKillBaron; } } } this._campDragonText_1.text = num.ToString(); this._campDragonText_2.text = num2.ToString(); } }
public void CopyTo(Agent pAgent, Variables target) { target.m_variables.Clear(); using (DictionaryView <uint, IVariable> .Enumerator enumerator = this.m_variables.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <uint, IVariable> current = enumerator.get_Current(); IVariable variable = current.get_Value().clone(); target.m_variables.set_Item(variable.GetId(), variable); } } if (!object.ReferenceEquals(pAgent, null)) { using (DictionaryView <uint, IVariable> .Enumerator enumerator2 = target.m_variables.GetEnumerator()) { while (enumerator2.MoveNext()) { KeyValuePair <uint, IVariable> current2 = enumerator2.get_Current(); current2.get_Value().CopyTo(pAgent); } } } }
private void OnCampDragonChange() { if (!this._root) { this.Clear(); return; } int num = 0; int num2 = 0; CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { num += enumerator2.Current.numKillDragon + enumerator2.Current.numKillBaron; } } else if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { num2 += enumerator3.Current.numKillDragon + enumerator3.Current.numKillBaron; } } } this._campDragonText_1.set_text(num.ToString()); this._campDragonText_2.set_text(num2.ToString()); }
private bool RefreshData() { this.m_HotSaleListView.Clear(); this.m_NewArrivalListView.Clear(); DictionaryView <uint, ResBoutiqueConf> .Enumerator enumerator = GameDataMgr.boutiqueDict.GetEnumerator(); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { DebugHelper.Assert(false, "Master RoleInfo is null"); return(false); } int num = masterRoleInfo.getCurrentTimeSinceLogin(); while (enumerator.MoveNext()) { ListView <ResBoutiqueConf> newArrivalListView; ResHeroCfgInfo dataByKey; ResHeroSkin heroSkin; ResHeroCfgInfo info3; KeyValuePair <uint, ResBoutiqueConf> current = enumerator.Current; ResBoutiqueConf item = current.Value; if ((item.dwOnTimeGen <= num) && (item.dwOffTimeGen >= num)) { RES_BOUTIQUE_TYPE bBoutiqueType = (RES_BOUTIQUE_TYPE)item.bBoutiqueType; newArrivalListView = null; switch (bBoutiqueType) { case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_NEW_ARRIVAL: newArrivalListView = this.m_NewArrivalListView; break; case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_HOT_SALE: newArrivalListView = this.m_HotSaleListView; break; } switch (item.wItemType) { case 2: case 5: { CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(item.dwItemID); if (((product != null) && product.IsOnSale) && (newArrivalListView != null)) { newArrivalListView.Add(item); } break; } case 4: dataByKey = GameDataMgr.heroDatabin.GetDataByKey(item.dwItemID); if (dataByKey != null) { goto Label_013F; } break; case 7: heroSkin = CSkinInfo.GetHeroSkin(item.dwItemID); if (heroSkin != null) { goto Label_0179; } break; } } continue; Label_013F: if ((dataByKey.bIsPlayerUse > 0) && (newArrivalListView != null)) { newArrivalListView.Add(item); } continue; Label_0179: info3 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); if ((info3 != null) && (((heroSkin.bIsShow > 0) && (info3.bIsPlayerUse > 0)) && (newArrivalListView != null))) { newArrivalListView.Add(item); } } return(true); }
private bool RefreshData() { this.m_HotSaleListView.Clear(); this.m_NewArrivalListView.Clear(); DictionaryView <uint, ResBoutiqueConf> .Enumerator enumerator = GameDataMgr.boutiqueDict.GetEnumerator(); int currentUTCTime = CRoleInfo.GetCurrentUTCTime(); while (enumerator.MoveNext()) { ListView <ResBoutiqueConf> newArrivalListView; ResHeroCfgInfo dataByKey; ResHeroSkin heroSkin; ResHeroCfgInfo info2; KeyValuePair <uint, ResBoutiqueConf> current = enumerator.Current; ResBoutiqueConf item = current.Value; if ((item.dwOnTimeGen <= currentUTCTime) && (item.dwOffTimeGen >= currentUTCTime)) { RES_BOUTIQUE_TYPE bBoutiqueType = (RES_BOUTIQUE_TYPE)item.bBoutiqueType; newArrivalListView = null; switch (bBoutiqueType) { case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_NEW_ARRIVAL: newArrivalListView = this.m_NewArrivalListView; break; case RES_BOUTIQUE_TYPE.RES_BOUTIQUE_TYPE_HOT_SALE: newArrivalListView = this.m_HotSaleListView; break; } switch (item.wItemType) { case 2: case 5: { CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(item.dwItemID); if (((product != null) && (product.IsOnSale == 1)) && (newArrivalListView != null)) { newArrivalListView.Add(item); } break; } case 4: dataByKey = GameDataMgr.heroDatabin.GetDataByKey(item.dwItemID); if (dataByKey != null) { goto Label_011F; } break; case 7: heroSkin = CSkinInfo.GetHeroSkin(item.dwItemID); if (heroSkin != null) { goto Label_015D; } break; } } continue; Label_011F: if (GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID) && (newArrivalListView != null)) { newArrivalListView.Add(item); } continue; Label_015D: info2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); if ((info2 != null) && ((GameDataMgr.IsSkinAvailable(heroSkin.dwID) && GameDataMgr.IsHeroAvailable(info2.dwCfgID)) && (newArrivalListView != null))) { newArrivalListView.Add(item); } } return(true); }
private void UpdateTempObjectSpeed() { if (this.tempObjsAffectedByPlaySpeed == null) { return; } float single = this.playSpeed.single; DictionaryView <uint, ListView <GameObject> > .Enumerator enumerator = this.tempObjsAffectedByPlaySpeed.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, ListView <GameObject> > current = enumerator.Current; Action.PlaySpeedAffectedType key = (Action.PlaySpeedAffectedType)current.get_Key(); KeyValuePair <uint, ListView <GameObject> > current2 = enumerator.Current; ListView <GameObject> value = current2.get_Value(); int count = value.Count; for (int i = 0; i < count; i++) { GameObject gameObject = value[i]; if (key == Action.PlaySpeedAffectedType.ePSAT_Anim) { Animation[] componentsInChildren = gameObject.GetComponentsInChildren <Animation>(); if (componentsInChildren != null) { for (int j = 0; j < componentsInChildren.Length; j++) { Animation animation = componentsInChildren[j]; if (animation.playAutomatically && animation.clip) { AnimationState animationState = animation[animation.clip.name]; if (animationState) { animationState.speed = single; } } } } Animator[] componentsInChildren2 = gameObject.GetComponentsInChildren <Animator>(); if (componentsInChildren2 != null) { for (int k = 0; k < componentsInChildren2.Length; k++) { Animator animator = componentsInChildren2[k]; animator.speed = single; } } } else if (key == Action.PlaySpeedAffectedType.ePSAT_Fx) { ParticleSystem[] componentsInChildren3 = gameObject.GetComponentsInChildren <ParticleSystem>(); if (componentsInChildren3 != null) { for (int l = 0; l < componentsInChildren3.Length; l++) { ParticleSystem particleSystem = componentsInChildren3[l]; particleSystem.set_playbackSpeed(single); } } } } } }
public uint GetMvpPlayer(COM_PLAYERCAMP camp, bool bWin) { if ((this.m_winMvpId != 0) || (this.m_loseMvpId != 0)) { if (bWin) { return(this.m_winMvpId); } return(this.m_loseMvpId); } SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); int pvpPlayerNum = 0; if ((curLvelContext != null) && curLvelContext.IsMobaModeWithOutGuide()) { pvpPlayerNum = curLvelContext.m_pvpPlayerNum; } if (pvpPlayerNum <= 2) { return(0); } uint playerId = 0; float num3 = 0f; int numKill = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleStatistic> .instance.m_playerKDAStat.GetEnumerator(); PlayerKDA rkda = null; float num5 = ((float)GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0xb1).dwConfValue) / 10000f; while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; rkda = current.Value; if ((!rkda.bHangup && !rkda.bRunaway) && !rkda.bDisconnect) { float scoreValue = rkda.GetScoreValue(); if ((rkda.PlayerCamp == camp) && (scoreValue >= num3)) { if (scoreValue == num3) { KeyValuePair <uint, PlayerKDA> pair2 = enumerator.Current; if (pair2.Value.numKill < numKill) { continue; } } if (bWin || (scoreValue >= num5)) { KeyValuePair <uint, PlayerKDA> pair3 = enumerator.Current; playerId = pair3.Value.PlayerId; num3 = scoreValue; KeyValuePair <uint, PlayerKDA> pair4 = enumerator.Current; numKill = pair4.Value.numKill; } } } } return(playerId); }
public void GenerateStatData() { int num = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(188u).dwConfValue; int num2 = 0; int num3 = 0; int num4 = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(189u).dwConfValue; int num5 = 0; int num6 = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(190u).dwConfValue; int num7 = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.get_Current(); ListView <HeroKDA> .Enumerator enumerator2 = current.get_Value().GetEnumerator(); while (enumerator2.MoveNext()) { if (num < enumerator2.get_Current().numKill) { num = enumerator2.get_Current().numKill; } if (num2 < enumerator2.get_Current().hurtToEnemy) { num2 = enumerator2.get_Current().hurtToEnemy; } if (num3 < enumerator2.get_Current().hurtTakenByEnemy) { num3 = enumerator2.get_Current().hurtTakenByEnemy; } if (num4 < enumerator2.get_Current().numAssist) { num4 = enumerator2.get_Current().numAssist; } if (num5 < enumerator2.get_Current().TotalCoin) { num5 = enumerator2.get_Current().TotalCoin; } if (num6 < enumerator2.get_Current().numKillOrgan) { num6 = enumerator2.get_Current().numKillOrgan; } if (num7 < enumerator2.get_Current().hurtToHero) { num7 = enumerator2.get_Current().hurtToHero; } } } enumerator = this.m_PlayerKDA.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current2 = enumerator.get_Current(); ListView <HeroKDA> .Enumerator enumerator3 = current2.get_Value().GetEnumerator(); while (enumerator3.MoveNext()) { if (num == enumerator3.get_Current().numKill) { enumerator3.get_Current().bKillMost = true; } if (num2 == enumerator3.get_Current().hurtToEnemy) { enumerator3.get_Current().bHurtMost = true; } if (num3 == enumerator3.get_Current().hurtTakenByEnemy) { enumerator3.get_Current().bHurtTakenMost = true; } if (num4 == enumerator3.get_Current().numAssist) { enumerator3.get_Current().bAsssistMost = true; } if (num5 == enumerator3.get_Current().TotalCoin) { enumerator3.get_Current().bGetCoinMost = true; } if (num6 == enumerator3.get_Current().numKillOrgan&& enumerator3.get_Current().numKillOrgan > 0) { enumerator3.get_Current().bKillOrganMost = true; } if (num7 == enumerator3.get_Current().hurtToHero) { enumerator3.get_Current().bHurtToHeroMost = true; } } } if (this.m_CampKdaStat == null) { this.m_CampKdaStat = new CCampKDAStat(); if (this.m_CampKdaStat != null) { this.m_CampKdaStat.Initialize(this.m_PlayerKDA); } } }
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; } }
private bool Pack(int size) { int num = 0; int num2 = 0; int num3 = 0; int num4 = this.padding; Vector2 zero = Vector2.zero; DictionaryView <int, AtlasInfo.UVDetail> dictionaryView = new DictionaryView <int, AtlasInfo.UVDetail>(); DictionaryView <int, AtlasInfo.UVDetail> .Enumerator enumerator = this.textures.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, AtlasInfo.UVDetail> current = enumerator.Current; int width = current.get_Value().width; KeyValuePair <int, AtlasInfo.UVDetail> current2 = enumerator.Current; int height = current2.get_Value().height; AtlasInfo.UVDetail uVDetail = new AtlasInfo.UVDetail(); uVDetail.rotate = false; DictionaryView <int, AtlasInfo.UVDetail> dictionaryView2 = dictionaryView; KeyValuePair <int, AtlasInfo.UVDetail> current3 = enumerator.Current; dictionaryView2.Add(current3.get_Key(), uVDetail); if (num3 + height + num4 <= size && num2 + width + num4 <= size) { uVDetail.x = num2; uVDetail.y = num3; uVDetail.width = width; uVDetail.height = height; num3 += height + num4; if (num < num2 + width + num4) { num = num2 + width + num4; } } else { if (num + width > size || height > size) { return(false); } num2 = num; uVDetail.x = num2; uVDetail.y = 0; uVDetail.width = width; uVDetail.height = height; num3 = height + num4; num = num2 + width + num4; } } TextureFormat textureFormat = TextureFormat.ARGB32; if (this.needCompress) { textureFormat = TextureFormat.ARGB32; } Texture2D texture2D = new Texture2D(size, size, textureFormat, false); Color[] pixels = new Color[texture2D.width * texture2D.height]; texture2D.SetPixels(pixels); texture2D.name = string.Concat(new object[] { "Auto_UI3D_Atlas_", size, "_", this.counter, "_format", textureFormat.ToString() }); this.counter++; enumerator.Reset(); while (enumerator.MoveNext()) { Texture2D texture2D2 = null; Dictionary <int, Texture2D> dictionary = this.waitForCombineTextures; KeyValuePair <int, AtlasInfo.UVDetail> current4 = enumerator.Current; if (!dictionary.TryGetValue(current4.get_Key(), ref texture2D2)) { texture2D2 = this.atlas; } KeyValuePair <int, AtlasInfo.UVDetail> current5 = enumerator.Current; AtlasInfo.UVDetail value = current5.get_Value(); DictionaryView <int, AtlasInfo.UVDetail> dictionaryView3 = dictionaryView; KeyValuePair <int, AtlasInfo.UVDetail> current6 = enumerator.Current; AtlasInfo.UVDetail uVDetail2 = dictionaryView3[current6.get_Key()]; Color[] pixels2 = texture2D2.GetPixels(value.x, value.y, value.width, value.height); texture2D.SetPixels(uVDetail2.x, uVDetail2.y, value.width, value.height, pixels2); texture2D.Apply(false, false); uVDetail2.uvTL = new Vector2((float)uVDetail2.x / (float)texture2D.width, (float)(uVDetail2.y + uVDetail2.height) / (float)texture2D.height); uVDetail2.uvTR = new Vector2((float)(uVDetail2.x + uVDetail2.width) / (float)texture2D.width, (float)(uVDetail2.y + uVDetail2.height) / (float)texture2D.height); uVDetail2.uvBL = new Vector2((float)uVDetail2.x / (float)texture2D.width, (float)uVDetail2.y / (float)texture2D.height); uVDetail2.uvBR = new Vector2((float)(uVDetail2.x + uVDetail2.width) / (float)texture2D.width, (float)uVDetail2.y / (float)texture2D.height); } this.textures = dictionaryView; Object.Destroy(this.atlas); this.atlas = texture2D; Shader shader = Singleton <CResourceManager> .GetInstance().GetResource("Shaders/UI/UI3D.shader", typeof(Shader), enResourceType.BattleScene, true, true).m_content as Shader; this.mat = new Material(shader); this.mat.SetTexture("_MainTex", this.atlas); HashSet <Sprite3D> .Enumerator enumerator2 = this.sprites.GetEnumerator(); while (enumerator2.MoveNext()) { enumerator2.get_Current().SetMaterial(this.mat); enumerator2.get_Current().SetAutoAtlas(this.atlas, this.textures[enumerator2.get_Current().m_textureGUID]); } Dictionary <int, Texture2D> .Enumerator enumerator3 = this.waitForCombineTextures.GetEnumerator(); this.waitForCombineTextures.Clear(); Singleton <CResourceManager> .GetInstance().UnloadUnusedAssets(); return(true); }
public uint GetMvpPlayer(COM_PLAYERCAMP camp, bool bWin) { if ((this.m_winMvpId != 0) || (this.m_loseMvpId != 0)) { if (bWin) { return(this.m_winMvpId); } return(this.m_loseMvpId); } SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); int bMaxAcntNum = 0; if (curLvelContext != null) { if (((curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH)) || ((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT))) { ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey((uint)curLvelContext.iLevelID); ResCounterPartLevelInfo info2 = null; if (dataByKey == null) { info2 = GameDataMgr.cpLevelDatabin.GetDataByKey((uint)curLvelContext.iLevelID); } if (dataByKey != null) { bMaxAcntNum = dataByKey.stLevelCommonInfo.bMaxAcntNum; } else { bMaxAcntNum = info2.stLevelCommonInfo.bMaxAcntNum; } } else if (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER) { ResRankLevelInfo info3 = GameDataMgr.rankLevelDatabin.GetDataByKey((uint)curLvelContext.iLevelID); if (info3 != null) { bMaxAcntNum = info3.stLevelCommonInfo.bMaxAcntNum; } } else if (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH) { ResRewardMatchLevelInfo info4 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey((uint)curLvelContext.iLevelID); if (info4 != null) { bMaxAcntNum = info4.stLevelCommonInfo.bMaxAcntNum; } } } if (bMaxAcntNum <= 2) { return(0); } uint playerId = 0; float num3 = 0f; int numKill = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleStatistic> .instance.m_playerKDAStat.GetEnumerator(); PlayerKDA rkda = null; float num5 = ((float)GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0xb1).dwConfValue) / 10000f; while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; rkda = current.Value; if ((!rkda.bHangup && !rkda.bRunaway) && !rkda.bDisconnect) { float scoreValue = rkda.GetScoreValue(); if ((rkda.PlayerCamp == camp) && (scoreValue >= num3)) { if (scoreValue == num3) { KeyValuePair <uint, PlayerKDA> pair2 = enumerator.Current; if (pair2.Value.numKill < numKill) { continue; } } if (bWin || (scoreValue >= num5)) { KeyValuePair <uint, PlayerKDA> pair3 = enumerator.Current; playerId = pair3.Value.PlayerId; num3 = scoreValue; KeyValuePair <uint, PlayerKDA> pair4 = enumerator.Current; numKill = pair4.Value.numKill; } } } } return(playerId); }
public object run(Agent parent, Agent parHolder) { if (this.m_params != null) { for (int i = 0; i < this.m_params.Length; i++) { Property paramProperty = this.m_params[i].paramProperty; if (paramProperty != null) { this.m_param_values[i] = paramProperty.GetValue(parent, parHolder); } if (this.m_params[i].paramStructMembers != null) { Type type = this.m_param_values[i].GetType(); Agent.CTagObjectDescriptor descriptorByName = Agent.GetDescriptorByName(type.get_FullName()); using (DictionaryView <string, Property> .Enumerator enumerator = this.m_params[i].paramStructMembers.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <string, Property> current = enumerator.get_Current(); CMemberBase member = descriptorByName.GetMember(current.get_Key()); if (member != null) { object value = current.get_Value().GetValue(parent, parHolder); member.Set(this.m_param_values[i], value); } } } } } } object result = this.method_.Invoke(parent, this.m_param_values); if (this.m_params != null) { for (int j = 0; j < this.m_params.Length; j++) { Property paramProperty2 = this.m_params[j].paramProperty; if (paramProperty2 != null) { object v = this.m_param_values[j]; paramProperty2.SetValue(parHolder, v); } if (this.m_params[j].paramStructMembers != null) { Type type2 = this.m_param_values[j].GetType(); Agent.CTagObjectDescriptor descriptorByName2 = Agent.GetDescriptorByName(type2.get_FullName()); using (DictionaryView <string, Property> .Enumerator enumerator2 = this.m_params[j].paramStructMembers.GetEnumerator()) { while (enumerator2.MoveNext()) { KeyValuePair <string, Property> current2 = enumerator2.get_Current(); CMemberBase member2 = descriptorByName2.GetMember(current2.get_Key()); if (member2 != null) { object v2 = member2.Get(this.m_param_values[j]); current2.get_Value().SetValue(parHolder, v2); } } } } } } return(result); }
public void InitData() { DateTime time = new DateTime(0x7f6, 1, 0x12); if (!this.m_Inited) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { DateTime time2 = Utility.ToUtcTime2Local((long)masterRoleInfo.getCurrentTimeSinceLogin()); DictionaryView <uint, ResAkaliShopCtrl> .Enumerator enumerator = GameDataMgr.mysteryShopCtlDict.GetEnumerator(); DateTime time3 = time; bool flag = false; bool flag2 = false; while (enumerator.MoveNext()) { KeyValuePair <uint, ResAkaliShopCtrl> current = enumerator.Current; ResAkaliShopCtrl ctrl = current.Value; DateTime time4 = Utility.StringToDateTime(Utility.UTF8Convert(ctrl.szOpenTime), DateTime.MinValue); DateTime time5 = Utility.StringToDateTime(Utility.UTF8Convert(ctrl.szCloseTime), DateTime.MinValue); if ((time2.CompareTo(time4) >= 0) && (time2.CompareTo(time5) <= 0)) { this.m_ShopID = ctrl.dwShopID; this.m_Products.Clear(); this.m_ProductDic.Clear(); this.m_StartTime = time4; this.m_EndTime = time5; this.m_LimitBuyCnt = ctrl.dwTotalBuyNumLimit; this.m_BoughtCnt = 0; switch (((RES_AKALISHOPZHEKOU_TYPE)ctrl.bZheKouType)) { case RES_AKALISHOPZHEKOU_TYPE.RES_AKALISHOPZHEKOU_CONFIRM: this.m_IsRandomDiscount = false; this.m_Discount = (uint)ctrl.iConfirmZheKou; this.m_HasGotDiscount = true; break; case RES_AKALISHOPZHEKOU_TYPE.RES_AKALISHOPZHEKOU_RANDOM: this.m_IsRandomDiscount = true; this.m_Discount = 100; this.m_HasGotDiscount = false; break; } DictionaryView <uint, ResAkaliShopGoods> .Enumerator enumerator2 = GameDataMgr.mysteryShopProductDict.GetEnumerator(); while (enumerator2.MoveNext()) { ResHeroCfgInfo dataByKey; ResHeroSkin heroSkin; ResHeroCfgInfo info3; long num; KeyValuePair <uint, ResAkaliShopGoods> pair2 = enumerator2.Current; ResAkaliShopGoods goodsCfg = pair2.Value; if (goodsCfg.dwShopID != ctrl.dwShopID) { continue; } CMallMysteryProduct item = new CMallMysteryProduct(goodsCfg); switch (item.ItemType) { case COM_ITEM_TYPE.COM_OBJTYPE_HERO: { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(item.ItemID); if (dataByKey != null) { break; } continue; } case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN: { heroSkin = CSkinInfo.GetHeroSkin(item.ItemID); if (heroSkin != null) { goto Label_0211; } continue; } default: goto Label_025C; } if (dataByKey.bIsPlayerUse > 0) { this.m_Products.Add(item); } goto Label_026E; Label_0211: info3 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); if (info3 == null) { continue; } if ((heroSkin.bIsShow > 0) && (info3.bIsPlayerUse > 0)) { this.m_Products.Add(item); } goto Label_026E; Label_025C: this.m_Products.Add(item); Label_026E: num = GameDataMgr.GetDoubleKey((uint)item.ItemType, item.ItemID); if (!this.m_ProductDic.ContainsKey(num)) { this.m_ProductDic.Add(num, item); } } if (this.m_Products.Count == 0) { DebugHelper.Assert(false, "神秘商店配置了开启时段,但商店里没物品可卖"); } else { flag = true; } continue; } if ((time4.CompareTo(time2) > 0) && (time4.CompareTo(time3) < 0)) { time3 = time4; } } TimeSpan span = (TimeSpan)(time3 - time2); Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this.m_NextRefreshTimerSeq); long num2 = (long)(span.TotalSeconds * 1000.0); if ((num2 > 0L) && (num2 < 0x7fffffffL)) { Singleton <CTimerManager> .GetInstance().AddTimer((int)num2, 1, new CTimer.OnTimeUpHandler(this.RefreshShop)); flag2 = true; } TimeSpan span2 = (TimeSpan)(this.m_EndTime - time2); Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this.m_EndTimerSeq); long num3 = ((int)span2.TotalSeconds) * 0x3e8; if ((num3 > 0L) && (num3 < 0x7fffffffL)) { Singleton <CTimerManager> .GetInstance().AddTimer((int)num3, 1, new CTimer.OnTimeUpHandler(this.CloseShop)); } if (flag || flag2) { this.m_Inited = true; } } } }
private void UpdateTempObjectSpeed() { if (this.tempObjsAffectedByPlaySpeed != null) { float single = this.playSpeed.single; DictionaryView <uint, ListView <GameObject> > .Enumerator enumerator = this.tempObjsAffectedByPlaySpeed.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, ListView <GameObject> > current = enumerator.Current; PlaySpeedAffectedType key = current.Key; KeyValuePair <uint, ListView <GameObject> > pair2 = enumerator.Current; ListView <GameObject> view = pair2.Value; int count = view.Count; for (int i = 0; i < count; i++) { GameObject obj2 = view[i]; switch (key) { case PlaySpeedAffectedType.ePSAT_Anim: { Animation[] componentsInChildren = obj2.GetComponentsInChildren <Animation>(); if (componentsInChildren != null) { for (int j = 0; j < componentsInChildren.Length; j++) { Animation animation = componentsInChildren[j]; if (animation.playAutomatically && (animation.clip != null)) { AnimationState state = animation[animation.clip.name]; if (state != null) { state.speed = single; } } } } Animator[] animatorArray = obj2.GetComponentsInChildren <Animator>(); if (animatorArray != null) { for (int k = 0; k < animatorArray.Length; k++) { Animator animator = animatorArray[k]; animator.speed = single; } } break; } case PlaySpeedAffectedType.ePSAT_Fx: { ParticleSystem[] systemArray = obj2.GetComponentsInChildren <ParticleSystem>(); if (systemArray != null) { for (int m = 0; m < systemArray.Length; m++) { ParticleSystem system = systemArray[m]; system.playbackSpeed = single; } } break; } } } } } }
internal void ConvertServerHeroInfo(ref ActorServerData serverData, COMDT_CHOICEHERO serverHeroInfo) { serverData.SymbolID = new uint[30]; serverData.m_customRecommendEquips = new ushort[6]; if (serverHeroInfo == null) { Debug.Log(string.Format("COMDT_CHOICEHERO is null when try to use hero Id {0}, playerId is {1}", serverData.TheActorMeta.ConfigId, serverData.TheActorMeta.PlayerId)); DictionaryView <uint, ListView <COMDT_CHOICEHERO> > .Enumerator enumerator = this._serverCachedInfo.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, ListView <COMDT_CHOICEHERO> > current = enumerator.Current; uint key = current.Key; KeyValuePair <uint, ListView <COMDT_CHOICEHERO> > pair2 = enumerator.Current; ListView <COMDT_CHOICEHERO> view = pair2.Value; if (view.Count > 0) { Debug.Log(string.Format("_serverCachedInfo key {0} value {1}", key, view[0].stBaseInfo.stCommonInfo.dwHeroID)); } else { Debug.Log(string.Format("_serverCachedInfo key {0} value empty", key)); } } } else { if ((serverHeroInfo.stBaseInfo != null) && (serverHeroInfo.stBaseInfo.stCommonInfo != null)) { serverData.Exp = serverHeroInfo.stBaseInfo.stCommonInfo.dwExp; serverData.Level = serverHeroInfo.stBaseInfo.stCommonInfo.wLevel; serverData.Star = serverHeroInfo.stBaseInfo.stCommonInfo.wStar; if (serverHeroInfo.stBaseInfo.stCommonInfo.stQuality != null) { serverData.TheQualityInfo.Quality = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wQuality; serverData.TheQualityInfo.SubQuality = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wSubQuality; } if (serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency != null) { serverData.TheProficiencyInfo.Level = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.bLv; serverData.TheProficiencyInfo.Proficiency = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.dwProficiency; } serverData.SkinId = serverHeroInfo.stBaseInfo.stCommonInfo.wSkinID; } if (serverHeroInfo.stBurningInfo != null) { serverData.TheBurnInfo.HeroRemainingHp = serverHeroInfo.stBurningInfo.dwBloodTTH; serverData.TheBurnInfo.IsDead = serverHeroInfo.stBurningInfo.bIsDead != 0; } if (serverHeroInfo.stHeroExtral != null) { serverData.TheExtraInfo.BornPointIndex = serverHeroInfo.stHeroExtral.iHeroPos; } for (int i = 0; i < serverHeroInfo.SymbolID.Length; i++) { serverData.SymbolID[i] = serverHeroInfo.SymbolID[i]; } for (int j = 0; j < serverHeroInfo.HeroEquipList.Length; j++) { serverData.m_customRecommendEquips[j] = (ushort)serverHeroInfo.HeroEquipList[j]; } } }
public static void SetBurnSettleData(CUIFormScript form, ref COMDT_SETTLE_RESULT_DETAIL settleData) { CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; SetWin(form.gameObject, settleData.stGameInfo.bGameResult == 1); int num = 1; int num2 = 1; int num3 = 0; int num4 = 0; string playerName = string.Empty; int playerLv = 1; COM_PLAYERCAMP playerCamp = COM_PLAYERCAMP.COM_PLAYERCAMP_1; string str2 = string.Empty; int num6 = 1; COM_PLAYERCAMP com_playercamp2 = COM_PLAYERCAMP.COM_PLAYERCAMP_1; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { bool flag = true; if (settleData.stGameInfo.bGameResult == 1) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; if (current.Value.IsHost) { flag = true; } else { flag = false; } } else { KeyValuePair <uint, PlayerKDA> pair2 = enumerator.Current; if (pair2.Value.IsHost) { flag = false; } else { flag = true; } } if (flag) { KeyValuePair <uint, PlayerKDA> pair3 = enumerator.Current; ListView <HeroKDA> .Enumerator enumerator2 = pair3.Value.GetEnumerator(); while (enumerator2.MoveNext() && (num <= 3)) { GameObject gameObject = form.gameObject.transform.Find("Panel/Left_Player" + num).gameObject; KeyValuePair <uint, PlayerKDA> pair4 = enumerator.Current; SetPlayerStat(form, gameObject, pair4.Value, enumerator2.Current); num++; } KeyValuePair <uint, PlayerKDA> pair5 = enumerator.Current; num3 += pair5.Value.numKill; KeyValuePair <uint, PlayerKDA> pair6 = enumerator.Current; playerName = pair6.Value.PlayerName; KeyValuePair <uint, PlayerKDA> pair7 = enumerator.Current; playerCamp = pair7.Value.PlayerCamp; KeyValuePair <uint, PlayerKDA> pair8 = enumerator.Current; playerLv = pair8.Value.PlayerLv; } else { KeyValuePair <uint, PlayerKDA> pair9 = enumerator.Current; ListView <HeroKDA> .Enumerator enumerator3 = pair9.Value.GetEnumerator(); while (enumerator3.MoveNext() && (num2 <= 3)) { GameObject item = form.gameObject.transform.Find("Panel/Right_Player" + num2).gameObject; KeyValuePair <uint, PlayerKDA> pair10 = enumerator.Current; SetPlayerStat(form, item, pair10.Value, enumerator3.Current); num2++; } KeyValuePair <uint, PlayerKDA> pair11 = enumerator.Current; num4 += pair11.Value.numKill; KeyValuePair <uint, PlayerKDA> pair12 = enumerator.Current; str2 = pair12.Value.PlayerName; KeyValuePair <uint, PlayerKDA> pair13 = enumerator.Current; com_playercamp2 = pair13.Value.PlayerCamp; KeyValuePair <uint, PlayerKDA> pair14 = enumerator.Current; num6 = pair14.Value.PlayerLv; } } for (int i = num; i <= 3; i++) { form.gameObject.transform.Find("Panel/Left_Player" + i).gameObject.CustomSetActive(false); } for (int j = num2; j <= 3; j++) { form.gameObject.transform.Find("Panel/Right_Player" + j).gameObject.CustomSetActive(false); } Text component = form.gameObject.transform.Find("Panel/PanelABg/Image/ImageLeft/Txt_LeftPlayerName").gameObject.GetComponent <Text>(); component.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = string.Format("Lv.{0}", playerLv); component.text = playerName; component.color = (playerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? new Color(0.545f, 0f, 0f, 1f) : new Color(0.031f, 0.961f, 0f, 1f); component = form.gameObject.transform.Find("Panel/PanelABg/Image/ImageRight/Txt_RightPlayerName").gameObject.GetComponent <Text>(); component.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = string.Format("Lv.{0}", num6); component.text = str2; component.color = (com_playercamp2 != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? new Color(0.545f, 0f, 0f, 1f) : new Color(0.031f, 0.961f, 0f, 1f); }
public uint GetMvpPlayer(COM_PLAYERCAMP camp, bool bWin) { if (this.m_winMvpId != 0u || this.m_loseMvpId != 0u) { if (bWin) { return(this.m_winMvpId); } return(this.m_loseMvpId); } else { SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); int num = 0; if (curLvelContext != null && curLvelContext.IsMobaModeWithOutGuide()) { num = curLvelContext.m_pvpPlayerNum; } if (num <= 2) { return(0u); } uint result = 0u; float num2 = 0f; int num3 = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleStatistic> .instance.m_playerKDAStat.GetEnumerator(); float num4 = GameDataMgr.globalInfoDatabin.GetDataByKey(177u).dwConfValue / 10000f; while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (!value.bHangup && !value.bRunaway && !value.bDisconnect) { float mvpValue = value.MvpValue; float kDAValue = value.KDAValue; if (value.PlayerCamp == camp && mvpValue >= num2) { if (mvpValue == num2) { KeyValuePair <uint, PlayerKDA> current2 = enumerator.Current; if (current2.get_Value().numKill < num3) { continue; } } if ((bWin || mvpValue >= num4) && (bWin || kDAValue >= 3f)) { KeyValuePair <uint, PlayerKDA> current3 = enumerator.Current; result = current3.get_Value().PlayerId; num2 = mvpValue; KeyValuePair <uint, PlayerKDA> current4 = enumerator.Current; num3 = current4.get_Value().numKill; } } } } return(result); } }