private void onRelaySyncCacheFrames(CSPkg inFrapMsg) { DebugHelper.Assert(this.ms_bWaitingRelaySync); if (!this.ms_bWaitingRelaySync || inFrapMsg.stPkgData.stRecoverFrapRsp.dwCltSeq != this.ms_nVideoPieceSeq) { return; } if (inFrapMsg.stPkgData.stRecoverFrapRsp.dwThisPos != this.ms_recvVideoPieceIdx) { this.RequestRelaySyncCacheFrames(true); return; } this.ms_recvVideoPieceIdx += 1u; if (inFrapMsg.stPkgData.stRecoverFrapRsp.dwBufLen > 0u) { this.CacheFramesData(inFrapMsg); } if (inFrapMsg.stPkgData.stRecoverFrapRsp.dwTotalNum == this.ms_recvVideoPieceIdx) { this.ParseFramesData(); DebugHelper.Assert(this.nRecvByteSize == 0); this.ms_bWaitingRelaySync = false; this.ms_bProcessingRelaySync = true; this.ms_nRelayCacheEndFrameNum = inFrapMsg.stPkgData.stRecoverFrapRsp.dwCurKFrapsNo; base.StartCoroutine("ProcessRelaySyncCache"); } else { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1090u); cSPkg.stPkgData.stRecoverFrapReq.bIsNew = 0; Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u); this.ms_fWaitVideoTimeout = 15f; } }
private void ReqKeyFrameLaterModify(uint nLater) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x448); msg.stPkgData.stKFrapsLaterChgReq.bKFrapsLater = (byte)nLater; Singleton <NetworkModule> .instance.SendGameMsg(ref msg, 0); }
private void ReqKeyFrameLaterModify(uint nLater) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1096u); cSPkg.stPkgData.stKFrapsLaterChgReq.bKFrapsLater = (byte)nLater; Singleton <NetworkModule> .instance.SendGameMsg(ref cSPkg, 0u); }
private uint onTryReconnect(uint nCount, uint nMax) { ListView <CSPkg> view = new ListView <CSPkg>(); for (int i = 0; i < this.lobbySendQueue.Count; i++) { view.Add(this.lobbySendQueue[i]); } this.lobbySendQueue.Clear(); for (int j = 0; j < this.confirmSendQueue.Count; j++) { this.lobbySendQueue.Add(this.confirmSendQueue[j]); } this.confirmSendQueue.Clear(); for (int k = 0; k < view.Count; k++) { this.lobbySendQueue.Add(view[k]); } NetworkModule instance = Singleton <NetworkModule> .GetInstance(); instance.m_lobbyReconnetCount++; if (this.GetTryReconnect != null) { return(this.GetTryReconnect(nCount, nMax)); } return(0); }
private void SampleFrameSyncData() { if (Singleton <FrameSynchr> .get_instance().bActive&& Singleton <FrameSynchr> .get_instance().CurFrameNum % this.HashCheckFreq == 0u && Singleton <BattleLogic> .get_instance().isFighting&& !Singleton <WatchController> .GetInstance().IsWatching) { List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .get_instance().HeroActors; int num = 1 + heroActors.get_Count() * 7 + 1; int[] array = new int[num]; int num2 = 0; array[num2++] = (int)Singleton <FrameSynchr> .get_instance().CurFrameNum; for (int i = 0; i < heroActors.get_Count(); i++) { ActorRoot handle = heroActors.get_Item(i).get_handle(); array[num2++] = (int)handle.ObjID; array[num2++] = handle.location.x; array[num2++] = handle.location.y; array[num2++] = handle.location.z; array[num2++] = handle.ValueComponent.actorHp; array[num2++] = handle.ValueComponent.actorHpTotal; array[num2++] = (int)(handle.ActorControl.myBehavior | (ObjBehaviMode)(((!handle.HorizonMarker.IsVisibleFor(1)) ? 0 : 1) << 5) | (ObjBehaviMode)(((!handle.HorizonMarker.IsVisibleFor(2)) ? 0 : 1) << 6)); } array[num2++] = Singleton <GameObjMgr> .GetInstance().GameActors.get_Count(); byte[] array2 = new byte[num * 4]; Buffer.BlockCopy(array, 0, array2, 0, array2.Length); MD5CryptoServiceProvider mD5CryptoServiceProvider = new MD5CryptoServiceProvider(); mD5CryptoServiceProvider.Initialize(); mD5CryptoServiceProvider.TransformFinalBlock(array2, 0, array2.Length); ulong num3 = (ulong)BitConverter.ToInt64(mD5CryptoServiceProvider.get_Hash(), 0); ulong num4 = (ulong)BitConverter.ToInt64(mD5CryptoServiceProvider.get_Hash(), 8); ulong ullHashToChk = num3 ^ num4; CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1280u); cSPkg.stPkgData.get_stRelayHashChk().dwKFrapsNo = Singleton <FrameSynchr> .get_instance().CurFrameNum; cSPkg.stPkgData.get_stRelayHashChk().ullHashToChk = ullHashToChk; if (Singleton <GamePlayerCenter> .get_instance().GetHostPlayer() != null) { CampInfo campInfoByCamp = Singleton <BattleStatistic> .GetInstance().GetCampInfoByCamp(Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp); int headPoints = campInfoByCamp.HeadPoints; COM_PLAYERCAMP campType; if (campInfoByCamp.campType == 1) { campType = 2; } else { campType = 1; } CampInfo campInfoByCamp2 = Singleton <BattleStatistic> .GetInstance().GetCampInfoByCamp(campType); int headPoints2 = campInfoByCamp2.HeadPoints; int iCampKillCntDiff = headPoints - headPoints2; cSPkg.stPkgData.get_stRelayHashChk().iCampKillCntDiff = iCampKillCntDiff; } Singleton <NetworkModule> .get_instance().SendGameMsg(ref cSPkg, 0u); } }
private void RequestTimeoutFraqBootInfo() { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1037u); cSPkg.stPkgData.stReqFrapBootTimeout.dwCurKFrapsNo = this._begFrqNo; cSPkg.stPkgData.stReqFrapBootTimeout.bSession = this._svrSession; Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u); }
public static void OnServerPingClientMsg(CSPkg msg) { if (Singleton <BattleLogic> .get_instance().isRuning) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5334u); Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u); } }
private void SampleFrameSyncData() { if ((Singleton <FrameSynchr> .instance.bActive && !Singleton <WatchController> .GetInstance().IsWatching) && (((Singleton <FrameSynchr> .instance.CurFrameNum % this.HashCheckFreq) == 0) && Singleton <BattleLogic> .instance.isFighting)) { COM_PLAYERCAMP com_playercamp; List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .instance.HeroActors; int num = (1 + (heroActors.Count * 6)) + 1; int[] src = new int[num]; int num2 = 0; src[num2++] = (int)Singleton <FrameSynchr> .instance.CurFrameNum; for (int i = 0; i < heroActors.Count; i++) { PoolObjHandle <ActorRoot> handle = heroActors[i]; ActorRoot root = handle.handle; src[num2++] = (int)root.ObjID; src[num2++] = root.location.x; src[num2++] = root.location.y; src[num2++] = root.location.z; src[num2++] = (int)root.ActorControl.myBehavior; src[num2++] = root.ValueComponent.actorHp; } src[num2++] = MonoSingleton <ActionManager> .GetInstance().ActionUpdatingCount; byte[] dst = new byte[num * 4]; Buffer.BlockCopy(src, 0, dst, 0, dst.Length); MD5CryptoServiceProvider provider = new MD5CryptoServiceProvider(); provider.Initialize(); provider.TransformFinalBlock(dst, 0, dst.Length); ulong num4 = (ulong)BitConverter.ToInt64(provider.Hash, 0); ulong num5 = (ulong)BitConverter.ToInt64(provider.Hash, 8); ulong num6 = num4 ^ num5; CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x500); msg.stPkgData.stRelayHashChk.dwKFrapsNo = Singleton <FrameSynchr> .instance.CurFrameNum; msg.stPkgData.stRelayHashChk.ullHashToChk = num6; CampInfo campInfoByCamp = null; campInfoByCamp = Singleton <BattleStatistic> .GetInstance().GetCampInfoByCamp(Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp); int headPoints = campInfoByCamp.HeadPoints; int num8 = 0; if (campInfoByCamp.campType == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { com_playercamp = COM_PLAYERCAMP.COM_PLAYERCAMP_2; } else { com_playercamp = COM_PLAYERCAMP.COM_PLAYERCAMP_1; } num8 = Singleton <BattleStatistic> .GetInstance().GetCampInfoByCamp(com_playercamp).HeadPoints; int num9 = headPoints - num8; msg.stPkgData.stRelayHashChk.iCampKillCntDiff = num9; Singleton <NetworkModule> .instance.SendGameMsg(ref msg, 0); } }
public bool SendGameCmd(IFrameCommand cmd, bool bMultiGame, bool bUseCSSync = false) { if (Singleton <NetworkModule> .GetInstance().isOnlineMode) { if (bMultiGame) { if (Singleton <NetworkModule> .GetInstance().gameSvr.connected) { CSPkg msg = null; TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; if (!bUseCSSync) { msg = NetworkModule.CreateDefaultCSPKG(0x3ed); FRAME_CMD_PKG frame_cmd_pkg = FrameCommandFactory.CreateCommandPKG(cmd); msg.stPkgData.stGamingCCSync.dwCmdSeq = this.NewSendCmdSeq; msg.stPkgData.stGamingCCSync.stSyncInfo.construct(); cmd.TransProtocol(ref frame_cmd_pkg); int usedSize = 0; type = frame_cmd_pkg.pack(ref msg.stPkgData.stGamingCCSync.stSyncInfo.szBuff, 0x40, ref usedSize, 0); msg.stPkgData.stGamingCCSync.stSyncInfo.wLen = (ushort)usedSize; } else { msg = NetworkModule.CreateDefaultCSPKG(0x3ec); msg.stPkgData.stGamingCSSync.dwCmdSeq = this.NewSendCmdSeq; msg.stPkgData.stGamingCSSync.stSyncInfo.stCSSyncDt.construct((long)cmd.cmdType); cmd.TransProtocol(ref msg.stPkgData.stGamingCSSync.stSyncInfo); } DebugHelper.Assert(type == TdrError.ErrorType.TDR_NO_ERROR); Singleton <NetworkModule> .GetInstance().gameSvr.PushSendMsg(msg); Singleton <NetworkModule> .GetInstance().HandleGameMsgSend(); ulong num2 = (ulong)Mathf.RoundToInt(Time.time * 1000f); this._cmdPingWin[(int)((IntPtr)(((ulong)this.CurSendCmdSeq) % ((long)this._cmdPingWin.Length)))] = (num2 << 1) | (num2 << 0x21); if (this._showChart) { MonoSingleton <RealTimeChart> .instance.AddSample("FrameCmdRecvPing", 1001f); MonoSingleton <RealTimeChart> .instance.AddSample("FrameCmdHandPing", 1001f); MonoSingleton <RealTimeChart> .instance.AddSample("FrameCmdAvrgPing", this._recentPingAvg); } cmd.Preprocess(); } } else { Singleton <FrameSynchr> .GetInstance().PushFrameCommand(cmd); } } return(true); }
private void RecordReplay(CSDT_FRAPBOOT_INFO fbid) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x40a); SCPKG_FRAPBOOT_SINGLE stFrapBootSingle = msg.stPkgData.stFrapBootSingle; int usedSize = 0; if (fbid.pack(ref stFrapBootSingle.szInfoBuff, stFrapBootSingle.szInfoBuff.Length, ref usedSize, 0) == TdrError.ErrorType.TDR_NO_ERROR) { stFrapBootSingle.wLen = (ushort)usedSize; Singleton <GameReplayModule> .instance.RecordMsg(msg); } msg.Release(); }
private uint onTryReconnect(uint nCount, uint nMax) { if ((this.curNetworkReachability != Application.internetReachability) && MonoSingleton <CTongCaiSys> .instance.isTongCaiValid) { string connectUrl = Singleton <ReconnectIpSelect> .instance.GetConnectUrl(ConnectorType.Relay, nCount); base.initParam.SetVip(connectUrl); this.curNetworkReachability = Application.internetReachability; } if (nCount >= 2) { try { MonoSingleton <Reconnection> .GetInstance().ShowReconnectMsgAlert(((int)nCount) - 1, ((int)nMax) - 1); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message, exception.StackTrace }; DebugHelper.Assert(false, "Exception In GameConnector Try Reconnect, {0} {1}", inParameters); } } if (nCount == 2) { List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()), new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()), new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()), new KeyValuePair <string, string>("ping", Singleton <FrameSynchr> .instance.GameSvrPing.ToString()) }; if (Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork) { events.Add(new KeyValuePair <string, string>("Network", "3G or 4G")); } else if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) { events.Add(new KeyValuePair <string, string>("Network", "WIFI")); } else { events.Add(new KeyValuePair <string, string>("Network", "NoSignal")); } events.Add(new KeyValuePair <string, string>("FrameNum", Singleton <FrameSynchr> .instance.CurFrameNum.ToString())); events.Add(new KeyValuePair <string, string>("IsFighting", Singleton <BattleLogic> .instance.isFighting.ToString())); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("GameConnector.onTryReconnect", events, true); } NetworkModule instance = Singleton <NetworkModule> .GetInstance(); instance.m_GameReconnetCount++; return(nCount); }
public bool SendGameCmd(IFrameCommand cmd, bool bMultiGame, bool bUseCSSync = false) { if (Singleton <WatchController> .GetInstance().IsWatching) { return(false); } if (Singleton <NetworkModule> .GetInstance().isOnlineMode) { if (bMultiGame) { if (Singleton <NetworkModule> .GetInstance().gameSvr.connected) { CSPkg msg = null; TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; if (!bUseCSSync) { msg = NetworkModule.CreateDefaultCSPKG(0x3ed); FRAME_CMD_PKG frame_cmd_pkg = FrameCommandFactory.CreateCommandPKG(cmd); msg.stPkgData.stGamingCCSync.dwCmdSeq = this.NewSendCmdSeq; msg.stPkgData.stGamingCCSync.stSyncInfo.construct(); cmd.TransProtocol(ref frame_cmd_pkg); int usedSize = 0; type = frame_cmd_pkg.pack(ref msg.stPkgData.stGamingCCSync.stSyncInfo.szBuff, 0x40, ref usedSize, 0); msg.stPkgData.stGamingCCSync.stSyncInfo.wLen = (ushort)usedSize; frame_cmd_pkg.Release(); Singleton <NetworkModule> .GetInstance().gameSvr.PushSendMsg(msg); } else { msg = NetworkModule.CreateDefaultCSPKG(0x3ec); msg.stPkgData.stGamingCSSync.dwCmdSeq = this.NewSendCmdSeq; msg.stPkgData.stGamingCSSync.stSyncInfo.stCSSyncDt.construct((long)cmd.cmdType); cmd.TransProtocol(ref msg.stPkgData.stGamingCSSync.stSyncInfo); Singleton <NetworkModule> .GetInstance().gameSvr.PushSendMsg(msg); } DebugHelper.Assert(type == TdrError.ErrorType.TDR_NO_ERROR); Singleton <NetworkModule> .GetInstance().HandleGameMsgSend(); cmd.Preprocess(); } } else { Singleton <FrameSynchr> .GetInstance().PushFrameCommand(cmd); } } return(true); }
private void FlushSendCmd(IFrameCommand inCmd) { IFrameCommand frameCommand = null; IFrameCommand frameCommand2 = null; IFrameCommand frameCommand3 = null; if (inCmd != null) { frameCommand = inCmd; frameCommand2 = this.cmdRedundancyQueue[this.nCmdRedQueueIndex]; frameCommand3 = this.cmdRedundancyQueue[(this.nCmdRedQueueIndex - 1 + 3) % 3]; } else { frameCommand = this.cmdRedundancyQueue[this.nCmdRedQueueIndex]; frameCommand2 = this.cmdRedundancyQueue[(this.nCmdRedQueueIndex - 1 + 3) % 3]; frameCommand3 = this.cmdRedundancyQueue[(this.nCmdRedQueueIndex - 2 + 3) % 3]; } if (frameCommand != null && (inCmd != null || frameCommand.sendCnt < 3)) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1004u); cSPkg.stPkgData.get_stGamingUperMsg().bNum = 0; this.PackCmd2Msg(ref frameCommand, cSPkg.stPkgData.get_stGamingUperMsg().astUperInfo[(int)cSPkg.stPkgData.get_stGamingUperMsg().bNum]); CSPKG_GAMING_UPERMSG expr_D3 = cSPkg.stPkgData.get_stGamingUperMsg(); expr_D3.bNum += 1; IFrameCommand expr_E2 = frameCommand; expr_E2.sendCnt += 1; if (frameCommand2 != null && frameCommand2.sendCnt < 3 && (ulong)(frameCommand2.frameNum + 10u) > (ulong)((long)Time.frameCount)) { this.PackCmd2Msg(ref frameCommand2, cSPkg.stPkgData.get_stGamingUperMsg().astUperInfo[(int)cSPkg.stPkgData.get_stGamingUperMsg().bNum]); CSPKG_GAMING_UPERMSG expr_14B = cSPkg.stPkgData.get_stGamingUperMsg(); expr_14B.bNum += 1; IFrameCommand expr_15A = frameCommand2; expr_15A.sendCnt += 1; if (frameCommand3 != null && frameCommand3.sendCnt < 3 && (ulong)(frameCommand3.frameNum + 10u) > (ulong)((long)Time.frameCount)) { this.PackCmd2Msg(ref frameCommand3, cSPkg.stPkgData.get_stGamingUperMsg().astUperInfo[(int)cSPkg.stPkgData.get_stGamingUperMsg().bNum]); CSPKG_GAMING_UPERMSG expr_1C3 = cSPkg.stPkgData.get_stGamingUperMsg(); expr_1C3.bNum += 1; IFrameCommand expr_1D2 = frameCommand3; expr_1D2.sendCnt += 1; } } this.SendPackage(cSPkg); cSPkg.Release(); } }
private static void Upload(long offset) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5239u); CSPKG_UPLOADCLTLOG_NTF stUploadCltlogNtf = cSPkg.stPkgData.stUploadCltlogNtf; stUploadCltlogNtf.dwLogType = 0u; bool flag = false; while (SynchrReport._uploadList != null && SynchrReport._uploadIndex >= 0 && SynchrReport._uploadIndex < SynchrReport._uploadList.get_Count() && SynchrReport._uploadList.get_Item(SynchrReport._uploadIndex) == null) { SynchrReport._uploadIndex++; } if (SynchrReport._uploadList != null && SynchrReport._uploadIndex >= 0 && SynchrReport._uploadIndex < SynchrReport._uploadList.get_Count()) { MemoryStream memoryStream = SynchrReport._uploadList.get_Item(SynchrReport._uploadIndex); if (offset < memoryStream.get_Length()) { if (offset != memoryStream.get_Position()) { memoryStream.set_Position(offset); } stUploadCltlogNtf.dwLogType = (uint)((SynchrReport._uploadIndex + 1) * 10000000 + (int)SynchrReport._checkFrameNo); stUploadCltlogNtf.dwBuffOffset = (uint)offset; stUploadCltlogNtf.dwBufLen = (uint)memoryStream.Read(stUploadCltlogNtf.szBuf, 0, stUploadCltlogNtf.szBuf.Length); if (memoryStream.get_Position() >= memoryStream.get_Length()) { flag = (++SynchrReport._uploadIndex >= SynchrReport._uploadList.get_Count()); stUploadCltlogNtf.bThisLogOver = 1; stUploadCltlogNtf.bAllLogOver = (flag ? 1 : 0); } else { stUploadCltlogNtf.bThisLogOver = 0; stUploadCltlogNtf.bAllLogOver = 0; } } } Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u); if (flag || stUploadCltlogNtf.dwLogType == 0u) { SynchrReport._isUploading = false; SynchrReport.CloseUpload(); } }
private uint onTryReconnect(uint nCount, uint nMax) { try { MonoSingleton <Reconnection> .GetInstance().ShowReconnectMsgAlert((int)nCount, (int)nMax); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message, exception.StackTrace }; DebugHelper.Assert(false, "Exception In GameConnector Try Reconnect, {0} {1}", inParameters); } Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("GameConnector.onTryReconnect", null, true); NetworkModule instance = Singleton <NetworkModule> .GetInstance(); instance.m_GameReconnetCount++; return(nCount); }
private void RequestRepairFraqBootInfo() { if (this._maxFrqNo <= this._begFrqNo) { return; } CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1036u); CSPKG_REQUESTFRAPBOOTSINGLE stReqFrapBootSingle = cSPkg.stPkgData.stReqFrapBootSingle; stReqFrapBootSingle.bNum = 0; byte b = 0; byte b2 = 0; for (uint num = this._begFrqNo; num < this._maxFrqNo; num += 1u) { if (this._receiveWindow[(int)((uint)((UIntPtr)this._FrqNoToWinIdx_(num)))] == null) { b += 1; if ((int)stReqFrapBootSingle.bNum >= stReqFrapBootSingle.KFrapsNo.Length) { break; } uint[] kFrapsNo = stReqFrapBootSingle.KFrapsNo; CSPKG_REQUESTFRAPBOOTSINGLE cSPKG_REQUESTFRAPBOOTSINGLE = stReqFrapBootSingle; byte bNum; cSPKG_REQUESTFRAPBOOTSINGLE.bNum = (bNum = cSPKG_REQUESTFRAPBOOTSINGLE.bNum) + 1; kFrapsNo[(int)bNum] = num; } else { if (b > b2) { b2 = b; } b = 0; } } if (stReqFrapBootSingle.bNum > 0) { stReqFrapBootSingle.bFrapDiff = b2; stReqFrapBootSingle.bSession = this._svrSession; Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u); } }
private static void Upload(long offset) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x1477); CSPKG_UPLOADCLTLOG_NTF stUploadCltlogNtf = msg.stPkgData.stUploadCltlogNtf; stUploadCltlogNtf.dwLogType = 0; bool flag = false; if (((_uploadList != null) && (_uploadIndex >= 0)) && (_uploadIndex < _uploadList.Length)) { MemoryStream stream = _uploadList[_uploadIndex]; if (offset < stream.Length) { if (offset != stream.Position) { stream.Position = offset; } stUploadCltlogNtf.dwLogType = (uint)(_uploadIndex + 1); stUploadCltlogNtf.dwBuffOffset = (uint)offset; stUploadCltlogNtf.dwBufLen = (uint)stream.Read(stUploadCltlogNtf.szBuf, 0, stUploadCltlogNtf.szBuf.Length); if (stream.Position >= stream.Length) { flag = ++_uploadIndex >= _uploadList.Length; stUploadCltlogNtf.bThisLogOver = 1; stUploadCltlogNtf.bAllLogOver = !flag ? ((byte)0) : ((byte)1); } else { stUploadCltlogNtf.bThisLogOver = 0; stUploadCltlogNtf.bAllLogOver = 0; } } } Singleton <NetworkModule> .GetInstance().SendGameMsg(ref msg, 0); if (flag || (stUploadCltlogNtf.dwLogType == 0)) { CloseUpload(); } }
private void RequestRepairFraqBootInfo() { if (this._maxFrqNo > this._begFrqNo) { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x40c); CSPKG_REQUESTFRAPBOOTSINGLE stReqFrapBootSingle = msg.stPkgData.stReqFrapBootSingle; stReqFrapBootSingle.bNum = 0; for (uint i = 0; i < 900; i++) { if ((stReqFrapBootSingle.bNum >= stReqFrapBootSingle.KFrapsNo.Length) || (stReqFrapBootSingle.bNum > ((this._maxFrqNo - this._begFrqNo) + 2))) { break; } uint theFrqNo = this._begFrqNo + i; if (this._receiveWindow[this._FrqNoToWinIdx_(theFrqNo)] == null) { byte num3; stReqFrapBootSingle.bNum = (byte)((num3 = stReqFrapBootSingle.bNum) + 1); stReqFrapBootSingle.KFrapsNo[num3] = theFrqNo; } } Singleton <NetworkModule> .GetInstance().SendGameMsg(ref msg, 0); } }