public static CAchieveInfo2 GetAchieveInfo(int logicWorldID, ulong playerUUID, bool isMaster = false) { if (CAchieveInfo2._masterAchieveInfo != null && CAchieveInfo2._masterAchieveInfo.m_logicWorldID == logicWorldID && CAchieveInfo2._masterAchieveInfo.m_playerUUID == playerUUID) { isMaster = true; } if (isMaster) { if (CAchieveInfo2._masterAchieveInfo == null) { CAchieveInfo2._masterAchieveInfo = new CAchieveInfo2(logicWorldID, playerUUID); } return(CAchieveInfo2._masterAchieveInfo); } if (CAchieveInfo2._otherAchieveInfo2 == null) { CAchieveInfo2._otherAchieveInfo2 = new CAchieveInfo2(logicWorldID, playerUUID); return(CAchieveInfo2._otherAchieveInfo2); } if (CAchieveInfo2._otherAchieveInfo2.m_logicWorldID == logicWorldID && CAchieveInfo2._otherAchieveInfo2.m_playerUUID == playerUUID) { return(CAchieveInfo2._otherAchieveInfo2); } CAchieveInfo2._otherAchieveInfo2 = new CAchieveInfo2(logicWorldID, playerUUID); return(CAchieveInfo2._otherAchieveInfo2); }
public static void OnReceiveGetTrophyRewardRsp(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_GET_TROPHYLVL_REWARD_RSP stGetTrophyLvlmentRewardRsp = msg.stPkgData.stGetTrophyLvlmentRewardRsp; if (stGetTrophyLvlmentRewardRsp.iResult < 0) { Singleton <CUIManager> .GetInstance().OpenTips(string.Format("奖励领取失败,请稍后再试 {0}", stGetTrophyLvlmentRewardRsp.iResult), false, 1.5f, null, new object[0]); return; } CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); int num = (int)(stGetTrophyLvlmentRewardRsp.dwTrophyLvl - 1u); if (num < 0 || (long)num > (long)((ulong)masterAchieveInfo.TrophyRewardInfoArrCnt)) { return; } CTrophyRewardInfo cTrophyRewardInfo = masterAchieveInfo.TrophyRewardInfoArr[num]; CUseable[] trophyRewards = cTrophyRewardInfo.GetTrophyRewards(); Singleton <CUIManager> .instance.OpenAwardTip(trophyRewards, null, false, enUIEventID.None, false, false, "Form_Award"); cTrophyRewardInfo.State = TrophyState.GotRewards; Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ACHIEVE_TROPHY_REWARD_INFO_STATE_CHANGE); }
public void ShowTrophyDetail(CAchieveInfo2 achieveInfo, uint achievementID) { CAchieveItem2 cAchieveItem = null; if (achieveInfo.m_AchiveItemDic.ContainsKey(achievementID)) { cAchieveItem = achieveInfo.m_AchiveItemDic[achievementID]; } if (cAchieveItem == null) { return; } this.m_CurAchieveItem = cAchieveItem.GetHead(); int achievementCnt = this.m_CurAchieveItem.GetAchievementCnt(); CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm("UGUI/Form/System/Achieve/Form_Trophy_Detail.prefab", false, true); if (cUIFormScript != null) { Text component = cUIFormScript.GetWidget(1).GetComponent <Text>(); if (component != null) { component.set_text(this.m_CurAchieveItem.Cfg.szName); } Text component2 = cUIFormScript.GetWidget(2).GetComponent <Text>(); if (component2 != null) { component2.set_text(this.m_CurAchieveItem.GetAchievementTips()); } CUIListScript component3 = cUIFormScript.GetWidget(0).GetComponent <CUIListScript>(); if (component3 != null) { component3.SetElementAmount(achievementCnt); } } }
private void OnChangeAchievement(CUIEvent uiEvent) { CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); ListView <CAchieveItem2> listView = new ListView <CAchieveItem2>(); this.m_CurTrophies = masterAchieveInfo.GetTrophies(enTrophyState.Finish); for (int i = this.m_CurTrophies.Count - 1; i >= 0; i--) { if (this.m_CurTrophies[i] != null && Array.IndexOf <CAchieveItem2>(this.SelectedTrophies, this.m_CurTrophies[i]) < 0) { listView.Add(this.m_CurTrophies[i]); } } if (listView.Count == 0) { Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Select_Err_1"), false, 1.5f, null, new object[0]); return; } if (uiEvent.m_eventParams.tag >= 0 && uiEvent.m_eventParams.tag < this.SelectedTrophies.Length) { this.TargetReplaceIdx = (byte)uiEvent.m_eventParams.tag; CUIFormScript form = Singleton <CUIManager> .GetInstance().OpenForm("UGUI/Form/System/Achieve/Form_Trophy_Select.prefab", false, true); this.RefreshAchievementSelectForm(form); return; } Singleton <CUIManager> .GetInstance().OpenTips("数据异常,请稍后重试", false, 1.5f, null, new object[0]); }
private void OnTrophyClick(CUIEvent uiEvent) { CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); uint commonUInt32Param = uiEvent.m_eventParams.commonUInt32Param1; this.ShowTrophyDetail(masterAchieveInfo, commonUInt32Param); }
private void OnMenuChange(CUIEvent uiEvent) { CUIListScript cUIListScript = uiEvent.m_srcWidgetScript as CUIListScript; if (cUIListScript == null) { return; } int selectedIndex = cUIListScript.GetSelectedIndex(); if (selectedIndex < 0 || selectedIndex > 2) { DebugHelper.Assert(false, "Achievement type form selected menu indx out of range!"); return; } this.CurMenu = (CAchievementSystem.enTypeMenu)selectedIndex; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); this.m_CurAchieveSeries = new ListView <CAchieveItem2>(); CAchievementSystem.enTypeMenu curMenu = this.CurMenu; if (curMenu != CAchievementSystem.enTypeMenu.All) { if (curMenu == CAchievementSystem.enTypeMenu.Not_Finish) { this.m_CurAchieveSeries = masterAchieveInfo.GetTrophies(enTrophyState.UnFinish); this.m_CurAchieveSeries.Sort(new CAchieveSort()); } } else { this.m_CurAchieveSeries = masterAchieveInfo.GetTrophies(enTrophyState.All); this.m_CurAchieveSeries.Sort(new CAchieveSort()); } this.RefreshOverviewForm(uiEvent.m_srcFormScript); }
public static void OnNotifyAchieveDoneDataChange(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_ACHIEVEMENT_DONE_DATA_CHG_NTF stAchievementDoneDataChgNtf = msg.stPkgData.stAchievementDoneDataChgNtf; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); masterAchieveInfo.OnAchieveDoneDataChange(stAchievementDoneDataChgNtf.stAchievementDoneData); }
public static void OnRecieveAchieveInfo(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_ACHIEVEMENT_INFO_NTF stGetAchievememtInfoNtf = msg.stPkgData.stGetAchievememtInfoNtf; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); masterAchieveInfo.OnServerAchieveInfo(ref stGetAchievememtInfoNtf.stAchievementInfo); }
public static void OnTrophyLevelUp(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_NTF_TROPHYLVLUP stNtfTrophyLvlUp = msg.stPkgData.stNtfTrophyLvlUp; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); masterAchieveInfo.TrophyLevelUp(stNtfTrophyLvlUp.dwOldTrophyLvl, stNtfTrophyLvlUp.dwNewTrophyLvl); Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ACHIEVE_TROPHY_REWARD_INFO_STATE_CHANGE); }
public static void OnNotifyAchieveStateChange(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_ACHIEVEMENT_STATE_CHG_NTF stAchievementStateChgNtf = msg.stPkgData.stAchievementStateChgNtf; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); masterAchieveInfo.ChangeAchieveState(ref stAchievementStateChgNtf.stAchievementData); Singleton <CAchievementSystem> .GetInstance().ProcessMostRecentlyDoneAchievements(false); Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ACHIEVE_TROPHY_REWARD_INFO_STATE_CHANGE); }
private void OnGetTrophyReward(CUIEvent uiEvent) { int tag = uiEvent.m_eventParams.tag; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); CTrophyRewardInfo[] trophyRewardInfoArr = masterAchieveInfo.TrophyRewardInfoArr; if (tag < 0 || tag >= trophyRewardInfoArr.Length) { return; } CTrophyRewardInfo cTrophyRewardInfo = trophyRewardInfoArr[tag]; this.SendGetTrophyRewardReq(cTrophyRewardInfo.Cfg.dwTrophyLvl); }
private void OnBrowseAllRewards(CUIEvent uiEvent) { CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm("UGUI/Form/System/Achieve/Form_Trophy_Rewards.prefab", false, true); CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); CUIListScript component = cUIFormScript.GetWidget(0).GetComponent <CUIListScript>(); if (component != null) { this.m_TrophyRewardInfoWithRewardList = masterAchieveInfo.GetTrophyRewardInfoWithRewards(); this.m_TrophyRewardInfoWithRewardList.Sort(new CTrophyRewardInfoSort()); component.SetElementAmount(this.m_TrophyRewardInfoWithRewardList.Count); } }
public static void Clear() { if (CAchieveInfo2._masterAchieveInfo != null) { CAchieveInfo2._masterAchieveInfo.ClearData(); CAchieveInfo2._masterAchieveInfo = null; } if (CAchieveInfo2._otherAchieveInfo2 != null) { CAchieveInfo2._otherAchieveInfo2.ClearData(); CAchieveInfo2._otherAchieveInfo2 = null; } CAchieveInfo2.worldRanks.Clear(); }
public static CAchieveInfo2 GetMasterAchieveInfo() { if (CAchieveInfo2._masterAchieveInfo != null) { return(CAchieveInfo2._masterAchieveInfo); } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { DebugHelper.Assert(false, "GetMasterAchieveInfo::Master Role Info Is Null"); return(CAchieveInfo2.GetAchieveInfo(0, 0uL, true)); } return(CAchieveInfo2.GetAchieveInfo(masterRoleInfo.logicWorldID, masterRoleInfo.playerUllUID, true)); }
private void OnContinueProcessDoneAchievements(CUIEvent uiEvent) { this.m_isShowing = false; CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); if (masterAchieveInfo.MostLatelyDoneAchievements.get_Count() == 0) { return; } masterAchieveInfo.MostLatelyDoneAchievements.RemoveAt(0); Singleton <CTimerManager> .GetInstance().AddTimer(200, 1, delegate(int sequence) { this.Process(false); }); }
public void Process(bool force = false) { if (this.m_isShowing) { return; } CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); if (masterAchieveInfo.MostLatelyDoneAchievements.get_Count() == 0) { return; } if (!Singleton <CLobbySystem> .GetInstance().IsInLobbyForm() || Singleton <CMatchingSystem> .GetInstance().IsInMatching || Singleton <CMatchingSystem> .GetInstance().IsInMatchingTeam || Singleton <CUIManager> .GetInstance().GetForm(CMatchingSystem.PATH_MATCHING_CONFIRMBOX) != null) { return; } if (!force) { string[] array = new string[] { Singleton <CMallSystem> .GetInstance().sMallFormPath, "Form_NewHeroOrSkin.prefab" }; for (int i = 0; i < array.Length; i++) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(array[i]); if (form != null && !form.IsClosed()) { return; } } } CUIFormScript form2 = Singleton <CUIManager> .GetInstance().GetForm("Form_NobeLevelUp.prefab"); if (form2 != null && !form2.IsClosed()) { return; } uint num = masterAchieveInfo.MostLatelyDoneAchievements.get_Item(0); if (!masterAchieveInfo.m_AchiveItemDic.ContainsKey(num)) { return; } this.OpenShareForm(num); }
private void RankingListChange(RankingSystem.RankingType rankType) { if (rankType == RankingSystem.RankingType.Achievement) { CSDT_RANKING_LIST_SUCC rankList = Singleton <RankingSystem> .GetInstance().GetRankList(RankingSystem.RankingType.Achievement); if (rankList != null) { int num = 0; while ((long)num < (long)((ulong)rankList.dwItemNum)) { CAchieveInfo2.AddWorldRank(rankList.astItemDetail[num].stExtraInfo.stDetailInfo.stAchievement.iLogicWorldId, rankList.astItemDetail[num].stExtraInfo.stDetailInfo.stAchievement.ullUid, (uint)(rankList.iStart + num)); num++; } } } }
private void HandleAchieveGetRankingAccountInfo(SCPKG_GET_RANKING_ACNT_INFO_RSP rsp) { if (rsp.stAcntRankingDetail.stOfSucc.bNumberType != 8) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { DebugHelper.Assert(false, "HandleAchieveGetRankingAccountInfo::Master Role Info Is Null"); CAchieveInfo2.AddWorldRank(0, 0uL, rsp.stAcntRankingDetail.stOfSucc.dwRankNo); } else { CAchieveInfo2.AddWorldRank(masterRoleInfo.logicWorldID, masterRoleInfo.playerUllUID, rsp.stAcntRankingDetail.stOfSucc.dwRankNo); } }
private void RefreshData(uint achievementId) { this.ResetData(); CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); this.m_curAchieveItem = masterAchieveInfo.m_AchiveItemDic[achievementId]; CAchieveItem2 head = this.m_curAchieveItem.GetHead(); if (head == this.m_curAchieveItem) { this.m_isNewTrophy = true; } else { this.m_isNewTrophy = false; } uint num = 0u; masterAchieveInfo.GetTrophyProgress(ref num, ref this.m_nextPoint); uint num2 = 0u; for (int i = 0; i < masterAchieveInfo.MostLatelyDoneAchievements.get_Count(); i++) { CAchieveItem2 cAchieveItem = masterAchieveInfo.m_AchiveItemDic[masterAchieveInfo.MostLatelyDoneAchievements.get_Item(i)]; num2 += cAchieveItem.Cfg.dwPoint; } this.m_startPoint = num - num2; this.m_endPoint = this.m_startPoint + this.m_curAchieveItem.Cfg.dwPoint; CTrophyRewardInfo trophyRewardInfoByPoint = masterAchieveInfo.GetTrophyRewardInfoByPoint(this.m_startPoint); CTrophyRewardInfo cTrophyRewardInfo = this.m_curTrophyRewardInfo = masterAchieveInfo.GetTrophyRewardInfoByPoint(this.m_endPoint); CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(cTrophyRewardInfo.Index + 1); if (trophyRewardInfoByPoint.Cfg.dwTrophyLvl == cTrophyRewardInfo.Cfg.dwTrophyLvl) { this.m_achievePointsFrom = Utility.Divide(this.m_startPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep()); this.m_achievePointsTo = Utility.Divide(this.m_endPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep()); } else { this.m_achievePointsFrom = 0f; this.m_achievePointsTo = Utility.Divide(this.m_endPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep()); } }
private void RefreshShareForm() { if (this.m_curTrophyRewardInfo == null) { return; } if (this.m_shareForm == null) { this.m_shareForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Achievement_Share.prefab"); } if (this.m_shareForm == null) { return; } CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(this.m_curTrophyRewardInfo.Index + 1); if (this.m_isNewTrophy) { } Text component = this.m_shareForm.GetWidget(0).GetComponent <Text>(); component.set_text(this.m_curAchieveItem.Cfg.szName); Text component2 = this.m_shareForm.GetWidget(5).GetComponent <Text>(); component2.set_text(this.m_curAchieveItem.GetAchievementDesc()); Text component3 = this.m_shareForm.GetWidget(7).GetComponent <Text>(); component3.set_text(this.m_curAchieveItem.GetAchievementTips()); GameObject widget = this.m_shareForm.GetWidget(6); Image component4 = widget.GetComponent <Image>(); component4.SetSprite(this.m_curAchieveItem.GetAchieveImagePath(), this.m_shareForm, true, false, false, false); GameObject widget2 = this.m_shareForm.GetWidget(18); CAchievementSystem.SetAchieveBaseIcon(widget2.transform, this.m_curAchieveItem, this.m_shareForm); Image component5 = this.m_shareForm.GetWidget(20).GetComponent <Image>(); GameObject widget3 = this.m_shareForm.GetWidget(12); GameObject widget4 = this.m_shareForm.GetWidget(19); Text component6 = this.m_shareForm.GetWidget(11).GetComponent <Text>(); Text component7 = widget3.GetComponent <Text>(); Text component8 = this.m_shareForm.GetWidget(16).GetComponent <Text>(); component5.SetSprite(this.m_curTrophyRewardInfo.GetTrophyImagePath(), this.m_shareForm, true, false, false, false); component8.set_text(string.Format("{0}/{1}", this.m_endPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep())); component6.set_text(this.m_curTrophyRewardInfo.Cfg.dwTrophyLvl.ToString()); if (masterAchieveInfo.GetWorldRank() == 0u) { widget4.CustomSetActive(true); widget3.CustomSetActive(false); } else { widget3.CustomSetActive(true); component7.set_text(masterAchieveInfo.GetWorldRank().ToString()); widget4.CustomSetActive(false); } this.DoTrophyTween(); Text component9 = this.m_shareForm.GetWidget(10).GetComponent <Text>(); ShareSys.SetSharePlatfText(component9); if (CSysDynamicBlock.bSocialBlocked) { Transform transform = this.m_shareForm.transform.Find("Panel_ShareAchievement_Btn"); if (transform != null) { transform.gameObject.CustomSetActive(false); } Transform transform2 = this.m_shareForm.transform.Find("Panel_NewAchievement_Btn/Btn_Share"); if (transform2 != null) { transform2.gameObject.CustomSetActive(false); } } }
public void ConvertServerDetailData(CSDT_ACNT_DETAIL_INFO detailInfo) { this.isMasterData = false; this.ResetData(); this._doubleKillCount = 0; this._trippleKillCount = 0; this._quataryKillCount = 0; this._pentaKillCount = 0; this._holyShitCount = 0; this._mvpCnt = 0; this._loseMvpCount = 0; if (detailInfo == null) { return; } this._playerName = StringHelper.UTF8BytesToString(ref detailInfo.szAcntName); this.m_personSign = StringHelper.UTF8BytesToString(ref detailInfo.szSignatureInfo); this.m_uuid = detailInfo.ullUid; this.m_iLogicWorldId = detailInfo.iLogicWorldId; this.m_vipInfo = new SCPKG_GAME_VIP_NTF(); this.m_vipInfo.stGameVipClient = detailInfo.stGameVip; this._playerHeadUrl = Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(ref detailInfo.szOpenUrl); this._playerLevel = detailInfo.dwLevel; ResAcntExpInfo dataByKey = GameDataMgr.acntExpDatabin.GetDataByKey(this._playerLevel); this._playerNeedExp = dataByKey.dwNeedExp; this._playerExp = detailInfo.dwExp; this.creditScore = detailInfo.dwCreditValue; this.sumDelCreditValue = detailInfo.iSumDelCreditValue * -1; this.mostDelCreditType = detailInfo.dwMostDelCreditType; this._power = detailInfo.dwPower; this._pvpLevel = detailInfo.dwPvpLevel; this._playerPvpExp = detailInfo.dwPvpExp; this._gender = detailInfo.bGender; this._privilegeType = detailInfo.bPrivilege; this._rankGrade = detailInfo.bGradeOfRank; this._rankHistoryHighestGrade = detailInfo.bMaxGradeOfRank; this._rankClass = detailInfo.dwCurClassOfRank; this._rankHistoryHighestClass = detailInfo.stRankInfo.dwTopClassOfRank; this.GuildName = StringHelper.UTF8BytesToString(ref detailInfo.stGuildInfo.szGuildName); this.GuildState = detailInfo.stGuildInfo.bGuildState; this.qqVipMask = detailInfo.dwQQVIPMask; int num = 0; while ((long)num < (long)((ulong)detailInfo.stStatistic.stKVDetail.dwNum)) { COMDT_STATISTIC_KEY_VALUE_INFO cOMDT_STATISTIC_KEY_VALUE_INFO = detailInfo.stStatistic.stKVDetail.astKVDetail[num]; RES_STATISTIC_SETTLE_DATA_TYPE dwKey = cOMDT_STATISTIC_KEY_VALUE_INFO.dwKey; switch (dwKey) { case 13: this._mvpCnt = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 14: this._loseMvpCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 15: this._holyShitCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 16: this._doubleKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 17: this._trippleKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; default: if (dwKey != 27) { if (dwKey == 28) { this._pentaKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; } } else { this._quataryKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; } break; } num++; } this._5V5TotalCount = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwTotalNum; this._5V5WinCount = (int)detailInfo.stStatistic.stFiveVsFiveInfo.dwWinNum; this._3V3TotalCount = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwTotalNum; this._3V3WinCount = (int)detailInfo.stStatistic.stThreeVsThreeInfo.dwWinNum; this._2V2TotalCount = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwTotalNum; this._2V2WinCount = (int)detailInfo.stStatistic.stTwoVsTwoInfo.dwWinNum; this._1V1TotalCount = (int)detailInfo.stStatistic.stOneVsOneInfo.dwTotalNum; this._1V1WinCount = (int)detailInfo.stStatistic.stOneVsOneInfo.dwWinNum; this._guildTotalCount = (int)detailInfo.stStatistic.stGuildMatch.dwTotalNum; this._guildWinCount = (int)detailInfo.stStatistic.stGuildMatch.dwWinNum; this._vsAiTotalCount = (int)detailInfo.stStatistic.stVsMachineInfo.dwTotalNum; this._vsAiWinCount = (int)detailInfo.stStatistic.stVsMachineInfo.dwWinNum; this._rankTotalCount = (int)detailInfo.stStatistic.stLadderInfo.dwTotalNum; this._rankWinCount = (int)detailInfo.stStatistic.stLadderInfo.dwWinNum; this._entertainmentTotalCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwTotalNum; this._entertainmentWinCount = (int)detailInfo.stStatistic.stEntertainmentInfo.dwWinNum; this._heroCnt = (int)detailInfo.stMostUsedHero.dwTotalHeroNum; this._skinCnt = (int)detailInfo.stMostUsedHero.dwTotalSkinNum; this._isOnLine = (detailInfo.bIsOnline != 0); if (this._mostUsedHeroList == null) { this._mostUsedHeroList = new ListView <COMDT_MOST_USED_HERO_INFO>(); } else { this._mostUsedHeroList.Clear(); } int num2 = (int)Mathf.Min(detailInfo.stMostUsedHero.dwHeroNum, (float)detailInfo.stMostUsedHero.astHeroInfoList.Length); for (int i = 0; i < num2; i++) { this._mostUsedHeroList.Add(detailInfo.stMostUsedHero.astHeroInfoList[i]); } this.SortMostUsedHeroList(); if (detailInfo.stHonorInfo == null || detailInfo.stHonorInfo.bHonorCnt < 6) { Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 1, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 2, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 6, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 4, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 5, 0); Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, 3, 0); } if (detailInfo.stHonorInfo != null) { for (int j = 0; j < (int)detailInfo.stHonorInfo.bHonorCnt; j++) { COMDT_HONORINFO cOMDT_HONORINFO = detailInfo.stHonorInfo.astHonorInfo[j]; switch (cOMDT_HONORINFO.iHonorID) { case 1: case 2: case 3: case 4: case 5: case 6: Singleton <CRoleInfoManager> .get_instance().InsertHonorOnDuplicateUpdate(ref this._honorDic, cOMDT_HONORINFO.iHonorID, cOMDT_HONORINFO.iHonorPoint); break; } } COMDT_HONORINFO cOMDT_HONORINFO2 = new COMDT_HONORINFO(); if (this._honorDic.TryGetValue(detailInfo.stHonorInfo.iCurUseHonorID, ref cOMDT_HONORINFO2)) { if (cOMDT_HONORINFO2.iHonorLevel > 0) { this._selectedHonorId = detailInfo.stHonorInfo.iCurUseHonorID; } else { this._selectedHonorId = 0; } } } this._geiLiDuiYou = (int)detailInfo.stLikeNum.dwTeammateNum; this._keJingDuiShou = (int)detailInfo.stLikeNum.dwOpponentNum; this._haveExtraCoin = false; this._haveExtraExp = false; this.pvpExtraDetail = detailInfo.stStatistic.stMultiExtraDetail; this.pvpAbilityDetail = detailInfo.stStatistic.stRadarDetail; CAchieveInfo2 achieveInfo = CAchieveInfo2.GetAchieveInfo(detailInfo.iLogicWorldId, detailInfo.ullUid, false); achieveInfo.OnServerAchieveInfo(detailInfo.astShowAchievement, detailInfo.dwAchieveMentScore); this._trophyRewardInfoLevel = achieveInfo.LastDoneTrophyRewardInfo.Cfg.dwTrophyLvl; this._trophyRank = achieveInfo.GetWorldRank(); Array.Copy(achieveInfo.SelectedTrophies, this._selectedTrophies, achieveInfo.SelectedTrophies.Length); this._mentorInfo = Utility.DeepCopyByReflection <COMDT_ACNT_MASTER_INFO>(detailInfo.stAcntMasterInfo); }
public void ConvertRoleInfoData(CRoleInfo roleInfo) { if (roleInfo == null) { this.ResetData(); return; } this.ResetData(); this.isMasterData = (roleInfo == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo()); this.m_uuid = roleInfo.playerUllUID; this.m_iLogicWorldId = MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID; this.m_vipInfo = roleInfo.GetNobeInfo(); this._gender = roleInfo.m_gender; this._privilegeType = roleInfo.m_privilegeType; this._playerName = roleInfo.Name; this.m_personSign = roleInfo.PersonSign; this._playerHeadUrl = roleInfo.HeadUrl; this._playerLevel = roleInfo.Level; this._playerExp = roleInfo.Exp; this._playerNeedExp = roleInfo.NeedExp; this._power = roleInfo.BattlePower; this._pvpLevel = roleInfo.PvpLevel; this._playerPvpExp = roleInfo.PvpExp; this._rankGrade = roleInfo.m_rankGrade; this._rankHistoryHighestGrade = roleInfo.m_rankHistoryHighestGrade; this._rankClass = roleInfo.m_rankClass; this._rankHistoryHighestClass = roleInfo.m_rankHistoryHighestClass; this.GuildName = roleInfo.m_baseGuildInfo.name; this.GuildState = roleInfo.m_baseGuildInfo.guildState; this.creditScore = roleInfo.creditScore; this.sumDelCreditValue = roleInfo.sumDelCreditValue; this.mostDelCreditType = roleInfo.mostDelCreditType; int num = 0; while ((long)num < (long)((ulong)roleInfo.pvpDetail.stKVDetail.dwNum)) { COMDT_STATISTIC_KEY_VALUE_INFO cOMDT_STATISTIC_KEY_VALUE_INFO = roleInfo.pvpDetail.stKVDetail.astKVDetail[num]; RES_STATISTIC_SETTLE_DATA_TYPE dwKey = cOMDT_STATISTIC_KEY_VALUE_INFO.dwKey; switch (dwKey) { case 13: this._mvpCnt = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 14: this._loseMvpCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 15: this._holyShitCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 16: this._doubleKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; case 17: this._trippleKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; break; default: if (dwKey != 27) { if (dwKey == 28) { this._pentaKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; } } else { this._quataryKillCount = (int)cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue; } break; } num++; } this._5V5TotalCount = (int)roleInfo.pvpDetail.stFiveVsFiveInfo.dwTotalNum; this._5V5WinCount = (int)roleInfo.pvpDetail.stFiveVsFiveInfo.dwWinNum; this._3V3TotalCount = (int)roleInfo.pvpDetail.stThreeVsThreeInfo.dwTotalNum; this._3V3WinCount = (int)roleInfo.pvpDetail.stThreeVsThreeInfo.dwWinNum; this._2V2TotalCount = (int)roleInfo.pvpDetail.stTwoVsTwoInfo.dwTotalNum; this._2V2WinCount = (int)roleInfo.pvpDetail.stTwoVsTwoInfo.dwWinNum; this._1V1TotalCount = (int)roleInfo.pvpDetail.stOneVsOneInfo.dwTotalNum; this._1V1WinCount = (int)roleInfo.pvpDetail.stOneVsOneInfo.dwWinNum; this._guildTotalCount = (int)roleInfo.pvpDetail.stGuildMatch.dwTotalNum; this._guildWinCount = (int)roleInfo.pvpDetail.stGuildMatch.dwWinNum; this._vsAiTotalCount = (int)roleInfo.pvpDetail.stVsMachineInfo.dwTotalNum; this._vsAiWinCount = (int)roleInfo.pvpDetail.stVsMachineInfo.dwWinNum; this._rankTotalCount = (int)roleInfo.pvpDetail.stLadderInfo.dwTotalNum; this._rankWinCount = (int)roleInfo.pvpDetail.stLadderInfo.dwWinNum; this._entertainmentTotalCount = (int)roleInfo.pvpDetail.stEntertainmentInfo.dwTotalNum; this._entertainmentWinCount = (int)roleInfo.pvpDetail.stEntertainmentInfo.dwWinNum; this._heroCnt = roleInfo.GetHaveHeroCount(false); this._skinCnt = roleInfo.GetHeroSkinCount(false); this._isOnLine = true; if (this._mostUsedHeroList == null) { this._mostUsedHeroList = new ListView <COMDT_MOST_USED_HERO_INFO>(); } else { this._mostUsedHeroList.Clear(); } int num2 = (int)Mathf.Min(roleInfo.MostUsedHeroDetail.dwHeroNum, (float)roleInfo.MostUsedHeroDetail.astHeroInfoList.Length); for (int i = 0; i < num2; i++) { this._mostUsedHeroList.Add(roleInfo.MostUsedHeroDetail.astHeroInfoList[i]); } this.SortMostUsedHeroList(); this._selectedHonorId = roleInfo.selectedHonorID; Dictionary <int, COMDT_HONORINFO> .Enumerator enumerator = roleInfo.honorDic.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, COMDT_HONORINFO> current = enumerator.get_Current(); int key = current.get_Key(); Dictionary <int, COMDT_HONORINFO> arg_47A_0 = this._honorDic; KeyValuePair <int, COMDT_HONORINFO> current2 = enumerator.get_Current(); if (!arg_47A_0.ContainsKey(current2.get_Key())) { Dictionary <int, COMDT_HONORINFO> arg_49C_0 = this._honorDic; int arg_49C_1 = key; KeyValuePair <int, COMDT_HONORINFO> current3 = enumerator.get_Current(); arg_49C_0.Add(arg_49C_1, current3.get_Value()); } } this._geiLiDuiYou = roleInfo.GeiLiDuiYou; this._keJingDuiShou = roleInfo.KeJingDuiShou; this._haveExtraCoin = roleInfo.HaveExtraCoin(); if (this._haveExtraCoin) { this._coinExpireHours = roleInfo.GetCoinExpireHours(); this._coinWinCount = roleInfo.GetCoinWinCount(); } this._haveExtraExp = roleInfo.HaveExtraExp(); if (this._haveExtraExp) { this._expExpireHours = roleInfo.GetExpExpireHours(); this._expWinCount = roleInfo.GetExpWinCount(); } this.pvpExtraDetail = roleInfo.pvpDetail.stMultiExtraDetail; this.pvpAbilityDetail = roleInfo.pvpDetail.stRadarDetail; CAchieveInfo2 achieveInfo = CAchieveInfo2.GetAchieveInfo(roleInfo.logicWorldID, roleInfo.playerUllUID, false); if (achieveInfo != null) { if (achieveInfo.LastDoneTrophyRewardInfo != null) { this._trophyRewardInfoLevel = achieveInfo.LastDoneTrophyRewardInfo.Cfg.dwTrophyLvl; } else { DebugHelper.Assert(false, "cheieveInfo.LastDoneTrophyRewardInfo is null,wordID{0},uid{1}", new object[] { roleInfo.logicWorldID, roleInfo.playerUllUID }); } this._trophyRank = achieveInfo.GetWorldRank(); if (achieveInfo.SelectedTrophies != null) { Array.Copy(achieveInfo.SelectedTrophies, this._selectedTrophies, achieveInfo.SelectedTrophies.Length); } else { DebugHelper.Assert(false, "cheieveInfo.SelectedTrophies is null,wordID{0},uid{1}", new object[] { roleInfo.logicWorldID, roleInfo.playerUllUID }); } this._mentorInfo = Utility.DeepCopyByReflection <COMDT_ACNT_MASTER_INFO>(roleInfo.m_mentorInfo); } else { DebugHelper.Assert(false, "cheieveInfo is null,wordID{0},uid{1}", new object[] { roleInfo.logicWorldID, roleInfo.playerUllUID }); } }
private void RefreshOverviewForm(CUIFormScript overviewForm = null) { if (overviewForm == null) { overviewForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Trophy_Overview.prefab"); } if (overviewForm == null) { return; } CUIListScript component = overviewForm.GetWidget(1).GetComponent <CUIListScript>(); if (component != null) { component.SetElementAmount(this.m_CurAchieveSeries.Count); } GameObject widget = overviewForm.GetWidget(2); GameObject widget2 = overviewForm.GetWidget(3); GameObject widget3 = overviewForm.GetWidget(7); GameObject widget4 = overviewForm.GetWidget(8); GameObject widget5 = overviewForm.GetWidget(9); GameObject widget6 = overviewForm.GetWidget(10); GameObject widget7 = overviewForm.GetWidget(4); GameObject widget8 = overviewForm.GetWidget(5); GameObject widget9 = overviewForm.GetWidget(6); if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget7 == null || widget8 == null || widget9 == null || widget5 == null || widget6 == null) { DebugHelper.Assert(false, "Some of Trophy overview form widgets is null"); return; } Text component2 = widget.GetComponent <Text>(); Text component3 = widget2.GetComponent <Text>(); Image component4 = widget6.GetComponent <Image>(); Image component5 = widget3.GetComponent <Image>(); Text component6 = widget4.GetComponent <Text>(); CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); if (masterAchieveInfo.LastDoneTrophyRewardInfo != null) { component4.SetSprite(masterAchieveInfo.LastDoneTrophyRewardInfo.GetTrophyImagePath(), overviewForm, true, false, false, false); } component2.set_text((masterAchieveInfo.LastDoneTrophyRewardInfo == null) ? "0" : string.Format("{0}", masterAchieveInfo.LastDoneTrophyRewardInfo.Cfg.dwTrophyLvl)); if (masterAchieveInfo.GetWorldRank() == 0u) { widget5.CustomSetActive(true); widget2.CustomSetActive(false); } else { widget5.CustomSetActive(false); widget2.CustomSetActive(true); component3.set_text(masterAchieveInfo.GetWorldRank().ToString()); } uint num = 0u; uint num2 = 0u; masterAchieveInfo.GetTrophyProgress(ref num, ref num2); CTrophyRewardInfo trophyRewardInfoByPoint = masterAchieveInfo.GetTrophyRewardInfoByPoint(num); CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(trophyRewardInfoByPoint.Index + 1); component5.set_fillAmount(Utility.Divide(num - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.MaxPoint - trophyRewardInfoByIndex.MinPoint)); component6.set_text(string.Format("{0}/{1}", num - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.MaxPoint - trophyRewardInfoByIndex.MinPoint)); Text component7 = widget7.GetComponent <Text>(); CUIListScript component8 = widget8.GetComponent <CUIListScript>(); CUIEventScript component9 = widget9.GetComponent <CUIEventScript>(); CTrophyRewardInfo firstTrophyRewardInfoAwardNotGot = masterAchieveInfo.GetFirstTrophyRewardInfoAwardNotGot(); if (firstTrophyRewardInfoAwardNotGot == null) { widget7.CustomSetActive(false); widget9.CustomSetActive(false); component8.SetElementAmount(0); } else { bool flag = false; CUseable[] trophyRewards = firstTrophyRewardInfoAwardNotGot.GetTrophyRewards(); if (!firstTrophyRewardInfoAwardNotGot.HasGotAward() && firstTrophyRewardInfoAwardNotGot.IsFinish()) { flag = true; } widget7.CustomSetActive(true); component7.set_text(string.Format("{0}级奖励:", firstTrophyRewardInfoAwardNotGot.Cfg.dwTrophyLvl)); component8.SetElementAmount(trophyRewards.Length); for (int i = 0; i < trophyRewards.Length; i++) { CUIListElementScript elemenet = component8.GetElemenet(i); CUICommonSystem.SetItemCell(overviewForm, elemenet.GetWidget(0), trophyRewards[i], false, false, false, false); } widget9.CustomSetActive(true); if (flag) { CUICommonSystem.SetButtonEnableWithShader(widget9.GetComponent <Button>(), true, true); component9.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Get_Trophy_Reward, new stUIEventParams { tag = firstTrophyRewardInfoAwardNotGot.Index }); } else { CUICommonSystem.SetButtonEnableWithShader(widget9.GetComponent <Button>(), false, true); } } }