public void CacheRecord(object obj) { if (this.IsReplaying) { return; } CSDT_FRAPBOOT_INFO cSDT_FRAPBOOT_INFO = obj as CSDT_FRAPBOOT_INFO; int num = 0; short num2 = 0; if (cSDT_FRAPBOOT_INFO != null) { if (cSDT_FRAPBOOT_INFO.pack(ref this.streamBuffer, this.streamBuffer.Length, ref num, 0u) == TdrError.ErrorType.TDR_NO_ERROR && num > 0 && num < 32767) { num2 = (short)num; } this.endKFraqNo = 0u; } else { WatchEntryData watchEntry = null; if (Singleton <WatchController> .GetInstance().IsWatching) { watchEntry = Singleton <COBSystem> .GetInstance().GetWatchEntryData(); } CSPkg cSPkg = obj as CSPkg; if (cSPkg.stPkgHead.dwMsgID == 1075u) { this.BeginRecord(cSPkg.stPkgData.stMultGameBeginLoad, watchEntry); } if (cSPkg.pack(ref this.streamBuffer, this.streamBuffer.Length, ref num, 0u) == TdrError.ErrorType.TDR_NO_ERROR && num > 0 && num < 32767) { num2 = -(short)num; } } if (this.recordWriter != null && num2 != 0) { this.recordWriter.Write(num2); this.recordWriter.Write(this.streamBuffer, 0, num); } else { Debug.LogError("Record Msg Failed! usedSize=" + num); } }
private void BeginRecord(SCPKG_MULTGAME_BEGINLOAD beginLoadPkg, WatchEntryData watchEntry = null) { this.ClearRecord(); if (beginLoadPkg == null) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false); if (accountInfo == null) { return; } uint num = 0u; string text = masterRoleInfo.Name; string headUrl = masterRoleInfo.HeadUrl; byte b = masterRoleInfo.m_rankGrade; uint num2 = masterRoleInfo.m_rankClass; if (watchEntry == null) { if (Singleton <WatchController> .GetInstance().IsWatching) { CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO = beginLoadPkg.astCampInfo[0].astCampPlayerInfo[0]; text = StringHelper.UTF8BytesToString(ref cSDT_CAMPPLAYERINFO.stPlayerInfo.szName); b = (byte)cSDT_CAMPPLAYERINFO.dwShowGradeOfRank; num2 = cSDT_CAMPPLAYERINFO.dwClassOfRank; num = cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID; } else { for (int i = 0; i < beginLoadPkg.astCampInfo.Length; i++) { CSDT_CAMPINFO cSDT_CAMPINFO = beginLoadPkg.astCampInfo[i]; for (uint num3 = 0u; num3 < cSDT_CAMPINFO.dwPlayerNum; num3 += 1u) { CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO2 = cSDT_CAMPINFO.astCampPlayerInfo[(int)((uint)((UIntPtr)num3))]; if (Utility.UTF8Convert(cSDT_CAMPPLAYERINFO2.szOpenID) == accountInfo.OpenId) { num = cSDT_CAMPPLAYERINFO2.stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID; break; } } if (num > 0u) { break; } } } } else { num = watchEntry.usedHeroId; text = watchEntry.name; headUrl = watchEntry.headUrl; b = watchEntry.rankGrade; num2 = watchEntry.rankClass; } if (num > 0u) { this.recordStream = new MemoryStream(1048576); this.recordWriter = new BinaryWriter(this.recordStream); this.recordWriter.Write(CVersion.GetAppVersion()); this.recordWriter.Write(CVersion.GetUsedResourceVersion()); this.recordWriter.Write(CVersion.GetRevisonNumber()); this.recordWriter.Write(num); this.recordWriter.Write(DateTime.get_Now().get_Ticks()); this.recordWriter.Write(beginLoadPkg.stDeskInfo.bMapType); this.recordWriter.Write(beginLoadPkg.stDeskInfo.dwMapId); this.recordWriter.Write(text); this.recordWriter.Write(headUrl); this.recordWriter.Write(b); this.recordWriter.Write(num2); } }