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();
            }
        }
Exemplo n.º 2
0
        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();
            }
        }