public static void SetExpFormData(CUIFormScript form, COMDT_SETTLE_RESULT_DETAIL settleData) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } GameObject gameObject = form.transform.Find("Root/Panel_Exp/Exp_Player").gameObject; PVEPlayerItem pVEPlayerItem = new PVEPlayerItem(gameObject); pVEPlayerItem.addExp(settleData.stAcntInfo.dwSettleExp); CUI3DImageScript component = form.transform.Find("Root/3DImage").gameObject.GetComponent <CUI3DImageScript>(); DebugHelper.Assert(component != null); int num = 1; for (int i = 0; i < (int)settleData.stHeroList.bNum; i++) { uint dwHeroConfID = settleData.stHeroList.astHeroList[i].dwHeroConfID; gameObject = form.transform.Find(string.Format("Root/Panel_Exp/Exp_Hero{0}", num)).gameObject; CHeroInfo cHeroInfo; if (masterRoleInfo.GetHeroInfoDic().TryGetValue(dwHeroConfID, ref cHeroInfo)) { ResHeroCfgInfo cfgInfo = cHeroInfo.cfgInfo; PVEHeroItem pVEHeroItem = new PVEHeroItem(gameObject, cfgInfo.dwCfgID); if (num <= (int)settleData.stHeroList.bNum) { gameObject.CustomSetActive(true); pVEHeroItem.addExp(settleData.stHeroList.astHeroList[num - 1].dwSettleExp); int heroWearSkinId = (int)masterRoleInfo.GetHeroWearSkinId(cfgInfo.dwCfgID); string objectName = CUICommonSystem.GetHeroPrefabPath(cfgInfo.dwCfgID, heroWearSkinId, true).ObjectName; GameObject model = component.AddGameObjectToPath(objectName, false, string.Format("_root/Hero{0}", num)); CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(model); instance.InitAnimatList(); instance.InitAnimatSoundList(cfgInfo.dwCfgID, (uint)heroWearSkinId); instance.OnModePlayAnima("idleshow2"); } } num++; } }
public void ShareInviteFriend(string openId, string title, string desc, string extInfo) { Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false; if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform()) { return; } Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D; if (texture2D == null) { DebugHelper.Assert(false, "Texture2D Share/120 == null"); return; } byte[] array = texture2D.EncodeToPNG(); if (array != null) { int num = array.Length; } IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService; if (apolloSnsService == null) { DebugHelper.Assert(false, "IApollo.Instance.GetService(ApolloServiceType.Sns) == null"); return; } MonoSingleton <ShareSys> .get_instance().OnShareCallBack(); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2) { ApolloAccountInfo accountInfo = this.GetAccountInfo(false); if (accountInfo != null) { string text = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.get_OpenId() + "&ADTAG=gameobj.msg_invite"; string text2 = "http://image.smoba.qq.com/yywj/share_pic/120.png"; apolloSnsService.SendToQQGameFriend(1, openId, title, desc, text, text2, title, "MSG_INVITE", extInfo); } } else { apolloSnsService.SendToWXGameFriend(openId, title, desc, "9Wste6_dDgZtoVmC6CQTh0jj29kGEp0jrVSYrGWvtZLvSTDN9fUb-_sNjacaGITt", "messageExt", "MSG_INVITE", extInfo); } }
public void UpdateFrame() { if (this.isOnlineMode) { this.UpdateLobbyConnection(); this.UpdateGameConnection(); try { this.HandleLobbyMsgSend(); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message, exception.StackTrace }; DebugHelper.Assert(false, "Error In HandleLobbyMsgSend: {0}, Call stack : {1}", inParameters); } try { this.HandleGameMsgSend(); } catch (Exception exception2) { object[] objArray2 = new object[] { exception2.Message, exception2.StackTrace }; DebugHelper.Assert(false, "Error In HandleGameMsgSend: {0}, Call stack : {1}", objArray2); } try { this.HandleLobbyMsgRecv(); } catch (Exception exception3) { object[] objArray3 = new object[] { exception3.Message, exception3.StackTrace }; DebugHelper.Assert(false, "Error In HandleLobbyMsgRecv: {0}, Call stack : {1}", objArray3); } try { this.HandleGameMsgRecv(); } catch (Exception exception4) { object[] objArray4 = new object[] { exception4.Message, exception4.StackTrace }; DebugHelper.Assert(false, "Error In HandleGameMsgRecv: {0}, Call stack : {1}", objArray4); } } }
public void ParseLevelRewardData() { Dictionary <long, object> .Enumerator enumerator = GameDataMgr.resPvpLevelRewardDatabin.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, object> current = enumerator.get_Current(); ResPvpLevelReward resPvpLevelReward = (ResPvpLevelReward)current.get_Value(); if (resPvpLevelReward != null && this.GetLevelRewardData(resPvpLevelReward.iLevel) == null) { LevelRewardData levelRewardData = new LevelRewardData(); levelRewardData.m_level = resPvpLevelReward.iLevel; levelRewardData.m_resLevelReward = resPvpLevelReward; DebugHelper.Assert(resPvpLevelReward.astLockInfo.Length <= 2, "ParseLevelRewardData 等级奖励配置表配 解锁数量不该超过2个, 翔哥 check out..."); for (int i = 0; i < resPvpLevelReward.astLockInfo.Length; i++) { ResDT_LevelReward_UnlockInfo resDT_LevelReward_UnlockInfo = resPvpLevelReward.astLockInfo[i]; if (resDT_LevelReward_UnlockInfo != null) { levelRewardData.astLockInfo[i] = resDT_LevelReward_UnlockInfo; } } this.m_levelRewardDataMap.Add(levelRewardData); } } Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.taskDatabin.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <long, object> current2 = enumerator2.get_Current(); ResTask resTask = (ResTask)current2.get_Value(); if (resTask != null && resTask.dwOpenType == 2u) { int iParam = resTask.astOpenTaskParam[0].iParam; LevelRewardData levelRewardData2 = this.GetLevelRewardData(iParam); if (levelRewardData2 != null && levelRewardData2.GetResTaskIDIndex(resTask.dwTaskID) == -1) { int fristNullResTaskIndex = levelRewardData2.GetFristNullResTaskIndex(); if (fristNullResTaskIndex != -1) { levelRewardData2.task_ids[fristNullResTaskIndex] = resTask; } } } } }
private void InitSelfFuncList() { DebugHelper.Assert(this.m_panelObj != null); if (this.m_panelObj == null) { return; } Transform transform = this.m_panelObj.transform.FindChild("SelfFuncList"); CUIMiniEventScript component = transform.GetChild(0).GetComponent <CUIMiniEventScript>(); component.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[] { CTrainingHelper.ECheatAct.LevelUp, CTrainingHelper.ECheatAct.FullHp, CTrainingHelper.ECheatAct.FullEp }); component.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[1]); CUIMiniEventScript component2 = transform.GetChild(1).GetComponent <CUIMiniEventScript>(); component2.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[] { CTrainingHelper.ECheatAct.SetLevel, CTrainingHelper.ECheatAct.FullHp, CTrainingHelper.ECheatAct.FullEp }); component2.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[1]); component2.m_onClickEventParams.tag3 = 1; CUIMiniEventScript component3 = transform.GetChild(2).GetComponent <CUIMiniEventScript>(); component3.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[] { CTrainingHelper.ECheatAct.ToggleZeroCd }); component3.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[1]); this.m_cdBtnToggle = component3.gameObject; CUIMiniEventScript component4 = transform.GetChild(3).GetComponent <CUIMiniEventScript>(); component4.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[] { CTrainingHelper.ECheatAct.ToggleInvincible }); component4.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[1]); this.m_invincibleBtnToggle = component4.gameObject; }
public bool Reset(int LevelID, bool bMultiGame) { this.Clear(); ResDT_LevelCommonInfo outLevelComInfo = null; if (bMultiGame) { outLevelComInfo = CLevelCfgLogicManager.FindLevelConfigMultiGame(LevelID); } else { ResLevelCfgInfo outLevelCfg = null; CLevelCfgLogicManager.FindLevelConfigSingleGame(LevelID, out outLevelCfg, out outLevelComInfo); } bool flag = false; if (outLevelComInfo != null) { this.CurLevelTimeDuration = outLevelComInfo.dwTimeDuration; if (outLevelComInfo.dwAddWinCondStarId != 0) { ResEvaluateStarInfo dataByKey = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddWinCondStarId); DebugHelper.Assert(dataByKey != null); if (dataByKey != null) { this.WinnerEvaluation = this.CreateStar(dataByKey); DebugHelper.Assert(this.WinnerEvaluation != null, "我擦,怎会没有?"); flag = true; } } if (outLevelComInfo.dwAddLoseCondStarId != 0) { ResEvaluateStarInfo conditionDetail = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddLoseCondStarId); DebugHelper.Assert(conditionDetail != null); if (conditionDetail != null) { this.LoserEvaluation = this.CreateStar(conditionDetail); DebugHelper.Assert(this.LoserEvaluation != null, "我擦,怎会没有?"); flag = true; } } } return(flag); }
private void OnActorDamageAtker(ref HurtEventResultInfo prm) { if (prm.atker && prm.atker.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && prm.hurtInfo.hurtType != HurtTypeDef.Therapic) { DictionaryView <uint, NONHERO_STATISTIC_INFO> dictionaryView; if (!this.m_NonHeroInfo.TryGetValue((uint)prm.atker.get_handle().TheActorMeta.ActorType, ref dictionaryView)) { dictionaryView = new DictionaryView <uint, NONHERO_STATISTIC_INFO>(); this.m_NonHeroInfo.Add((uint)prm.atker.get_handle().TheActorMeta.ActorType, dictionaryView); } NONHERO_STATISTIC_INFO nONHERO_STATISTIC_INFO; if (!dictionaryView.TryGetValue(prm.atker.get_handle().TheActorMeta.ActorCamp, ref nONHERO_STATISTIC_INFO)) { nONHERO_STATISTIC_INFO = new NONHERO_STATISTIC_INFO(); dictionaryView.Add(prm.atker.get_handle().TheActorMeta.ActorCamp, nONHERO_STATISTIC_INFO); } nONHERO_STATISTIC_INFO.uiTotalAttackNum += 1u; nONHERO_STATISTIC_INFO.uiTotalHurtCount += (uint)prm.hurtTotal; nONHERO_STATISTIC_INFO.uiHurtMax = (uint)((nONHERO_STATISTIC_INFO.uiHurtMax <= (uint)prm.hurtTotal) ? prm.hurtTotal : ((int)nONHERO_STATISTIC_INFO.uiHurtMax)); nONHERO_STATISTIC_INFO.uiHurtMin = (uint)((nONHERO_STATISTIC_INFO.uiHurtMin >= (uint)prm.hurtTotal) ? prm.hurtTotal : ((int)nONHERO_STATISTIC_INFO.uiHurtMin)); DebugHelper.Assert(prm.atker.get_handle().SkillControl != null, "empty skill control"); if (prm.atker.get_handle().SkillControl != null && prm.atker.get_handle().SkillControl.stSkillStat != null && prm.atker.get_handle().SkillControl.stSkillStat.SkillStatistictInfo != null) { int atkSlot = (int)prm.hurtInfo.atkSlot; int num = prm.atker.get_handle().SkillControl.stSkillStat.SkillStatistictInfo.Length; bool flag = atkSlot >= 0 && atkSlot < num; if (flag) { SKILLSTATISTICTINFO sKILLSTATISTICTINFO = prm.atker.get_handle().SkillControl.stSkillStat.SkillStatistictInfo[(int)prm.hurtInfo.atkSlot]; nONHERO_STATISTIC_INFO.uiAttackDistanceMax = (uint)sKILLSTATISTICTINFO.iAttackDistanceMax; if (prm.atker.get_handle().SkillControl.CurUseSkillSlot != null && prm.atker.get_handle().SkillControl.CurUseSkillSlot.SkillObj != null && prm.atker.get_handle().SkillControl.CurUseSkillSlot.SkillObj.cfgData != null) { uint num2 = prm.atker.get_handle().SkillControl.CurUseSkillSlot.SkillObj.cfgData.iMaxAttackDistance; nONHERO_STATISTIC_INFO.uiAttackDistanceMin = ((nONHERO_STATISTIC_INFO.uiAttackDistanceMin >= num2) ? num2 : nONHERO_STATISTIC_INFO.uiAttackDistanceMin); } } } if (nONHERO_STATISTIC_INFO.uiFirstBeAttackTime == 0u) { nONHERO_STATISTIC_INFO.uiFirstBeAttackTime = (uint)Singleton <FrameSynchr> .get_instance().LogicFrameTick; } this.m_NonHeroInfo.get_Item((uint)prm.atker.get_handle().TheActorMeta.ActorType).set_Item(prm.atker.get_handle().TheActorMeta.ActorCamp, nONHERO_STATISTIC_INFO); } }
protected override void Update() { if (base.isInitialize) { base.Update(); } else { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CBattleEquipSystem.s_equipFormPath); if (form != null) { GameObject gameObject = form.GetWidget(1).transform.FindChild("equipItem0").gameObject; DebugHelper.Assert(gameObject != null, "Can't find equipItem0~!!"); base.AddHighLightGameObject(gameObject, true, form, true, new GameObject[0]); base.Initialize(); } } }
public IArgumentDescription GetDescription(Type InType) { IEnumerator <KeyValuePair <int, IArgumentDescription> > enumerator = this.Descriptions.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, IArgumentDescription> current = enumerator.get_Current(); if (current.get_Value().Accept(InType)) { KeyValuePair <int, IArgumentDescription> current2 = enumerator.get_Current(); return(current2.get_Value()); } } DebugHelper.Assert(false, "can't find valid description for {0}, internal error!", new object[] { InType.get_Name() }); return(null); }
public void HeroSelectTobattle() { try { this.m_bGetIsBattleSupportVoice = false; this.m_IsBattleSupportVoice = false; this.m_bInHeroSelectUI = false; this.m_SoundLevel_HeroSelect = null; this.m_VoiceBtn = null; MonoSingleton <VoiceSys> .GetInstance().ClosenSpeakers(); this.CloseHeroSelctVoice(); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message, exception.StackTrace }; DebugHelper.Assert(false, "Exception in HeroSelectTobattle {0} {1}", inParameters); } }
public void ConnectActorRootAndPlayer(ref PoolObjHandle <ActorRoot> hero) { if (!hero) { DebugHelper.Assert(false, "Failed Connect Actor Root And Player, hero is null"); return; } Player player = this.GetPlayer(hero.get_handle().TheActorMeta.PlayerId); if (player == null) { DebugHelper.Assert(false, "Failed Find palyer {0}, failed connect actor.", new object[] { hero.get_handle().TheActorMeta.PlayerId }); return; } player.ConnectHeroActorRoot(ref hero); }
private bool BindNewElite(PoolObjHandle <ActorRoot> inMonster) { if (!inMonster) { return(false); } DebugHelper.Assert(!this.eliteActor); this.eliteActor = inMonster; this.eliteActorName = this.QueryEliteName(this.eliteActor); if (this.eliteActor.handle.ValueComponent != null) { this.eliteActor.handle.ValueComponent.HpChgEvent += new ValueChangeDelegate(this.OnEliteHpChange); } this.ChangeToElite(); this.OnEliteHpChange(); this.OpenEliteBar(); this.ToCloseEliteBar(10000); return(true); }
public CheatCommandName(string InName) { DebugHelper.Assert(!string.IsNullOrEmpty(InName)); this.rawName = InName; char[] separator = new char[] { '/' }; string[] inStringArray = InName.Split(separator); if ((inStringArray != null) && (inStringArray.Length > 1)) { this.baseName = inStringArray[inStringArray.Length - 1]; this.groupName = inStringArray[inStringArray.Length - 2]; this.groupHierarchies = LinqS.Take(inStringArray, inStringArray.Length - 1); } else { this.baseName = InName; this.groupName = "通用"; this.groupHierarchies = new string[] { this.groupName }; } }
private void onDragon_Born(ActorRoot actor) { DragonIcon.DragonNode dragonNode = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType()); DebugHelper.Assert(dragonNode != null, "onDragon_Born mmDNode_ugui == null, check out..."); if (dragonNode == null) { return; } MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys; bool bRefreshCache = theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini; dragonNode.SetData(actor.myTransform.position, (int)actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5, true, bRefreshCache, true); dragonNode.ShowDead(actor.ActorControl.IsDeadState); byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType(); if (actorSubSoliderType == 8 || actorSubSoliderType == 9 || actorSubSoliderType == 13) { bool flag = theMinimapSys != null && theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini; if (flag) { Camera currentCamera = Singleton <Camera_UI3D> .GetInstance().GetCurrentCamera(); if (currentCamera != null) { Vector3 v = currentCamera.WorldToScreenPoint((!flag) ? dragonNode.bmDragonNode_3dui.transform.position : dragonNode.mmDragonNode_3dui.transform.position); Singleton <CUIParticleSystem> .get_instance().AddParticle(DragonIcon.dragonBornEffect, 3f, v); } } } if (actorSubSoliderType == 8) { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_DaLong_VO_Refresh"); } else if (actorSubSoliderType == 9) { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_XiaoLong_VO_Refresh"); } else { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_BaoJun_VO_Anger"); } }
private void OnActorDamageAtker(ref HurtEventResultInfo prm) { if (((prm.atker != 0) && (prm.atker.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) && (prm.hurtInfo.hurtType != HurtTypeDef.Therapic)) { DictionaryView <uint, NONHERO_STATISTIC_INFO> view; NONHERO_STATISTIC_INFO nonhero_statistic_info; if (!this.m_NonHeroInfo.TryGetValue((uint)prm.atker.handle.TheActorMeta.ActorType, out view)) { view = new DictionaryView <uint, NONHERO_STATISTIC_INFO>(); this.m_NonHeroInfo.Add((uint)prm.atker.handle.TheActorMeta.ActorType, view); } if (!view.TryGetValue((uint)prm.atker.handle.TheActorMeta.ActorCamp, out nonhero_statistic_info)) { nonhero_statistic_info = new NONHERO_STATISTIC_INFO(); view.Add((uint)prm.atker.handle.TheActorMeta.ActorCamp, nonhero_statistic_info); } nonhero_statistic_info.uiTotalAttackNum++; nonhero_statistic_info.uiTotalHurtCount += (uint)prm.hurtTotal; nonhero_statistic_info.uiHurtMax = (nonhero_statistic_info.uiHurtMax <= prm.hurtTotal) ? ((uint)prm.hurtTotal) : nonhero_statistic_info.uiHurtMax; nonhero_statistic_info.uiHurtMin = (nonhero_statistic_info.uiHurtMin >= prm.hurtTotal) ? ((uint)prm.hurtTotal) : nonhero_statistic_info.uiHurtMin; DebugHelper.Assert(prm.atker.handle.SkillControl != null, "empty skill control"); if (((prm.atker.handle.SkillControl != null) && (prm.atker.handle.SkillControl.stSkillStat != null)) && (prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo != null)) { int atkSlot = (int)prm.hurtInfo.atkSlot; int length = prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo.Length; if ((atkSlot >= 0) && (atkSlot < length)) { SKILLSTATISTICTINFO skillstatistictinfo = prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo[(int)prm.hurtInfo.atkSlot]; nonhero_statistic_info.uiAttackDistanceMax = (uint)skillstatistictinfo.iAttackDistanceMax; if (((prm.atker.handle.SkillControl.CurUseSkillSlot != null) && (prm.atker.handle.SkillControl.CurUseSkillSlot.SkillObj != null)) && (prm.atker.handle.SkillControl.CurUseSkillSlot.SkillObj.cfgData != null)) { uint iMaxAttackDistance = (uint)prm.atker.handle.SkillControl.CurUseSkillSlot.SkillObj.cfgData.iMaxAttackDistance; nonhero_statistic_info.uiAttackDistanceMin = (nonhero_statistic_info.uiAttackDistanceMin >= iMaxAttackDistance) ? iMaxAttackDistance : nonhero_statistic_info.uiAttackDistanceMin; } } } if (nonhero_statistic_info.uiFirstBeAttackTime == 0) { nonhero_statistic_info.uiFirstBeAttackTime = (uint)Singleton <FrameSynchr> .instance.LogicFrameTick; } this.m_NonHeroInfo[(uint)prm.atker.handle.TheActorMeta.ActorType][(uint)prm.atker.handle.TheActorMeta.ActorCamp] = nonhero_statistic_info; } }
protected override void Update() { if (base.isInitialize) { base.Update(); } else { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FightForm.s_battleUIForm); if (form != null) { GameObject gameObject = form.GetWidget(0x2d).transform.FindChild("EquipBtn").gameObject; DebugHelper.Assert(gameObject != null, "Can't find EquipBtn~!!"); base.AddHighLightGameObject(gameObject, true, form, true); base.Initialize(); } } }
private static int ComparisonItem(CUseable a, CUseable b) { DebugHelper.Assert(a != null && b != null, "a = {0}, b = {1}", new object[] { a, b }); a.m_itemSortNum = ((a == null) ? 0uL : ((a is CItem) ? CUseableContainer.GetSortNumByPropType((RES_PROP_TYPE_TYPE)(a as CItem).m_itemData.bType) : 0uL)); b.m_itemSortNum = ((b == null) ? 0uL : ((b is CItem) ? CUseableContainer.GetSortNumByPropType((RES_PROP_TYPE_TYPE)(b as CItem).m_itemData.bType) : 0uL)); if (a.m_itemSortNum < b.m_itemSortNum) { return(1); } if (a.m_itemSortNum > b.m_itemSortNum) { return(-1); } return((a.m_getTime == b.m_getTime) ? 0 : ((a.m_getTime > b.m_getTime) ? -1 : 1)); }
public bool IsTaskAllCompelete(RES_TASK_TYPE type) { ListView <CTask> listView = this.task_Data.GetListView(type); DebugHelper.Assert(listView != null); if (listView == null) { return(false); } for (int i = 0; i < listView.Count; i++) { CTask task = listView[i]; if ((task != null) && (task.m_taskState != 6)) { return(false); } } return(true); }
public bool UpdateTails() { if (!this.bHasTailPart) { return(false); } try { this.UpdateLogicPartB(this.nTailPartDelta); this.bHasTailPart = false; } catch (Exception exception) { object[] inParameters = new object[] { exception.Message, exception.StackTrace }; DebugHelper.Assert(false, "exception in GameLogic.UpdateTails:{0}, \n {1}", inParameters); this.bHasTailPart = false; } return(true); }
public bool IsAnyTaskInState(enTaskTab type, CTask.State state) { ListView <CTask> listView = this.task_Data.GetListView((int)type); DebugHelper.Assert(listView != null); if (listView == null) { return(false); } for (int i = 0; i < listView.get_Count(); i++) { CTask cTask = listView.get_Item(i); if (cTask != null && cTask.m_taskState == (byte)state) { return(true); } } return(false); }
private static int ComparisonItem(CUseable a, CUseable b) { DebugHelper.Assert(a != null && b != null, "a = {0}, b = {1}", new object[] { a, b }); a.m_itemSortNum = ((a != null) ? ((!(a is CItem)) ? 0uL : CUseableContainer.GetSortNumByPropType((a as CItem).m_itemData.bType)) : 0uL); b.m_itemSortNum = ((b != null) ? ((!(b is CItem)) ? 0uL : CUseableContainer.GetSortNumByPropType((b as CItem).m_itemData.bType)) : 0uL); if (a.m_itemSortNum < b.m_itemSortNum) { return(1); } if (a.m_itemSortNum > b.m_itemSortNum) { return(-1); } return((a.m_getTime != b.m_getTime) ? ((a.m_getTime <= b.m_getTime) ? 1 : -1) : 0); }
private long GetDataKey(T data) { FieldInfo field = data.GetType().GetField(this.keyName); object[] inParameters = new object[] { this.keyName, this.name }; DebugHelper.Assert(field != null, "Failed Get Databin key feild {0}, Databin:{1}", inParameters); object obj2 = field.GetValue(data); try { return(Convert.ToInt64(obj2)); } catch (Exception exception) { object[] objArray2 = new object[] { obj2, exception.Message }; DebugHelper.Assert(false, "Exception in Databin Get Key, {0}, {1}", objArray2); } return(0L); }
public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go) { DebugHelper.Assert(!Singleton <BattleLogic> .get_instance().isFighting || Singleton <GameLogic> .get_instance().bInLogicTick || Singleton <FrameSynchr> .get_instance().isCmdExecuting); ActorConfig actorConfig = go.GetComponent <ActorConfig>(); if (null == actorConfig) { actorConfig = go.AddComponent <ActorConfig>(); } ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ActorType = ActorTypeDef.Invalid; actorMeta = actorMeta2; PoolObjHandle <ActorRoot> result = actorConfig.AttachActorRoot(go, ref actorMeta, null); result.get_handle().Spawned(); return(result); }
private void ConfigureSubmodule(int idx, bool enabled) { DebugHelper.Assert(idx >= 0 && idx < NumberOfSubmodules); if (idx != 0) { this.Log(LogLevel.Warning, "Currently only submodule 0 is supported"); return; } if (enabled) { ReloadTimer(false); ReloadTimer(true); } halfCycleTimer.Enabled = enabled; fullCycleTimer.Enabled = enabled; }
public void AddHero(uint heroCfgId) { if ((heroCfgId != 0) && !this._heroIds.Contains(heroCfgId)) { if (this._heroIds.Count >= 3) { DebugHelper.Assert(false, "已经给player添加了三个英雄但是还在尝试继续添加"); } else { this._heroIds.Add(heroCfgId); if (!this.Computer) { if (Singleton <GamePlayerCenter> .instance.HostPlayerId == this.PlayerId) { object[] inParameters = new object[] { this.PlayerId, heroCfgId }; DebugHelper.CustomLog("Player {0} adds Hero {1}", inParameters); } } else if (string.IsNullOrEmpty(this.Name)) { ActorStaticData actorData = new ActorStaticData(); ActorMeta actorMeta = new ActorMeta(); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); actorMeta.PlayerId = this.PlayerId; actorMeta.ActorType = ActorTypeDef.Actor_Type_Hero; actorMeta.ConfigId = (int)heroCfgId; string str = !actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData) ? null : actorData.TheResInfo.Name; this.Name = string.Format("{0}[{1}]", str, Singleton <CTextManager> .GetInstance().GetText("PVP_NPC")); } if (this._heroIds.Count == 1) { this.CaptainId = heroCfgId; if (Singleton <GamePlayerCenter> .instance.HostPlayerId == this.PlayerId) { object[] objArray2 = new object[] { this.CaptainId }; DebugHelper.CustomLog("Set Captain ID {0}", objArray2); } } } } }
public bool SaveTo(FieldObj inFieldObj) { DebugHelper.Assert(inFieldObj != null); DebugHelper.Assert(inFieldObj.m_fowCells != null); MemoryStream memoryStream = new MemoryStream(); BinaryWriter binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(this.VerificationCode); binaryWriter.Write(this.Version); binaryWriter.Write(this.CrcCode); int num = inFieldObj.NumX * inFieldObj.NumY; binaryWriter.Write(num); for (int i = 0; i < num; i++) { FOWSurfCell fOWSurfCell = inFieldObj.m_fowCells[i]; if (fOWSurfCell.bValid) { int dataSize = fOWSurfCell.GetDataSize(); binaryWriter.Write(dataSize); DebugHelper.Assert(fOWSurfCell.data != null); int[] array = new int[fOWSurfCell.data.Length]; for (int j = 0; j < array.Length; j++) { array[j] = (int)fOWSurfCell.data[j]; } byte[] array2 = FOGameFowOfflineSerializer.IntArrToByteArr(array); binaryWriter.Write(array2, 0, array2.Length); } else { int num2 = 0; binaryWriter.Write(num2); } } binaryWriter.Write(987654321); binaryWriter.Flush(); memoryStream.Flush(); inFieldObj.fowOfflineData = memoryStream.ToArray(); binaryWriter.Close(); memoryStream.Close(); return(true); }
public void LateUpdate() { try { if (this.CheckShouldUpdate()) { this.UpdateAndDrawAttackLinker3D(); this.UpdateHeroAtkBtnDistance(); } } catch (Exception ex) { DebugHelper.Assert(false, "exception in DrawAttackLinker:{0}, \n {1}", new object[] { ex.get_Message(), ex.get_StackTrace() }); } }
private TriangleMeshNode checkObjIntersects(ref int edge, VInt3 start, VInt3 end, int gridX, int gridY) { List <object> objs = this.rasterizer.GetObjs(gridX, gridY); if (objs == null || objs.get_Count() == 0) { return(null); } VInt3[] array = new VInt3[3]; TriangleMeshNode triangleMeshNode = null; int num = -1; long num2 = 9223372036854775807L; for (int i = 0; i < objs.get_Count(); i++) { TriangleMeshNode triangleMeshNode2 = objs.get_Item(i) as TriangleMeshNode; triangleMeshNode2.GetPoints(out array[0], out array[1], out array[2]); for (int j = 0; j < 3; j++) { int num3 = j; int num4 = (j + 1) % 3; if (Polygon.Intersects(array[num3], array[num4], start, end)) { bool flag; VInt3 vInt = Polygon.IntersectionPoint(ref array[num3], ref array[num4], ref start, ref end, out flag); DebugHelper.Assert(flag); long num5 = start.XZSqrMagnitude(ref vInt); if (num5 < num2) { num2 = num5; triangleMeshNode = triangleMeshNode2; num = j; } } } } if (num != -1 && triangleMeshNode != null) { edge = num; return(triangleMeshNode); } return(null); }
protected override void Update() { if (base.isInitialize) { base.Update(); return; } CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CBattleEquipSystem.s_equipFormPath); if (form == null) { return; } GameObject gameObject = form.GetWidget(6).transform.FindChild("buyBtn").gameObject; DebugHelper.Assert(gameObject != null, "Can't find buybtn~!!"); base.AddHighLightGameObject(gameObject, true, form, true); base.Initialize(); }
private void On_Friend_SNS_STATE_NTF(CSPkg msg) { SCPKG_NTF_SNS_FRIEND stNtfSnsFriend = msg.stPkgData.stNtfSnsFriend; int num = 0; while ((long)num < (long)((ulong)stNtfSnsFriend.dwSnsFriendNum)) { CSDT_SNS_FRIEND_INFO cSDT_SNS_FRIEND_INFO = stNtfSnsFriend.astSnsFriendList[num]; if (cSDT_SNS_FRIEND_INFO != null && cSDT_SNS_FRIEND_INFO.bVideoState != 0) { if (cSDT_SNS_FRIEND_INFO.stGameInfo.stDetail == null) { DebugHelper.Assert(false, "SCPKG_NTF_SNS_FRIEND [bMultGameSubState == COM_ACNT_MULTIGAME_GAMING] and [stGameInfo.stDetail == null] , this is sever' guo!"); } else { bool flag = false; for (int i = 0; i < this.OBFriendList.get_Count(); i++) { if (stNtfSnsFriend.astSnsFriendList[num].stSnsFrindInfo.stUin.ullUid == this.OBFriendList.get_Item(i).uin.ullUid) { COBSystem.stOBFriend stOBFriend = this.OBFriendList.get_Item(i); stOBFriend.gameDetail = stNtfSnsFriend.astSnsFriendList[num].stGameInfo.stDetail; this.OBFriendList.set_Item(i, stOBFriend); flag = true; break; } } if (!flag) { COBSystem.stOBFriend stOBFriend2 = default(COBSystem.stOBFriend); stOBFriend2.uin = stNtfSnsFriend.astSnsFriendList[num].stSnsFrindInfo.stUin; stOBFriend2.friendName = Utility.UTF8Convert(stNtfSnsFriend.astSnsFriendList[num].stSnsFrindInfo.szUserName); stOBFriend2.headUrl = Utility.UTF8Convert(stNtfSnsFriend.astSnsFriendList[num].stSnsFrindInfo.szHeadUrl); stOBFriend2.gameDetail = stNtfSnsFriend.astSnsFriendList[num].stGameInfo.stDetail; this.OBFriendList.Add(stOBFriend2); } } } num++; } this.UpdateView(); }