Beispiel #1
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResAskforTemplet.CURRVERSION < cutVer)
            {
                cutVer = ResAskforTemplet.CURRVERSION;
            }
            if (ResAskforTemplet.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.readUInt16(ref this.wItemType);
            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.szContent_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResAskforTemplet.LENGTH_szContent)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szContent_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szContent_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szContent_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szContent_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #2
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || CSDT_CHEAT_SENDMAIL.CURRVERSION < cutVer)
            {
                cutVer = CSDT_CHEAT_SENDMAIL.CURRVERSION;
            }
            if (CSDT_CHEAT_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.szTo.GetLength(0))
            {
                if ((ulong)num > (ulong)CSDT_CHEAT_SENDMAIL.LENGTH_szTo)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTo = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTo, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTo[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szTo) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                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);
                }
            }
            return(errorType);
        }
Beispiel #3
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 = srcBuf.readInt32(ref this.iCfgID);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readInt32(ref this.iNodeId);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readInt32(ref this.iDialogStyle);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readInt32(ref this.iUse3dPortrait);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readInt32(ref this.iCharacterCfgId);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readInt32(ref this.iActorType);
         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.szAnimName_ByteArray.GetLength(0))
         {
             if (dest > LENGTH_szAnimName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szAnimName_ByteArray = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szAnimName_ByteArray, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szAnimName_ByteArray[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szAnimName_ByteArray) + 1;
         if (dest != num2)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         type = srcBuf.readInt32(ref this.iAnimLoop);
         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.szImagePath_ByteArray.GetLength(0))
         {
             if (num3 > LENGTH_szImagePath)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szImagePath_ByteArray = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szImagePath_ByteArray, (int)num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szImagePath_ByteArray[((int)num3) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num4 = TdrTypeUtil.cstrlen(this.szImagePath_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.szAgeActionName_ByteArray.GetLength(0))
         {
             if (num5 > LENGTH_szAgeActionName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szAgeActionName_ByteArray = new byte[num5];
         }
         if (1 > num5)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szAgeActionName_ByteArray, (int)num5);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szAgeActionName_ByteArray[((int)num5) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num6 = TdrTypeUtil.cstrlen(this.szAgeActionName_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.szDialogTitle_ByteArray.GetLength(0))
         {
             if (num7 > LENGTH_szDialogTitle)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szDialogTitle_ByteArray = new byte[num7];
         }
         if (1 > num7)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szDialogTitle_ByteArray, (int)num7);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szDialogTitle_ByteArray[((int)num7) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num8 = TdrTypeUtil.cstrlen(this.szDialogTitle_ByteArray) + 1;
         if (num7 != num8)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         uint num9 = 0;
         type = srcBuf.readUInt32(ref num9);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (num9 > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (num9 > this.szDialogContent_ByteArray.GetLength(0))
         {
             if (num9 > LENGTH_szDialogContent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szDialogContent_ByteArray = new byte[num9];
         }
         if (1 > num9)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szDialogContent_ByteArray, (int)num9);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szDialogContent_ByteArray[((int)num9) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num10 = TdrTypeUtil.cstrlen(this.szDialogContent_ByteArray) + 1;
             if (num9 != num10)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt8(ref this.bFadeInType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bFadeOutType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bIOSHide);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             this.TransferData();
         }
     }
     return(type);
 }
Beispiel #4
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResActivity.CURRVERSION < cutVer)
            {
                cutVer = ResActivity.CURRVERSION;
            }
            if (ResActivity.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);
            }
            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)ResActivity.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.dwSubID);
            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.szSubName_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResActivity.LENGTH_szSubName))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szSubName_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szSubName_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szSubName_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szSubName_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt16(ref this.wHard);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wResetLimitTime);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wLimitTimes);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wStartCostAP);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wFinishCostAP);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCD);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wAcntLvlLimit);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bOpenType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bWeekMask);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt16(ref this.wType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwLevelID);
            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.szDesc_ByteArray.GetLength(0))
            {
                if ((long)num5 > (long)((ulong)ResActivity.LENGTH_szDesc))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szDesc_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szDesc_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1;

            if ((ulong)num5 != (ulong)((long)num6))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt16(ref this.wIsHide);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwFucUnlockID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num7 = 0u;

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #5
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || CSPKG_SEND_GUILD_MAIL_REQ.CURRVERSION < cutVer)
            {
                cutVer = CSPKG_SEND_GUILD_MAIL_REQ.CURRVERSION;
            }
            if (CSPKG_SEND_GUILD_MAIL_REQ.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.szSubject.GetLength(0))
            {
                if ((ulong)num > (ulong)CSPKG_SEND_GUILD_MAIL_REQ.LENGTH_szSubject)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szSubject = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szSubject, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szSubject[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szSubject) + 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.szContent.GetLength(0))
            {
                if ((ulong)num3 > (ulong)CSPKG_SEND_GUILD_MAIL_REQ.LENGTH_szContent)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szContent = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szContent, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szContent[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szContent) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            return(errorType);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResBuyResult.CURRVERSION < cutVer)
            {
                cutVer = ResBuyResult.CURRVERSION;
            }
            if (ResBuyResult.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.bCostType);
            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.szDesc_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResBuyResult.LENGTH_szDesc)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szDesc_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szDesc_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bRuleCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 3; i++)
            {
                errorType = this.astResRule[i].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #7
0
 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.dwGameStartTime);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwDonateTime);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bVideoState);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             long bVideoState = this.bVideoState;
             type = this.stGameInfo.unpack(bVideoState, ref srcBuf, cutVer);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
     }
     return(type);
 }
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_ARENA_MEMBER_OF_ACNT.CURRVERSION < cutVer)
            {
                cutVer = COMDT_ARENA_MEMBER_OF_ACNT.CURRVERSION;
            }
            if (COMDT_ARENA_MEMBER_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);
            }
            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_ARENA_MEMBER_OF_ACNT.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);
            }
            errorType = srcBuf.readUInt32(ref this.dwLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwForceValue);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (COMDT_ARENA_MEMBER_OF_ACNT.VERSION_szHeadUrl <= cutVer)
            {
                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.szHeadUrl.GetLength(0))
                {
                    if ((ulong)num3 > (ulong)COMDT_ARENA_MEMBER_OF_ACNT.LENGTH_szHeadUrl)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                    }
                    this.szHeadUrl = new byte[num3];
                }
                if (1u > num3)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
                }
                errorType = srcBuf.readCString(ref this.szHeadUrl, (int)num3);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
                if (this.szHeadUrl[(int)(num3 - 1u)] != 0)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                }
                int num4 = TdrTypeUtil.cstrlen(this.szHeadUrl) + 1;
                if ((ulong)num3 != (ulong)((long)num4))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                }
            }
            errorType = srcBuf.readUInt32(ref this.dwPVPLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stBattleHero.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (COMDT_ARENA_MEMBER_OF_ACNT.VERSION_stVip <= cutVer)
            {
                errorType = this.stVip.unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                errorType = this.stVip.construct();
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            return(errorType);
        }
Beispiel #9
0
        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);
            }
            uint dest = 0;

            type = srcBuf.readUInt32(ref dest);
            if (type == TdrError.ErrorType.TDR_NO_ERROR)
            {
                if (dest > srcBuf.getLeftSize())
                {
                    return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
                }
                if (dest > this.szGuildName.GetLength(0))
                {
                    if (dest > LENGTH_szGuildName)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                    }
                    this.szGuildName = new byte[dest];
                }
                if (1 > dest)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
                }
                type = srcBuf.readCString(ref this.szGuildName, (int)dest);
                if (type == TdrError.ErrorType.TDR_NO_ERROR)
                {
                    if (this.szGuildName[((int)dest) - 1] != 0)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                    }
                    int num2 = TdrTypeUtil.cstrlen(this.szGuildName) + 1;
                    if (dest != num2)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                    }
                    type = srcBuf.readUInt64(ref this.ullBeInviteUid);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                    type = srcBuf.readInt32(ref this.iLogicWorldID);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                    type = srcBuf.readUInt8(ref this.bNewFlag);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                    type = srcBuf.readUInt32(ref this.dwInviteTime);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                    type = srcBuf.readUInt8(ref this.bErrorCode);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                }
            }
            return(type);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResHeroSkinShop.CURRVERSION < cutVer)
            {
                cutVer = ResHeroSkinShop.CURRVERSION;
            }
            if (ResHeroSkinShop.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.readUInt32(ref this.dwHeroID);
            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.szHeroName_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResHeroSkinShop.LENGTH_szHeroName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szHeroName_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szHeroName_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szHeroName_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szHeroName_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwSkinID);
            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.szSkinName_ByteArray.GetLength(0))
            {
                if ((ulong)num3 > (ulong)ResHeroSkinShop.LENGTH_szSkinName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szSkinName_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szSkinName_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szSkinName_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szSkinName_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.szSkinDesc_ByteArray.GetLength(0))
            {
                if ((ulong)num5 > (ulong)ResHeroSkinShop.LENGTH_szSkinDesc)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szSkinDesc_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szSkinDesc_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szSkinDesc_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szSkinDesc_ByteArray) + 1;

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

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num9 = 0u;

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

            if ((ulong)num9 != (ulong)((long)num10))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bSkinQuality);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bGetPathType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num11 = 0u;

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

            if ((ulong)num11 != (ulong)((long)num12))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyCoupons);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyCoupons);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuySkinCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuySkinCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyDiamond);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyDiamond);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyMixPay);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyItem);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyItemCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsPresent);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsAskfor);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwSortId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bPromotionCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 5; i++)
            {
                errorType = srcBuf.readUInt32(ref this.PromotionID[i]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt32(ref this.dwChgItemCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num13 = 0u;

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

            if ((ulong)num13 != (ulong)((long)num14))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num15 = 0u;

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

            if ((ulong)num15 != (ulong)((long)num16))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwOnTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwOffTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwReleaseId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bShowInShop);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bShowInMgr);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bRankLimitType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bRankLimitGrade);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt64(ref this.ullRankLimitParam);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stRegisterSale.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwFactoryID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #11
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || CSDT_ACNT_DETAIL_INFO.CURRVERSION < cutVer)
            {
                cutVer = CSDT_ACNT_DETAIL_INFO.CURRVERSION;
            }
            if (CSDT_ACNT_DETAIL_INFO.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);
            }
            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)CSDT_ACNT_DETAIL_INFO.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);
            }
            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.szOpenID.GetLength(0))
            {
                if ((ulong)num3 > (ulong)CSDT_ACNT_DETAIL_INFO.LENGTH_szOpenID)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szOpenID = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szOpenID, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szOpenID[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szOpenID) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readInt32(ref this.iLogicWorldId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsOnline);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwLastLoginTime);
            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.szOpenUrl.GetLength(0))
            {
                if ((ulong)num5 > (ulong)CSDT_ACNT_DETAIL_INFO.LENGTH_szOpenUrl)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szOpenUrl = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szOpenUrl, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szOpenUrl[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szOpenUrl) + 1;

            if ((ulong)num5 != (ulong)((long)num6))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwExp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwPower);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwPvpLevel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwPvpExp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bGradeOfRank);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bMaxGradeOfRank);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwWangZheCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stGameVip.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stStatistic.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stGuildInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stBanTime.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stMostUsedHero.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (CSDT_ACNT_DETAIL_INFO.VERSION_dwQQVIPMask <= cutVer)
            {
                errorType = srcBuf.readUInt32(ref this.dwQQVIPMask);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                this.dwQQVIPMask = 0u;
            }
            if (CSDT_ACNT_DETAIL_INFO.VERSION_bPrivilege <= cutVer)
            {
                errorType = srcBuf.readUInt8(ref this.bPrivilege);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                this.bPrivilege = 0;
            }
            if (CSDT_ACNT_DETAIL_INFO.VERSION_bGender <= cutVer)
            {
                errorType = srcBuf.readUInt8(ref this.bGender);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                this.bGender = 0;
            }
            errorType = this.stHonorInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCreditValue);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stRankInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCurClassOfRank);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (CSDT_ACNT_DETAIL_INFO.VERSION_stLikeNum <= cutVer)
            {
                errorType = this.stLikeNum.unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            else
            {
                errorType = this.stLikeNum.construct();
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt32(ref this.dwAchieveMentScore);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 3; i++)
            {
                errorType = this.astShowAchievement[i].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            uint num7 = 0u;

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwRefuseFriendBits);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stAcntMasterInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iSumDelCreditValue);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMostDelCreditType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt64(ref this.ullUserPrivacyBits);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stFriendCard.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || NewbieGuideBannerGuideConf.CURRVERSION < cutVer)
            {
                cutVer = NewbieGuideBannerGuideConf.CURRVERSION;
            }
            if (NewbieGuideBannerGuideConf.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt16(ref this.wID);
            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.szRemark_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)NewbieGuideBannerGuideConf.LENGTH_szRemark)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szRemark_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szRemark_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szRemark_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szRemark_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwGuideBit);
            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.szTitleName_ByteArray.GetLength(0))
            {
                if ((ulong)num3 > (ulong)NewbieGuideBannerGuideConf.LENGTH_szTitleName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTitleName_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTitleName_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTitleName_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szTitleName_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.szBtnName_ByteArray.GetLength(0))
            {
                if ((ulong)num5 > (ulong)NewbieGuideBannerGuideConf.LENGTH_szBtnName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szBtnName_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szBtnName_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szBtnName_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szBtnName_ByteArray) + 1;

            if ((ulong)num5 != (ulong)((long)num6))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            for (int i = 0; i < 5; i++)
            {
                errorType = this.astPicPath[i].unpack(ref srcBuf, cutVer);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #13
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || CSPKG_CLT_PERFORMANCE.CURRVERSION < cutVer)
            {
                cutVer = CSPKG_CLT_PERFORMANCE.CURRVERSION;
            }
            if (CSPKG_CLT_PERFORMANCE.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readInt32(ref this.iMapID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iPlayerCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt8(ref this.chModelLOD);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt8(ref this.chParticleLOD);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt8(ref this.chCameraHeight);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt8(ref this.chEnableOutline);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iFps10PercentNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iFps18PercentNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iAveFps);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iPingAverage);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iPingVariance);
            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.szDeviceModel.GetLength(0))
            {
                if ((long)num > (long)((ulong)CSPKG_CLT_PERFORMANCE.LENGTH_szDeviceModel))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szDeviceModel = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szDeviceModel, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szDeviceModel[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szDeviceModel) + 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.szGPUName.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)CSPKG_CLT_PERFORMANCE.LENGTH_szGPUName))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szGPUName = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szGPUName, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szGPUName[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szGPUName) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readInt32(ref this.iCpuCoreNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iSysMemorySize);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iAvailMemory);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iIsTongCai);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iIsSpeedUp);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
Beispiel #14
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);
            }
            uint dest = 0;

            type = srcBuf.readUInt32(ref dest);
            if (type == TdrError.ErrorType.TDR_NO_ERROR)
            {
                if (dest > srcBuf.getLeftSize())
                {
                    return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
                }
                if (dest > this.szOpenid.GetLength(0))
                {
                    if (dest > LENGTH_szOpenid)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                    }
                    this.szOpenid = new byte[dest];
                }
                if (1 > dest)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
                }
                type = srcBuf.readCString(ref this.szOpenid, (int)dest);
                if (type != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(type);
                }
                if (this.szOpenid[((int)dest) - 1] != 0)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                }
                int num2 = TdrTypeUtil.cstrlen(this.szOpenid) + 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.szNickname.GetLength(0))
                {
                    if (num3 > LENGTH_szNickname)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                    }
                    this.szNickname = new byte[num3];
                }
                if (1 > num3)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
                }
                type = srcBuf.readCString(ref this.szNickname, (int)num3);
                if (type != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(type);
                }
                if (this.szNickname[((int)num3) - 1] != 0)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                }
                int num4 = TdrTypeUtil.cstrlen(this.szNickname) + 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.szPotraitURL.GetLength(0))
                {
                    if (num5 > LENGTH_szPotraitURL)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                    }
                    this.szPotraitURL = new byte[num5];
                }
                if (1 > num5)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
                }
                type = srcBuf.readCString(ref this.szPotraitURL, (int)num5);
                if (type == TdrError.ErrorType.TDR_NO_ERROR)
                {
                    if (this.szPotraitURL[((int)num5) - 1] != 0)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                    }
                    int num6 = TdrTypeUtil.cstrlen(this.szPotraitURL) + 1;
                    if (num5 != num6)
                    {
                        return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
                    }
                    type = srcBuf.readInt32(ref this.iGender);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                    type = srcBuf.readInt32(ref this.iExtraSize);
                    if (type != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(type);
                    }
                    if (0 > this.iExtraSize)
                    {
                        return(TdrError.ErrorType.TDR_ERR_MINUS_REFER_VALUE);
                    }
                    if (0x200 < this.iExtraSize)
                    {
                        return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
                    }
                    this.szExtraInfo = new sbyte[this.iExtraSize];
                    for (int i = 0; i < this.iExtraSize; i++)
                    {
                        type = srcBuf.readInt8(ref this.szExtraInfo[i]);
                        if (type != TdrError.ErrorType.TDR_NO_ERROR)
                        {
                            return(type);
                        }
                    }
                }
            }
            return(type);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResDT_RegisterSale_Info.CURRVERSION < cutVer)
            {
                cutVer = ResDT_RegisterSale_Info.CURRVERSION;
            }
            if (ResDT_RegisterSale_Info.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bIsValid);
            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.szStartTimeStr_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResDT_RegisterSale_Info.LENGTH_szStartTimeStr)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szStartTimeStr_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szStartTimeStr_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szStartTimeStr_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szStartTimeStr_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                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.dwValidTime);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyCoupons);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyDiamond);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyItemCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwSortID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #16
0
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_TRANS_CONTEXT_ADD_FRIEND.CURRVERSION < cutVer)
            {
                cutVer = COMDT_TRANS_CONTEXT_ADD_FRIEND.CURRVERSION;
            }
            if (COMDT_TRANS_CONTEXT_ADD_FRIEND.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = this.stAcntUniq.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stAddFriendUniq.unpack(ref srcBuf, cutVer);
            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.szVerificationInfo.GetLength(0))
            {
                if ((ulong)num > (ulong)COMDT_TRANS_CONTEXT_ADD_FRIEND.LENGTH_szVerificationInfo)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szVerificationInfo = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szVerificationInfo, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szVerificationInfo[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szVerificationInfo) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = this.stSrcUserInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stUserSource.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bDestAcntOnline);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwDestAcntGameSvrEntity);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResGuildGradeConf.CURRVERSION < cutVer)
            {
                cutVer = ResGuildGradeConf.CURRVERSION;
            }
            if (ResGuildGradeConf.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bIndex);
            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.szGradeDesc_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResGuildGradeConf.LENGTH_szGradeDesc)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szGradeDesc_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szGradeDesc_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szGradeDesc_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szGradeDesc_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readInt32(ref this.iScore);
            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 ((ulong)num3 > (ulong)ResGuildGradeConf.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);
            }
            errorType = srcBuf.readInt32(ref this.iStar);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwGold);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwDiamond);
            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.dwItemNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwGuildHeadImageShopOpenSlotCnt);
            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 || ResGameTask.CURRVERSION < cutVer)
            {
                cutVer = ResGameTask.CURRVERSION;
            }
            if (ResGameTask.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);
            }
            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)ResGameTask.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.readUInt8(ref this.bCompare);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iTarget);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iStartDelay);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iTimeLimit);
            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.szStartAction_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResGameTask.LENGTH_szStartAction))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szStartAction_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szStartAction_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szStartAction_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szStartAction_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.szCloseAction_ByteArray.GetLength(0))
            {
                if ((long)num5 > (long)((ulong)ResGameTask.LENGTH_szCloseAction))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szCloseAction_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szCloseAction_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szCloseAction_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szCloseAction_ByteArray) + 1;

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

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readInt32(ref this.iParam1);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iParam2);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iParam3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readInt32(ref this.iParam4);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #19
0
 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.readInt32(ref this.iComplaintLogicWorldID);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt64(ref this.ullComplaintUserUid);
         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.szComplaintUserOpenId.GetLength(0))
         {
             if (dest > LENGTH_szComplaintUserOpenId)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szComplaintUserOpenId = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szComplaintUserOpenId, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szComplaintUserOpenId[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szComplaintUserOpenId) + 1;
         if (dest != num2)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         type = srcBuf.readUInt32(ref this.dwClientStartTime);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readInt32(ref this.iBattlePlayerNumber);
         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.szComplaintPlayerName.GetLength(0))
         {
             if (num3 > LENGTH_szComplaintPlayerName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szComplaintPlayerName = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szComplaintPlayerName, (int)num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szComplaintPlayerName[((int)num3) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num4 = TdrTypeUtil.cstrlen(this.szComplaintPlayerName) + 1;
         if (num3 != num4)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         type = srcBuf.readInt32(ref this.iComplaintPlayerCamp);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwComplaintReason);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         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.szComplaintRemark.GetLength(0))
         {
             if (num5 > LENGTH_szComplaintRemark)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szComplaintRemark = new byte[num5];
         }
         if (1 > num5)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szComplaintRemark, (int)num5);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szComplaintRemark[((int)num5) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num6 = TdrTypeUtil.cstrlen(this.szComplaintRemark) + 1;
             if (num5 != num6)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
         }
     }
     return(type);
 }
 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.readUInt32(ref this.dwGuildHeadID);
     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.szGuildName.GetLength(0))
         {
             if (dest > LENGTH_szGuildName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szGuildName = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szGuildName, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szGuildName[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szGuildName) + 1;
         if (dest != num2)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         type = srcBuf.readUInt8(ref this.bGuildLevel);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bMemberNum);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (VERSION_dwStar <= cutVer)
         {
             type = srcBuf.readUInt32(ref this.dwStar);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
         else
         {
             this.dwStar = 0;
         }
         if (VERSION_dwTotalRankPoint <= cutVer)
         {
             type = srcBuf.readUInt32(ref this.dwTotalRankPoint);
             if (type == TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             return(type);
         }
         this.dwTotalRankPoint = 0;
     }
     return(type);
 }
Beispiel #21
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 = srcBuf.readUInt32(ref this.dwDrawID);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt8(ref this.bDrawType);
         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.szStartTime_ByteArray.GetLength(0))
         {
             if (dest > LENGTH_szStartTime)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szStartTime_ByteArray = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szStartTime_ByteArray, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szStartTime_ByteArray[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szStartTime_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.szEndTime_ByteArray.GetLength(0))
         {
             if (num3 > LENGTH_szEndTime)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szEndTime_ByteArray = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szEndTime_ByteArray, (int)num3);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szEndTime_ByteArray[((int)num3) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num4 = TdrTypeUtil.cstrlen(this.szEndTime_ByteArray) + 1;
             if (num3 != num4)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt32(ref this.dwStartTimeGen);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwEndTimeGen);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bCostType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwCostPrice);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwRewardPoolID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             this.TransferData();
         }
     }
     return(type);
 }
 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 = srcBuf.readUInt32(ref this.dwMatchType);
         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.szMatchName_ByteArray.GetLength(0))
         {
             if (dest > LENGTH_szMatchName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szMatchName_ByteArray = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szMatchName_ByteArray, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szMatchName_ByteArray[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szMatchName_ByteArray) + 1;
         if (dest != num2)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         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 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.szMusicStartEvent_ByteArray.GetLength(0))
         {
             if (num3 > LENGTH_szMusicStartEvent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szMusicStartEvent_ByteArray = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szMusicStartEvent_ByteArray, (int)num3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szMusicStartEvent_ByteArray[((int)num3) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num4 = TdrTypeUtil.cstrlen(this.szMusicStartEvent_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.szMusicEndEvent_ByteArray.GetLength(0))
         {
             if (num5 > LENGTH_szMusicEndEvent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szMusicEndEvent_ByteArray = new byte[num5];
         }
         if (1 > num5)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szMusicEndEvent_ByteArray, (int)num5);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szMusicEndEvent_ByteArray[((int)num5) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num6 = TdrTypeUtil.cstrlen(this.szMusicEndEvent_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.szAmbientSoundEvent_ByteArray.GetLength(0))
         {
             if (num7 > LENGTH_szAmbientSoundEvent)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szAmbientSoundEvent_ByteArray = new byte[num7];
         }
         if (1 > num7)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szAmbientSoundEvent_ByteArray, (int)num7);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szAmbientSoundEvent_ByteArray[((int)num7) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num8 = TdrTypeUtil.cstrlen(this.szAmbientSoundEvent_ByteArray) + 1;
         if (num7 != num8)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         uint num9 = 0;
         type = srcBuf.readUInt32(ref num9);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (num9 > srcBuf.getLeftSize())
         {
             return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ);
         }
         if (num9 > this.szBankResourceName_ByteArray.GetLength(0))
         {
             if (num9 > LENGTH_szBankResourceName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szBankResourceName_ByteArray = new byte[num9];
         }
         if (1 > num9)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szBankResourceName_ByteArray, (int)num9);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szBankResourceName_ByteArray[((int)num9) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num10 = TdrTypeUtil.cstrlen(this.szBankResourceName_ByteArray) + 1;
             if (num9 != num10)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt32(ref this.dwConsumFreeItemID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwConsumPayItemID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwCousumItemNum);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bCoinType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwWinAwardID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwLoseAwardID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwDayRankID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwSeasonRankID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwGuildRankID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwPaidPercent);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwSeasonAwardIconID);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwSubType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             this.TransferData();
         }
     }
     return(type);
 }
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResGuideTipInfo.CURRVERSION < cutVer)
            {
                cutVer = ResGuideTipInfo.CURRVERSION;
            }
            if (ResGuideTipInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readInt32(ref this.iCfgID);
            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.szImagePath_ByteArray.GetLength(0))
            {
                if ((long)num > (long)((ulong)ResGuideTipInfo.LENGTH_szImagePath))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szImagePath_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szImagePath_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szImagePath_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szImagePath_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.szTipTitle_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResGuideTipInfo.LENGTH_szTipTitle))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTipTitle_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTipTitle_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTipTitle_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szTipTitle_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.szTipContent_ByteArray.GetLength(0))
            {
                if ((long)num5 > (long)((ulong)ResGuideTipInfo.LENGTH_szTipContent))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTipContent_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTipContent_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTipContent_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szTipContent_ByteArray) + 1;

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

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #24
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 = srcBuf.readUInt32(ref this.dwID);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt32(ref this.dwSoulID);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt16(ref this.wTargetType);
         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.szDesc_ByteArray.GetLength(0))
         {
             if (dest > LENGTH_szDesc)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szDesc_ByteArray = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szDesc_ByteArray, (int)dest);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szDesc_ByteArray[((int)dest) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num2 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1;
             if (dest != num2)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt16(ref this.wIncomeType);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             for (int i = 0; i < 5; i++)
             {
                 type = srcBuf.readInt32(ref this.IncomeChangeRate[i]);
                 if (type != TdrError.ErrorType.TDR_NO_ERROR)
                 {
                     return(type);
                 }
             }
             for (int j = 0; j < 4; j++)
             {
                 type = this.astIncomeRule[j].unpack(ref srcBuf, cutVer);
                 if (type != TdrError.ErrorType.TDR_NO_ERROR)
                 {
                     return(type);
                 }
             }
             type = srcBuf.readInt32(ref this.iComputerChangeRate);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             this.TransferData();
         }
     }
     return(type);
 }
 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.readUInt32(ref this.dwPayLevel);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt8(ref this.bMaxGradeOfRank);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = this.stPvpDetailInfo.unpack(ref srcBuf, cutVer);
         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.szGuildName.GetLength(0))
         {
             if (dest > LENGTH_szGuildName)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szGuildName = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szGuildName, (int)dest);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szGuildName[((int)dest) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num2 = TdrTypeUtil.cstrlen(this.szGuildName) + 1;
             if (dest != num2)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
         }
     }
     return(type);
 }
        public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || COMDT_CLIENT_INFO_DATA.CURRVERSION < cutVer)
            {
                cutVer = COMDT_CLIENT_INFO_DATA.CURRVERSION;
            }
            if (COMDT_CLIENT_INFO_DATA.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.szSystemSoftware.GetLength(0))
            {
                if ((long)num > (long)((ulong)COMDT_CLIENT_INFO_DATA.LENGTH_szSystemSoftware))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szSystemSoftware = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szSystemSoftware, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szSystemSoftware[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szSystemSoftware) + 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.szSystemHardware.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)COMDT_CLIENT_INFO_DATA.LENGTH_szSystemHardware))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szSystemHardware = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szSystemHardware, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szSystemHardware[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szSystemHardware) + 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.szTelecomOper.GetLength(0))
            {
                if ((long)num5 > (long)((ulong)COMDT_CLIENT_INFO_DATA.LENGTH_szTelecomOper))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szTelecomOper = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szTelecomOper, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szTelecomOper[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szTelecomOper) + 1;

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

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readInt32(ref this.iLoginChannel);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num9 = 0u;

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

            if ((ulong)num9 != (ulong)((long)num10))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readInt32(ref this.iMemorySize);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            uint num11 = 0u;

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

            if ((ulong)num11 != (ulong)((long)num12))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            uint num13 = 0u;

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

            if ((ulong)num13 != (ulong)((long)num14))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            return(errorType);
        }
Beispiel #27
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResRewardMatchLevelInfo.CURRVERSION < cutVer)
            {
                cutVer = ResRewardMatchLevelInfo.CURRVERSION;
            }
            if (ResRewardMatchLevelInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwMapId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwMatchType);
            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.szMatchName_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResRewardMatchLevelInfo.LENGTH_szMatchName)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szMatchName_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szMatchName_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szMatchName_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szMatchName_ByteArray) + 1;

            if ((ulong)num != (ulong)((long)num2))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = this.stLevelCommonInfo.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsCanPVP);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsCanPVE);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwConsumFreeItemID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwConsumPayItemID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwCousumItemNum);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bCoinType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwWinAwardID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwLoseAwardID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwDayRankID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwSeasonRankID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwGuildRankID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwPaidPercent);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwSeasonAwardIconID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwSubType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bWinCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bLossCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwRankType);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
Beispiel #28
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResHeroShop.CURRVERSION < cutVer)
            {
                cutVer = ResHeroShop.CURRVERSION;
            }
            if (ResHeroShop.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt32(ref this.dwCfgID);
            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)ResHeroShop.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.readUInt8(ref this.bIsBuyCoupons);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyCoupons);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyArenaCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyBurnCoin);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyDiamond);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyDiamond);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyMixPay);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bIsBuyItem);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwBuyItemCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bObtWayType);
            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.szObtWay_ByteArray.GetLength(0))
            {
                if ((long)num3 > (long)((ulong)ResHeroShop.LENGTH_szObtWay))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szObtWay_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szObtWay_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szObtWay_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szObtWay_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt8(ref this.bIsPresent);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwSortId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bPromotionCnt);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            for (int i = 0; i < 5; i++)
            {
                errorType = srcBuf.readUInt32(ref this.PromotionID[i]);
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
            }
            errorType = srcBuf.readUInt32(ref this.dwChgItemCnt);
            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.szOnTimeStr_ByteArray.GetLength(0))
            {
                if ((long)num5 > (long)((ulong)ResHeroShop.LENGTH_szOnTimeStr))
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szOnTimeStr_ByteArray = new byte[num5];
            }
            if (1u > num5)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szOnTimeStr_ByteArray, (int)num5);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szOnTimeStr_ByteArray[(int)(num5 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num6 = TdrTypeUtil.cstrlen(this.szOnTimeStr_ByteArray) + 1;

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

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

            if ((ulong)num7 != (ulong)((long)num8))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            errorType = srcBuf.readUInt32(ref this.dwOnTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwOffTimeGen);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwReleaseId);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bShowInShop);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt8(ref this.bShowInMgr);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = this.stRegisterSale.unpack(ref srcBuf, cutVer);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            errorType = srcBuf.readUInt32(ref this.dwFactoryID);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            this.TransferData();
            return(errorType);
        }
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 = srcBuf.readUInt32(ref this.dwPromotionID);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         type = srcBuf.readUInt32(ref this.dwHeroID);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsBuyCoupons);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBuyCoupons);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsBuyCoin);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBuyCoin);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBuyArenaCoin);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBuyBurnCoin);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsBuyDiamond);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt32(ref this.dwBuyDiamond);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = srcBuf.readUInt8(ref this.bIsBuyMixPay);
         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.szOnTime_ByteArray.GetLength(0))
         {
             if (dest > LENGTH_szOnTime)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szOnTime_ByteArray = new byte[dest];
         }
         if (1 > dest)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szOnTime_ByteArray, (int)dest);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (this.szOnTime_ByteArray[((int)dest) - 1] != 0)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
         }
         int num2 = TdrTypeUtil.cstrlen(this.szOnTime_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.szOffTime_ByteArray.GetLength(0))
         {
             if (num3 > LENGTH_szOffTime)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
             }
             this.szOffTime_ByteArray = new byte[num3];
         }
         if (1 > num3)
         {
             return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
         }
         type = srcBuf.readCString(ref this.szOffTime_ByteArray, (int)num3);
         if (type == TdrError.ErrorType.TDR_NO_ERROR)
         {
             if (this.szOffTime_ByteArray[((int)num3) - 1] != 0)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             int num4 = TdrTypeUtil.cstrlen(this.szOffTime_ByteArray) + 1;
             if (num3 != num4)
             {
                 return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
             }
             type = srcBuf.readUInt32(ref this.dwOnTimeGen);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwOffTimeGen);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt8(ref this.bTag);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwDiscount);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             type = srcBuf.readUInt32(ref this.dwSortIndex);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
             this.TransferData();
         }
     }
     return(type);
 }
Beispiel #30
0
        public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer)
        {
            if (cutVer == 0u || ResSkinQualityPicInfo.CURRVERSION < cutVer)
            {
                cutVer = ResSkinQualityPicInfo.CURRVERSION;
            }
            if (ResSkinQualityPicInfo.BASEVERSION > cutVer)
            {
                return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL);
            }
            TdrError.ErrorType errorType = srcBuf.readUInt8(ref this.bQualityId);
            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.szQualityPicPath_ByteArray.GetLength(0))
            {
                if ((ulong)num > (ulong)ResSkinQualityPicInfo.LENGTH_szQualityPicPath)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szQualityPicPath_ByteArray = new byte[num];
            }
            if (1u > num)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szQualityPicPath_ByteArray, (int)num);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szQualityPicPath_ByteArray[(int)(num - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num2 = TdrTypeUtil.cstrlen(this.szQualityPicPath_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.szLabelPicPath_ByteArray.GetLength(0))
            {
                if ((ulong)num3 > (ulong)ResSkinQualityPicInfo.LENGTH_szLabelPicPath)
                {
                    return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG);
                }
                this.szLabelPicPath_ByteArray = new byte[num3];
            }
            if (1u > num3)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL);
            }
            errorType = srcBuf.readCString(ref this.szLabelPicPath_ByteArray, (int)num3);
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (this.szLabelPicPath_ByteArray[(int)(num3 - 1u)] != 0)
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            int num4 = TdrTypeUtil.cstrlen(this.szLabelPicPath_ByteArray) + 1;

            if ((ulong)num3 != (ulong)((long)num4))
            {
                return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT);
            }
            this.TransferData();
            return(errorType);
        }