public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResDT_LevelReward_UnlockInfo.CURRVERSION < cutVer)
            {
                cutVer = ResDT_LevelReward_UnlockInfo.CURRVERSION;
            }
            if (ResDT_LevelReward_UnlockInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            uint num = 0u;

            TdrError.ErrorType errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szUnlockID_ByteArray.GetLength(0))
            {
                if ((long)num > (long)((ulong)ResDT_LevelReward_UnlockInfo.LENGTH_szUnlockID))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szUnlockID_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szUnlockID_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szUnlockID_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szUnlockID_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bGotoID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num3 = 0u;

            errorType = srcBuf.readUInt32(ref num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num3 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num3 > (uint)this.szIcon_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResDT_LevelReward_UnlockInfo.LENGTH_szIcon))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szIcon_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szIcon_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szIcon_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szIcon_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            this.TransferData();
            return(errorType);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResLicenseInfo.CURRVERSION < cutVer)
            {
                cutVer = ResLicenseInfo.CURRVERSION;
            }
            if (ResLicenseInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwLicenseID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szLicenseName_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResLicenseInfo.LENGTH_szLicenseName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szLicenseName_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szLicenseName_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szLicenseName_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szLicenseName_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num3 = 0u;

            errorType = srcBuf.readUInt32(ref num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num3 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num3 > (uint)this.szDesc_ByteArray.GetLength(0))
            {
                if ((ulong)num3 > (ulong)ResLicenseInfo.LENGTH_szDesc)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szDesc_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szDesc_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num5 = 0u;

            errorType = srcBuf.readUInt32(ref num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num5 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num5 > (uint)this.szIconPath_ByteArray.GetLength(0))
            {
                if ((ulong)num5 > (ulong)ResLicenseInfo.LENGTH_szIconPath)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szIconPath_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szIconPath_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szIconPath_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szIconPath_ByteArray) + 1;

            if ((ulong)num5 != (ulong)((long)num6))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bUnlockCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 3; i++)
            {
                errorType = srcBuf.readUInt32(ref this.UnlockArray[i]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt8(ref this.bIsAnd);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #3
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResMiShuInfo.CURRVERSION < cutVer)
            {
                cutVer = ResMiShuInfo.CURRVERSION;
            }
            if (ResMiShuInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szName_ByteArray.GetLength(0))
            {
                if ((long)num > (long)((ulong)ResMiShuInfo.LENGTH_szName))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szName_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szName_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szName_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szName_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num3 = 0u;

            errorType = srcBuf.readUInt32(ref num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num3 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num3 > (uint)this.szDesc_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResMiShuInfo.LENGTH_szDesc))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szDesc_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szDesc_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num5 = 0u;

            errorType = srcBuf.readUInt32(ref num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num5 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num5 > (uint)this.szUnOpenDesc_ByteArray.GetLength(0))
            {
                if ((long)num5 > (long)((ulong)ResMiShuInfo.LENGTH_szUnOpenDesc))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szUnOpenDesc_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szUnOpenDesc_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szUnOpenDesc_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szUnOpenDesc_ByteArray) + 1;

            if ((ulong)num5 != (ulong)((long)num6))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwIconID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bGotoID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bShowCoinLimit);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCoinGetPath);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResRandomRewardStore.CURRVERSION < cutVer)
            {
                cutVer = ResRandomRewardStore.CURRVERSION;
            }
            if (ResRandomRewardStore.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwRewardID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szRewardDesc_ByteArray.GetLength(0))
            {
                if ((long)num > (long)((ulong)ResRandomRewardStore.LENGTH_szRewardDesc))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szRewardDesc_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szRewardDesc_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szRewardDesc_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szRewardDesc_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bCalculateType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMissOverlie);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bRewardNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (20 < this.bRewardNum)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            this.astRewardDetail = new ResDT_RandomRewardInfo[(int)this.bRewardNum];
            for (int i = 0; i < (int)this.bRewardNum; i++)
            {
                this.astRewardDetail[i] = new ResDT_RandomRewardInfo();
            }
            for (int j = 0; j < (int)this.bRewardNum; j++)
            {
                errorType = this.astRewardDetail[j].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
 public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     if ((cutVer == 0) || (CURRVERSION < cutVer))
     {
         cutVer = CURRVERSION;
     }
     if (BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     type = this.stSnsFrindInfo.unpack(ref srcBuf, cutVer);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         uint dest = 0;
         type = srcBuf.readUInt32(ref dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (dest > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (dest > this.szNickName.GetLength(0))
         {
             if (dest > LENGTH_szNickName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szNickName = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szNickName, (int)dest);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szNickName[((int)dest) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num2 = TdrTypeUtil.cstrlen(this.szNickName) + 1;
             if (dest != num2)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt8(ref this.bGameState);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwDonateTime);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
     }
     return(type);
 }
Beispiel #6
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || CSDT_MAILOPTREQ_SENDMAIL.CURRVERSION < cutVer)
            {
                cutVer = CSDT_MAILOPTREQ_SENDMAIL.CURRVERSION;
            }
            if (CSDT_MAILOPTREQ_SENDMAIL.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bMailType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bMailsubType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szFrom.GetLength(0))
            {
                if ((ulong)num > (ulong)CSDT_MAILOPTREQ_SENDMAIL.LENGTH_szFrom)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szFrom = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szFrom, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szFrom[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szFrom) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num3 = 0u;

            errorType = srcBuf.readUInt32(ref num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num3 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num3 > (uint)this.szTo.GetLength(0))
            {
                if ((ulong)num3 > (ulong)CSDT_MAILOPTREQ_SENDMAIL.LENGTH_szTo)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTo = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTo, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTo[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szTo) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt64(ref this.ullToUid);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwToLogicWorld);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bSubjectLen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (128 < this.bSubjectLen)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            this.szSubject = new sbyte[(int)this.bSubjectLen];
            for (int i = 0; i < (int)this.bSubjectLen; i++)
            {
                errorType = srcBuf.readInt8(ref this.szSubject[i]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt16(ref this.wContentLen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (600 < this.wContentLen)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            this.szContent = new sbyte[(int)this.wContentLen];
            for (int j = 0; j < (int)this.wContentLen; j++)
            {
                errorType = srcBuf.readInt8(ref this.szContent[j]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt8(ref this.bAccessCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (10 < this.bAccessCnt)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            for (int k = 0; k < (int)this.bAccessCnt; k++)
            {
                errorType = this.astAccess[k].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            if (CSDT_MAILOPTREQ_SENDMAIL.VERSION_bSource <= cutVer)
            {
                errorType = srcBuf.readUInt8(ref this.bSource);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                this.bSource = 0;
            }
            errorType = this.stFriendUin.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
Beispiel #7
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResPVPSpecItem.CURRVERSION < cutVer)
            {
                cutVer = ResPVPSpecItem.CURRVERSION;
            }
            if (ResPVPSpecItem.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bMapType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMapID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szTipStr_ByteArray.GetLength(0))
            {
                if ((long)num > (long)((ulong)ResPVPSpecItem.LENGTH_szTipStr))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTipStr_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTipStr_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTipStr_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szTipStr_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwStartDate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwEndDate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bPeriodCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 5; i++)
            {
                errorType = this.astPeriodInfo[i].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt16(ref this.wWinOutputRate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bHangUpLight);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bHangUpSerious);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwLevelLimit);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wItemType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwItemID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwTotalRate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bOutputCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int j = 0; j < 6; j++)
            {
                errorType = this.astOutputInfo[j].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #8
0
 public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     if (cutVer == 0u || COMDT_RANK_SETTLE_INFO.CURRVERSION < cutVer)
     {
         cutVer = COMDT_RANK_SETTLE_INFO.CURRVERSION;
     }
     if (COMDT_RANK_SETTLE_INFO.BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bOldShowGrade);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwOldScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bNowShowGrade);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwNowScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwOldAddStarScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwNowAddStarScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwGameScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwConWinScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwMVPScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwMMRScore);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bIsFirstWangzhe);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     return(errorType);
 }
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_ROOMMEMBER_OF_ACNT.CURRVERSION < cutVer)
            {
                cutVer = COMDT_ROOMMEMBER_OF_ACNT.CURRVERSION;
            }
            if (COMDT_ROOMMEMBER_OF_ACNT.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt64(ref this.ullUid);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iFromGameEntity);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iLogicWorldID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szMemberName.GetLength(0))
            {
                if ((long)num > (long)((ulong)COMDT_ROOMMEMBER_OF_ACNT.LENGTH_szMemberName))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szMemberName = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szMemberName, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szMemberName[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szMemberName) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwMemberLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMemberPvpLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMemberHeadId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num3 = 0u;

            errorType = srcBuf.readUInt32(ref num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num3 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num3 > (uint)this.szMemberHeadUrl.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)COMDT_ROOMMEMBER_OF_ACNT.LENGTH_szMemberHeadUrl))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szMemberHeadUrl = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szMemberHeadUrl, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szMemberHeadUrl[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szMemberHeadUrl) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = this.stMemberVip.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsLikeFlag);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
Beispiel #10
0
 public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     if (cutVer == 0u || ResLuckyDrawReward.CURRVERSION < cutVer)
     {
         cutVer = ResLuckyDrawReward.CURRVERSION;
     }
     if (ResLuckyDrawReward.BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwRewardPoolID);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bRewardIndex);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwRewardLimitID);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwItemType);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwItemID);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwItemCnt);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwItemTag);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bShowProbabilityDoubled);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwItemPreciousValue);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwItemProbability);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bExcludeIfChosen);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt16(ref this.wMissCntPerAddProbaility);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwAddProbaility);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt16(ref this.wAddProbailityLimit);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt16(ref this.wProbailityReduceRatio);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     this.TransferData();
     return(errorType);
 }
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || CSDT_GETMAIL_RES.CURRVERSION < cutVer)
            {
                cutVer = CSDT_GETMAIL_RES.CURRVERSION;
            }
            if (CSDT_GETMAIL_RES.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bMailType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iMailIndex);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bMailState);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bAutoDel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szFrom.GetLength(0))
            {
                if ((ulong)num > (ulong)CSDT_GETMAIL_RES.LENGTH_szFrom)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szFrom = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szFrom, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szFrom[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szFrom) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bSubjectLen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (128 < this.bSubjectLen)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            this.szSubject = new sbyte[(int)this.bSubjectLen];
            for (int i = 0; i < (int)this.bSubjectLen; i++)
            {
                errorType = srcBuf.readInt8(ref this.szSubject[i]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt32(ref this.dwSendTime);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bAccessCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (10 < this.bAccessCnt)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            this.astAccess = new COMDT_MAILACCESS[(int)this.bAccessCnt];
            for (int j = 0; j < (int)this.bAccessCnt; j++)
            {
                this.astAccess[j] = (COMDT_MAILACCESS)ProtocolObjectPool.Get(COMDT_MAILACCESS.CLASS_ID);
            }
            for (int k = 0; k < (int)this.bAccessCnt; k++)
            {
                errorType = this.astAccess[k].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            return(errorType);
        }
Beispiel #12
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResRandDrawInfo.CURRVERSION < cutVer)
            {
                cutVer = ResRandDrawInfo.CURRVERSION;
            }
            if (ResRandDrawInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwDrawID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bDrawType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szStartTime_ByteArray.GetLength(0))
            {
                if ((long)num > (long)((ulong)ResRandDrawInfo.LENGTH_szStartTime))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szStartTime_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szStartTime_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szStartTime_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szStartTime_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num3 = 0u;

            errorType = srcBuf.readUInt32(ref num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num3 > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num3 > (uint)this.szEndTime_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResRandDrawInfo.LENGTH_szEndTime))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szEndTime_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szEndTime_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szEndTime_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szEndTime_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwStartTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwEndTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCostType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCostPrice);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwRewardPoolID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #13
0
        public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
        {
            srcBuf.disableEndian();
            if (cutVer == 0u || ResRandDrawInfo.CURRVERSION < cutVer)
            {
                cutVer = ResRandDrawInfo.CURRVERSION;
            }
            if (ResRandDrawInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwDrawID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bDrawType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 16;

            if (this.szStartTime_ByteArray.GetLength(0) < num)
            {
                this.szStartTime_ByteArray = new byte[ResRandDrawInfo.LENGTH_szStartTime];
            }
            errorType = srcBuf.readCString(ref this.szStartTime_ByteArray, num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num2 = 16;

            if (this.szEndTime_ByteArray.GetLength(0) < num2)
            {
                this.szEndTime_ByteArray = new byte[ResRandDrawInfo.LENGTH_szEndTime];
            }
            errorType = srcBuf.readCString(ref this.szEndTime_ByteArray, num2);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwStartTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwEndTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCostType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCostPrice);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwRewardPoolID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
 public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     if ((cutVer == 0) || (CURRVERSION < cutVer))
     {
         cutVer = CURRVERSION;
     }
     if (BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     type = srcBuf.readUInt64(ref this.ullGuildID);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt64(ref this.ullAcntUid);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bGuildState);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwGameEntity);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwLogicWorldID);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         uint dest = 0;
         type = srcBuf.readUInt32(ref dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (dest > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (dest > this.szName.GetLength(0))
         {
             if (dest > LENGTH_szName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szName = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szName, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szName[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szName) + 1;
         if (dest != num2)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         type = srcBuf.readUInt32(ref this.dwLevel);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwHeadID);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         uint num3 = 0;
         type = srcBuf.readUInt32(ref num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (num3 > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (num3 > this.szHeadUrl.GetLength(0))
         {
             if (num3 > LENGTH_szHeadUrl)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szHeadUrl = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szHeadUrl, (int)num3);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szHeadUrl[((int)num3) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num4 = TdrTypeUtil.cstrlen(this.szHeadUrl) + 1;
             if (num3 != num4)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt32(ref this.dwAbility);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bPosition);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwConstruct);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwWeekConstruct);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwTotalConstruct);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwCurrActive);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwWeekActive);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bFireCnt);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bDonateCnt);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwDonateNum);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwWeekDividend);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwJoinTime);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = this.stRankInfo.unpack(ref srcBuf, cutVer);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = this.stVip.unpack(ref srcBuf, cutVer);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwLastLoginTime);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
     }
     return(type);
 }
 public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
 {
     srcBuf.disableEndian();
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     if ((cutVer == 0) || (CURRVERSION < cutVer))
     {
         cutVer = CURRVERSION;
     }
     if (BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     type = srcBuf.readUInt32(ref this.dwMapId);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = this.stLevelCommonInfo.load(ref srcBuf, cutVer);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsCanPVP);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsCanPVE);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwAttackOrderID);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt16(ref this.wOriginalGoldCoinInBattle);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwDynamicPropertyCfg);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBattleTaskOfCamp1);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBattleTaskOfCamp2);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         int count = 0x20;
         if (this.szMusicStartEvent_ByteArray.GetLength(0) < count)
         {
             this.szMusicStartEvent_ByteArray = new byte[LENGTH_szMusicStartEvent];
         }
         type = srcBuf.readCString(ref this.szMusicStartEvent_ByteArray, count);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         int num2 = 0x20;
         if (this.szMusicEndEvent_ByteArray.GetLength(0) < num2)
         {
             this.szMusicEndEvent_ByteArray = new byte[LENGTH_szMusicEndEvent];
         }
         type = srcBuf.readCString(ref this.szMusicEndEvent_ByteArray, num2);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         int num3 = 0x20;
         if (this.szAmbientSoundEvent_ByteArray.GetLength(0) < num3)
         {
             this.szAmbientSoundEvent_ByteArray = new byte[LENGTH_szAmbientSoundEvent];
         }
         type = srcBuf.readCString(ref this.szAmbientSoundEvent_ByteArray, num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         int num4 = 0x20;
         if (this.szBankResourceName_ByteArray.GetLength(0) < num4)
         {
             this.szBankResourceName_ByteArray = new byte[LENGTH_szBankResourceName];
         }
         type = srcBuf.readCString(ref this.szBankResourceName_ByteArray, num4);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bEntertainmentSubType);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         this.TransferData();
     }
     return(type);
 }
Beispiel #16
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_TRANSACTION_CONTEXT_GIFTUSE.CURRVERSION < cutVer)
            {
                cutVer = COMDT_TRANSACTION_CONTEXT_GIFTUSE.CURRVERSION;
            }
            if (COMDT_TRANSACTION_CONTEXT_GIFTUSE.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwGamesvrEntity);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwRefreshTime);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stChkDetail.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwAcntLogicWorldID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szAcntName.GetLength(0))
            {
                if ((ulong)num > (ulong)COMDT_TRANSACTION_CONTEXT_GIFTUSE.LENGTH_szAcntName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szAcntName = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szAcntName, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szAcntName[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szAcntName) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt16(ref this.wPropCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsSpecUse);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsDupDel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stEventInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
Beispiel #17
0
 public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     if (cutVer == 0u || ResShopType.CURRVERSION < cutVer)
     {
         cutVer = ResShopType.CURRVERSION;
     }
     if (ResShopType.BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     TdrError.ErrorType errorType = srcBuf.readUInt16(ref this.wShopType);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bIsOpen);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bRefreshCnt);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     for (int i = 0; i < 5; i++)
     {
         errorType = srcBuf.readInt32(ref this.RefreshTime[i]);
         if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(errorType);
         }
     }
     errorType = srcBuf.readInt32(ref this.iManualLimit);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iValidSecond);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt16(ref this.wAPRefreshLvl);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwMinAPAddUp);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bAPRefreshCnt);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     for (int j = 0; j < 12; j++)
     {
         errorType = this.astAPRefreshInfo[j].unpack(ref srcBuf, cutVer);
         if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(errorType);
         }
     }
     this.TransferData();
     return(errorType);
 }
Beispiel #18
0
 public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     if (cutVer == 0u || ResBattleDynamicProperty.CURRVERSION < cutVer)
     {
         cutVer = ResBattleDynamicProperty.CURRVERSION;
     }
     if (ResBattleDynamicProperty.BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwKey);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwID);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bVarType);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwVarPara1);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt32(ref this.dwVarPara2);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iHP);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iAD);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iAP);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iDef);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iRes);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iSoulExp);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iReviveTime);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readInt32(ref this.iDamage);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt16(ref this.wGoldCoinInBattleIncreaseRate);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = srcBuf.readUInt8(ref this.bGoldCoinInBattleAutoIncreaseValue);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     this.TransferData();
     return(errorType);
 }
Beispiel #19
0
        public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
        {
            srcBuf.disableEndian();
            if (cutVer == 0u || ResPVPSpecItem.CURRVERSION < cutVer)
            {
                cutVer = ResPVPSpecItem.CURRVERSION;
            }
            if (ResPVPSpecItem.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bMapType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMapID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 512;

            if (this.szTipStr_ByteArray.GetLength(0) < num)
            {
                this.szTipStr_ByteArray = new byte[ResPVPSpecItem.LENGTH_szTipStr];
            }
            errorType = srcBuf.readCString(ref this.szTipStr_ByteArray, num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwStartDate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwEndDate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bPeriodCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 5; i++)
            {
                errorType = this.astPeriodInfo[i].load(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt16(ref this.wWinOutputRate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bHangUpLight);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bHangUpSerious);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwLevelLimit);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wItemType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwItemID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwTotalRate);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bOutputCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int j = 0; j < 6; j++)
            {
                errorType = this.astOutputInfo[j].load(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
        public TdrError.ErrorType unpack(long selector, ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_REWARDS_UNION.CURRVERSION < cutVer)
            {
                cutVer = COMDT_REWARDS_UNION.CURRVERSION;
            }
            if (COMDT_REWARDS_UNION.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            ProtocolObject protocolObject = this.select(selector);

            if (protocolObject != null)
            {
                return(protocolObject.unpack(ref srcBuf, cutVer));
            }
            TdrError.ErrorType errorType;
            if (selector == 0L)
            {
                errorType = srcBuf.readUInt32(ref this.dwCoin);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 3L)
            {
                errorType = srcBuf.readUInt32(ref this.dwCoupons);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 7L)
            {
                errorType = srcBuf.readUInt32(ref this.dwBurningCoin);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 8L)
            {
                errorType = srcBuf.readUInt32(ref this.dwArenaCoin);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 9L)
            {
                errorType = srcBuf.readUInt32(ref this.dwAP);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 11L)
            {
                errorType = srcBuf.readUInt32(ref this.dwPvpCoin);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 12L)
            {
                errorType = srcBuf.readUInt32(ref this.dwHeroPoolExp);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 13L)
            {
                errorType = srcBuf.readUInt32(ref this.dwSkinCoin);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 14L)
            {
                errorType = srcBuf.readUInt32(ref this.dwSymbolCoin);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 16L)
            {
                errorType = srcBuf.readUInt32(ref this.dwDiamond);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 17L)
            {
                errorType = srcBuf.readUInt32(ref this.dwHuoYueDu);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 18L)
            {
                errorType = srcBuf.readUInt32(ref this.dwMatchPointPer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 19L)
            {
                errorType = srcBuf.readUInt32(ref this.dwMatchPointGuild);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 21L)
            {
                errorType = srcBuf.readUInt32(ref this.dwAchieve);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else if (selector == 22L)
            {
                errorType = srcBuf.readUInt32(ref this.dwMasterPoint);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                errorType = srcBuf.readUInt8(ref this.bReverse);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            return(errorType);
        }
        public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
        {
            srcBuf.disableEndian();
            if (cutVer == 0u || ResRandomRewardStore.CURRVERSION < cutVer)
            {
                cutVer = ResRandomRewardStore.CURRVERSION;
            }
            if (ResRandomRewardStore.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwRewardID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 100;

            if (this.szRewardDesc_ByteArray.GetLength(0) < num)
            {
                this.szRewardDesc_ByteArray = new byte[ResRandomRewardStore.LENGTH_szRewardDesc];
            }
            errorType = srcBuf.readCString(ref this.szRewardDesc_ByteArray, num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCalculateType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMissOverlie);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bRewardNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.astRewardDetail.Length < 20)
            {
                this.astRewardDetail = new ResDT_RandomRewardInfo[20];
                for (int i = 0; i < 20; i++)
                {
                    this.astRewardDetail[i] = new ResDT_RandomRewardInfo();
                }
            }
            for (int j = 0; j < 20; j++)
            {
                errorType = this.astRewardDetail[j].load(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #22
0
        public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
        {
            srcBuf.disableEndian();
            if (cutVer == 0u || ResComposeInfo.CURRVERSION < cutVer)
            {
                cutVer = ResComposeInfo.CURRVERSION;
            }
            if (ResComposeInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwCompID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 64;

            if (this.szName_ByteArray.GetLength(0) < num)
            {
                this.szName_ByteArray = new byte[ResComposeInfo.LENGTH_szName];
            }
            errorType = srcBuf.readCString(ref this.szName_ByteArray, num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCoinComp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCouponsComp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCompCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 4; i++)
            {
                errorType = this.astCompInfo[i].load(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #23
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_PLAYERINFO.CURRVERSION < cutVer)
            {
                cutVer = COMDT_PLAYERINFO.CURRVERSION;
            }
            if (COMDT_PLAYERINFO.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bObjCamp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bObjType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bPosOfCamp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwObjId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szName.GetLength(0))
            {
                if ((ulong)num > (ulong)COMDT_PLAYERINFO.LENGTH_szName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szName = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szName, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szName[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szName) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            long selector = (long)this.bObjType;

            errorType = this.stDetail.unpack(selector, ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 3; i++)
            {
                errorType = this.astChoiceHero[i].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            return(errorType);
        }
Beispiel #24
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResComposeInfo.CURRVERSION < cutVer)
            {
                cutVer = ResComposeInfo.CURRVERSION;
            }
            if (ResComposeInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwCompID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num = 0u;

            errorType = srcBuf.readUInt32(ref num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (num > (uint)srcBuf.getLeftSize())
            {
                return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
            }
            if (num > (uint)this.szName_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResComposeInfo.LENGTH_szName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szName_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szName_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szName_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szName_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwCoinComp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCouponsComp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCompCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 4; i++)
            {
                errorType = this.astCompInfo[i].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
        public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
        {
            srcBuf.disableEndian();
            if (cutVer == 0u || ResLicenseInfo.CURRVERSION < cutVer)
            {
                cutVer = ResLicenseInfo.CURRVERSION;
            }
            if (ResLicenseInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwLicenseID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 128;

            if (this.szLicenseName_ByteArray.GetLength(0) < num)
            {
                this.szLicenseName_ByteArray = new byte[ResLicenseInfo.LENGTH_szLicenseName];
            }
            errorType = srcBuf.readCString(ref this.szLicenseName_ByteArray, num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num2 = 128;

            if (this.szDesc_ByteArray.GetLength(0) < num2)
            {
                this.szDesc_ByteArray = new byte[ResLicenseInfo.LENGTH_szDesc];
            }
            errorType = srcBuf.readCString(ref this.szDesc_ByteArray, num2);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num3 = 128;

            if (this.szIconPath_ByteArray.GetLength(0) < num3)
            {
                this.szIconPath_ByteArray = new byte[ResLicenseInfo.LENGTH_szIconPath];
            }
            errorType = srcBuf.readCString(ref this.szIconPath_ByteArray, num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bUnlockCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 3; i++)
            {
                errorType = srcBuf.readUInt32(ref this.UnlockArray[i]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt8(ref this.bIsAnd);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
 public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     if ((cutVer == 0) || (CURRVERSION < cutVer))
     {
         cutVer = CURRVERSION;
     }
     if (BASEVERSION > cutVer)
     {
         return TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL;
     }
     type = this.stSelfUin.unpack(ref srcBuf, cutVer);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt8(ref this.bGrade);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         type = srcBuf.readUInt32(ref this.dwClass);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         type = srcBuf.readUInt32(ref this.dwSelfTotalFightCnt);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         type = srcBuf.readUInt32(ref this.dwSelfFightWinCnt);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         type = srcBuf.readUInt32(ref this.dwSelfScore);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         type = srcBuf.readInt32(ref this.iTotalRecordNum);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         type = srcBuf.readUInt8(ref this.bRecordNum);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return type;
         }
         if (250 < this.bRecordNum)
         {
             return TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT;
         }
         for (int i = 0; i < this.bRecordNum; i++)
         {
             type = this.astRecoed[i].unpack(ref srcBuf, cutVer);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return type;
             }
         }
     }
     return type;
 }
Beispiel #27
0
        public TdrError.ErrorType load(ref TdrReadBuf srcBuf, uint cutVer)
        {
            srcBuf.disableEndian();
            if (cutVer == 0u || ResMiShuInfo.CURRVERSION < cutVer)
            {
                cutVer = ResMiShuInfo.CURRVERSION;
            }
            if (ResMiShuInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 64;

            if (this.szName_ByteArray.GetLength(0) < num)
            {
                this.szName_ByteArray = new byte[ResMiShuInfo.LENGTH_szName];
            }
            errorType = srcBuf.readCString(ref this.szName_ByteArray, num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num2 = 256;

            if (this.szDesc_ByteArray.GetLength(0) < num2)
            {
                this.szDesc_ByteArray = new byte[ResMiShuInfo.LENGTH_szDesc];
            }
            errorType = srcBuf.readCString(ref this.szDesc_ByteArray, num2);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num3 = 256;

            if (this.szUnOpenDesc_ByteArray.GetLength(0) < num3)
            {
                this.szUnOpenDesc_ByteArray = new byte[ResMiShuInfo.LENGTH_szUnOpenDesc];
            }
            errorType = srcBuf.readCString(ref this.szUnOpenDesc_ByteArray, num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwIconID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bGotoID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bShowCoinLimit);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCoinGetPath);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
 public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     if ((cutVer == 0) || (CURRVERSION < cutVer))
     {
         cutVer = CURRVERSION;
     }
     if (BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     type = srcBuf.readUInt32(ref this.dwMapId);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = this.stLevelCommonInfo.unpack(ref srcBuf, cutVer);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsCanPVP);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsCanPVE);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwAttackOrderID);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt16(ref this.wOriginalGoldCoinInBattle);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwDynamicPropertyCfg);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBattleTaskOfCamp1);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBattleTaskOfCamp2);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         uint dest = 0;
         type = srcBuf.readUInt32(ref dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (dest > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (dest > this.szMusicStartEvent_ByteArray.GetLength(0))
         {
             if (dest > LENGTH_szMusicStartEvent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szMusicStartEvent_ByteArray = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szMusicStartEvent_ByteArray, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szMusicStartEvent_ByteArray[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szMusicStartEvent_ByteArray) + 1;
         if (dest != num2)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         uint num3 = 0;
         type = srcBuf.readUInt32(ref num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (num3 > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (num3 > this.szMusicEndEvent_ByteArray.GetLength(0))
         {
             if (num3 > LENGTH_szMusicEndEvent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szMusicEndEvent_ByteArray = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szMusicEndEvent_ByteArray, (int)num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szMusicEndEvent_ByteArray[((int)num3) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num4 = TdrTypeUtil.cstrlen(this.szMusicEndEvent_ByteArray) + 1;
         if (num3 != num4)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         uint num5 = 0;
         type = srcBuf.readUInt32(ref num5);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (num5 > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (num5 > this.szAmbientSoundEvent_ByteArray.GetLength(0))
         {
             if (num5 > LENGTH_szAmbientSoundEvent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szAmbientSoundEvent_ByteArray = new byte[num5];
         }
         if (1 > num5)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szAmbientSoundEvent_ByteArray, (int)num5);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szAmbientSoundEvent_ByteArray[((int)num5) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num6 = TdrTypeUtil.cstrlen(this.szAmbientSoundEvent_ByteArray) + 1;
         if (num5 != num6)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         uint num7 = 0;
         type = srcBuf.readUInt32(ref num7);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (num7 > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (num7 > this.szBankResourceName_ByteArray.GetLength(0))
         {
             if (num7 > LENGTH_szBankResourceName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szBankResourceName_ByteArray = new byte[num7];
         }
         if (1 > num7)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szBankResourceName_ByteArray, (int)num7);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szBankResourceName_ByteArray[((int)num7) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num8 = TdrTypeUtil.cstrlen(this.szBankResourceName_ByteArray) + 1;
             if (num7 != num8)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt8(ref this.bEntertainmentSubType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             this.TransferData();
         }
     }
     return(type);
 }
Beispiel #29
0
 public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     if ((cutVer == 0) || (CURRVERSION < cutVer))
     {
         cutVer = CURRVERSION;
     }
     if (BASEVERSION > cutVer)
     {
         return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
     }
     type = this.stLBSLocation.unpack(ref srcBuf, cutVer);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt8(ref this.bIsLocationExist);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readInt32(ref this.iCellRefer);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (0 > this.iCellRefer)
         {
             return(TdrError.ErrorType.TDR_ERR_MINUS_REFER_VALUE);
         }
         if (20 < this.iCellRefer)
         {
             return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
         }
         this.astLBSCells = new LBSCell[this.iCellRefer];
         for (int i = 0; i < this.iCellRefer; i++)
         {
             this.astLBSCells[i] = new LBSCell();
         }
         for (int j = 0; j < this.iCellRefer; j++)
         {
             type = this.astLBSCells[j].unpack(ref srcBuf, cutVer);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
         type = srcBuf.readInt32(ref this.iWifiRefer);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (0 > this.iWifiRefer)
         {
             return(TdrError.ErrorType.TDR_ERR_MINUS_REFER_VALUE);
         }
         if (20 < this.iWifiRefer)
         {
             return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
         }
         this.astLBSWifi = new LBSWifi[this.iWifiRefer];
         for (int k = 0; k < this.iWifiRefer; k++)
         {
             this.astLBSWifi[k] = new LBSWifi();
         }
         for (int m = 0; m < this.iWifiRefer; m++)
         {
             type = this.astLBSWifi[m].unpack(ref srcBuf, cutVer);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
     }
     return(type);
 }
        public TdrError.ErrorType unpack(long selector, ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_MATCHTEAM_DESTROY_REASON.CURRVERSION < cutVer)
            {
                cutVer = COMDT_MATCHTEAM_DESTROY_REASON.CURRVERSION;
            }
            if (COMDT_MATCHTEAM_DESTROY_REASON.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            ProtocolObject protocolObject = this.select(selector);

            if (protocolObject != null)
            {
                return(protocolObject.unpack(ref srcBuf, cutVer));
            }
            TdrError.ErrorType errorType;
            if (selector == 20L)
            {
                if (this.szLeaveAcntName == null)
                {
                    this.szLeaveAcntName = new byte[64];
                }
                uint num = 0u;
                errorType = srcBuf.readUInt32(ref num);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
                if (num > (uint)srcBuf.getLeftSize())
                {
                    return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
                }
                if (num > (uint)this.szLeaveAcntName.GetLength(0))
                {
                    if ((long)num > (long)((ulong)COMDT_MATCHTEAM_DESTROY_REASON.LENGTH_szLeaveAcntName))
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                    }
                    this.szLeaveAcntName = new byte[num];
                }
                if (1u > num)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
                }
                errorType = srcBuf.readCString(ref this.szLeaveAcntName, (int)num);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
                if (this.szLeaveAcntName[(int)(num - 1u)] != 0)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                }
                int num2 = TdrTypeUtil.cstrlen(this.szLeaveAcntName) + 1;
                if ((ulong)num != (ulong)((long)num2))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                }
            }
            else
            {
                errorType = srcBuf.readUInt8(ref this.bReserved);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            return(errorType);
        }