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.ullGuildID); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = srcBuf.readUInt64(ref this.ullAcntUid); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = srcBuf.readUInt32(ref this.dwGameEntity); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = srcBuf.readUInt32(ref this.dwLogicWorldID); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = this.stGuildBriefInfo.unpack(ref srcBuf, cutVer); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = srcBuf.readUInt8(ref this.bSearchType); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } } } return type; }
public TdrError.ErrorType packTLV(long selector, ref TdrWriteBuf destBuf, bool useVarInt) { if (destBuf == null) { return(TdrError.ErrorType.TDR_ERR_ARG_IS_NULL); } TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; long num9 = selector; if ((num9 >= 0L) && (num9 <= 2L)) { switch (((int)num9)) { case 0: { if (!useVarInt) { uint num2 = TdrTLV.makeTag(0, TdrTLV.TdrTLVTypeId.TDR_TYPE_ID_4_BYTE); type = destBuf.writeVarUInt32(num2); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = destBuf.writeInt32(this.iNilCmd); if (type == TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } return(type); } uint src = TdrTLV.makeTag(0, TdrTLV.TdrTLVTypeId.TDR_TYPE_ID_VARINT); type = destBuf.writeVarUInt32(src); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = destBuf.writeVarInt32(this.iNilCmd); if (type == TdrError.ErrorType.TDR_NO_ERROR) { } return(type); } return(type); } case 1: if (this.szStrCmd != null) { uint num3 = TdrTLV.makeTag(1, TdrTLV.TdrTLVTypeId.TDR_TYPE_ID_LENGTH_DELIMITED); type = destBuf.writeVarUInt32(num3); if (type == TdrError.ErrorType.TDR_NO_ERROR) { int pos = destBuf.getUsedSize(); type = destBuf.reserve(4); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int count = TdrTypeUtil.cstrlen(this.szStrCmd); if (count >= 0x40) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } type = destBuf.writeCString(this.szStrCmd, count); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num6 = (destBuf.getUsedSize() - pos) - 4; type = destBuf.writeInt32(num6, pos); if (type == TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } return(type); } return(TdrError.ErrorType.TDR_ERR_UNION_SELECTE_FIELD_IS_NULL); case 2: { if (!useVarInt) { uint num8 = TdrTLV.makeTag(2, TdrTLV.TdrTLVTypeId.TDR_TYPE_ID_4_BYTE); type = destBuf.writeVarUInt32(num8); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = destBuf.writeInt32(this.iIntCmd); if (type == TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } return(type); } uint num7 = TdrTLV.makeTag(2, TdrTLV.TdrTLVTypeId.TDR_TYPE_ID_VARINT); type = destBuf.writeVarUInt32(num7); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = destBuf.writeVarInt32(this.iIntCmd); if (type == TdrError.ErrorType.TDR_NO_ERROR) { } return(type); } return(type); } } } return(TdrError.ErrorType.TDR_ERR_SUSPICIOUS_SELECTOR); }
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.dwCfgID); 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.szName_ByteArray.GetLength(0)) { if (dest > LENGTH_szName) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szName_ByteArray = new byte[dest]; } if (1 > dest) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szName_ByteArray, (int)dest); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szName_ByteArray[((int)dest) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szName_ByteArray) + 1; if (dest != num2) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } 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); } type = srcBuf.readUInt8(ref this.bIsBuyItem); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt32(ref this.dwBuyItemCnt); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bObtWayType); 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.szObtWay_ByteArray.GetLength(0)) { if (num3 > LENGTH_szObtWay) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szObtWay_ByteArray = new byte[num3]; } if (1 > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szObtWay_ByteArray, (int)num3); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szObtWay_ByteArray[((int)num3) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szObtWay_ByteArray) + 1; if (num3 != num4) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } type = srcBuf.readUInt8(ref this.bIsPresent); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt32(ref this.dwSortId); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bPromotionCnt); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } for (int i = 0; i < 5; i++) { type = srcBuf.readUInt32(ref this.PromotionID[i]); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } type = srcBuf.readUInt32(ref this.dwChgItemCnt); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } uint num6 = 0; type = srcBuf.readUInt32(ref num6); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (num6 > srcBuf.getLeftSize()) { return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ); } if (num6 > this.szOnTimeStr_ByteArray.GetLength(0)) { if (num6 > LENGTH_szOnTimeStr) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szOnTimeStr_ByteArray = new byte[num6]; } if (1 > num6) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szOnTimeStr_ByteArray, (int)num6); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szOnTimeStr_ByteArray[((int)num6) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num7 = TdrTypeUtil.cstrlen(this.szOnTimeStr_ByteArray) + 1; if (num6 != num7) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } uint num8 = 0; type = srcBuf.readUInt32(ref num8); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (num8 > srcBuf.getLeftSize()) { return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ); } if (num8 > this.szOffTimeStr_ByteArray.GetLength(0)) { if (num8 > LENGTH_szOffTimeStr) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szOffTimeStr_ByteArray = new byte[num8]; } if (1 > num8) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szOffTimeStr_ByteArray, (int)num8); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (this.szOffTimeStr_ByteArray[((int)num8) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num9 = TdrTypeUtil.cstrlen(this.szOffTimeStr_ByteArray) + 1; if (num8 != num9) { 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.readUInt32(ref this.dwReleaseId); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bShowInShop); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bShowInMgr); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } this.TransferData(); } } return(type); }
public override TdrError.ErrorType pack(ref TdrWriteBuf destBuf, 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 = destBuf.writeUInt64(this.ullVisitorUid); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = destBuf.writeUInt32(this.dwAcntSeq); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeInt32(this.iDbVersion); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(this.bRevertTransFlag); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(this.bRevertRegisterName); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(this.bRevertAcntInfo); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(this.bRevertHeroInfo); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(this.bRevertItemInfo); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int pos = destBuf.getUsedSize(); type = destBuf.reserve(4); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num2 = destBuf.getUsedSize(); int count = TdrTypeUtil.cstrlen(this.szRegisterName); if (count >= 0x40) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } type = destBuf.writeCString(this.szRegisterName, count); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(0); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num4 = destBuf.getUsedSize() - num2; type = destBuf.writeUInt32((uint)num4, pos); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } return(type); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || ResLuckyReward.CURRVERSION < cutVer) { cutVer = ResLuckyReward.CURRVERSION; } if (ResLuckyReward.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.dwOpen); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwCoinType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwMapID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwBase); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRewardBase); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwInterval); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRate); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRewardMaxValue); 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.szMailTitle_ByteArray.GetLength(0)) { if ((ulong)num > (ulong)ResLuckyReward.LENGTH_szMailTitle) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szMailTitle_ByteArray = new byte[num]; } if (1u > num) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szMailTitle_ByteArray, (int)num); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szMailTitle_ByteArray[(int)(num - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szMailTitle_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.szMailBody_ByteArray.GetLength(0)) { if ((ulong)num3 > (ulong)ResLuckyReward.LENGTH_szMailBody) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szMailBody_ByteArray = new byte[num3]; } if (1u > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szMailBody_ByteArray, (int)num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szMailBody_ByteArray[(int)(num3 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szMailBody_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.szRollingMsgText_ByteArray.GetLength(0)) { if ((ulong)num5 > (ulong)ResLuckyReward.LENGTH_szRollingMsgText) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szRollingMsgText_ByteArray = new byte[num5]; } if (1u > num5) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szRollingMsgText_ByteArray, (int)num5); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szRollingMsgText_ByteArray[(int)(num5 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num6 = TdrTypeUtil.cstrlen(this.szRollingMsgText_ByteArray) + 1; if ((ulong)num5 != (ulong)((long)num6)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } this.TransferData(); return(errorType); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; if ((cutVer == 0) || (CURRVERSION < cutVer)) { cutVer = CURRVERSION; } if (BASEVERSION > cutVer) { return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL); } type = srcBuf.readUInt32(ref this.dwLicenseID); 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.szLicenseName_ByteArray.GetLength(0)) { if (dest > LENGTH_szLicenseName) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szLicenseName_ByteArray = new byte[dest]; } if (1 > dest) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szLicenseName_ByteArray, (int)dest); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szLicenseName_ByteArray[((int)dest) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szLicenseName_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.szDesc_ByteArray.GetLength(0)) { if (num3 > LENGTH_szDesc) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szDesc_ByteArray = new byte[num3]; } if (1 > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num3); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szDesc_ByteArray[((int)num3) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1; if (num3 != num4) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } type = srcBuf.readUInt8(ref this.bType); 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.szIconPath_ByteArray.GetLength(0)) { if (num5 > LENGTH_szIconPath) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szIconPath_ByteArray = new byte[num5]; } if (1 > num5) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szIconPath_ByteArray, (int)num5); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (this.szIconPath_ByteArray[((int)num5) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num6 = TdrTypeUtil.cstrlen(this.szIconPath_ByteArray) + 1; if (num5 != num6) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } type = srcBuf.readUInt8(ref this.bUnlockCnt); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } for (int i = 0; i < 3; i++) { type = srcBuf.readUInt32(ref this.UnlockArray[i]); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } type = srcBuf.readUInt8(ref this.bIsAnd); 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 || ResDT_WealConInfo.CURRVERSION < cutVer) { cutVer = ResDT_WealConInfo.CURRVERSION; } if (ResDT_WealConInfo.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.szDesc_ByteArray.GetLength(0)) { if ((ulong)num > (ulong)ResDT_WealConInfo.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.readUInt32(ref this.dwConType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwGoalValue); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 5; i++) { errorType = srcBuf.readUInt32(ref this.ReachConParam[i]); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } errorType = srcBuf.readUInt32(ref this.dwFixedRewardID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwLimitDays); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwLimitRewardID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwJumpEntry); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } this.TransferData(); return(errorType); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || NewbieWeakGuideMainLineConf.CURRVERSION < cutVer) { cutVer = NewbieWeakGuideMainLineConf.CURRVERSION; } if (NewbieWeakGuideMainLineConf.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.bOldPlayerGuide); 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)NewbieWeakGuideMainLineConf.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.dwPriority); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bOnlyOnce); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bCDTime); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt16(ref this.wTriggerLevelUpperLimit); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt16(ref this.wTriggerLevelLowerLimit); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 3; i++) { errorType = this.astTriggerTime[i].unpack(ref srcBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } for (int j = 0; j < 3; j++) { errorType = this.astTriggerCondition[j].unpack(ref srcBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } for (int k = 0; k < 3; k++) { errorType = this.astSkipCondition[k].unpack(ref srcBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } this.TransferData(); return(errorType); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || ResPropInfo.CURRVERSION < cutVer) { cutVer = ResPropInfo.CURRVERSION; } if (ResPropInfo.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 ((ulong)num > (ulong)ResPropInfo.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.bIsView); 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.szDesc_ByteArray.GetLength(0)) { if ((ulong)num3 > (ulong)ResPropInfo.LENGTH_szDesc) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szDesc_ByteArray = new byte[num3]; } if (1u > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szDesc_ByteArray[(int)(num3 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1; if ((ulong)num3 != (ulong)((long)num4)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } uint num5 = 0u; errorType = srcBuf.readUInt32(ref num5); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (num5 > (uint)srcBuf.getLeftSize()) { return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ); } if (num5 > (uint)this.szDescAdd_ByteArray.GetLength(0)) { if ((ulong)num5 > (ulong)ResPropInfo.LENGTH_szDescAdd) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szDescAdd_ByteArray = new byte[num5]; } if (1u > num5) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szDescAdd_ByteArray, (int)num5); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szDescAdd_ByteArray[(int)(num5 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num6 = TdrTypeUtil.cstrlen(this.szDescAdd_ByteArray) + 1; if ((ulong)num5 != (ulong)((long)num6)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } errorType = srcBuf.readUInt32(ref this.dwIcon); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bGrade); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bClass); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iUseShowTip); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iOverLimit); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwCoinBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwCouponsBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwPVPCoinBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwBurningCoinBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwArenaCoinBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwGuildCoinBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwDiamondBuy); 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.bIsCanUse); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bIsAutoSale); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bIsSale); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwCoinSale); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bIsBatchUse); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt16(ref this.wBatchUseCnt); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwUseGetDiamond); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRedDot); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwCouponsDirectBuy); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bIsSpecGift); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt64(ref this.ullInvalidTime); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwBackupRewardID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 6; i++) { errorType = srcBuf.readFloat(ref this.EftParam[i]); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } for (int j = 0; j < 10; j++) { errorType = this.astSrcInfo[j].unpack(ref srcBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } this.TransferData(); return(errorType); }
public override TdrError.ErrorType pack(ref TdrWriteBuf destBuf, 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 = destBuf.writeUInt64(this.ullUid); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = destBuf.writeUInt32(this.dwLogicWorldId); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt32(this.dwAcntPvpLevel); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int pos = destBuf.getUsedSize(); type = destBuf.reserve(4); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num2 = destBuf.getUsedSize(); int count = TdrTypeUtil.cstrlen(this.szUserName); if (count >= 0x40) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } type = destBuf.writeCString(this.szUserName, count); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(0); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num4 = destBuf.getUsedSize() - num2; type = destBuf.writeUInt32((uint)num4, pos); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num5 = destBuf.getUsedSize(); type = destBuf.reserve(4); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num6 = destBuf.getUsedSize(); int num7 = TdrTypeUtil.cstrlen(this.szUserHeadUrl); if (num7 >= 0x100) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } type = destBuf.writeCString(this.szUserHeadUrl, num7); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt8(0); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } int num8 = destBuf.getUsedSize() - num6; type = destBuf.writeUInt32((uint)num8, num5); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = destBuf.writeUInt64(this.ullDyeSeq); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } 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.readUInt8(ref this.bRewardType); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = srcBuf.readUInt32(ref this.dwRewardID); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt32(ref this.dwRewardNum); 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.szIcon_ByteArray.GetLength(0)) { if (dest > LENGTH_szIcon) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szIcon_ByteArray = new byte[dest]; } if (1 > dest) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szIcon_ByteArray, (int)dest); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szIcon_ByteArray[((int)dest) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szIcon_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.szDesc_ByteArray.GetLength(0)) { if (num3 > LENGTH_szDesc) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szDesc_ByteArray = new byte[num3]; } if (1 > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szDesc_ByteArray, (int)num3); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (this.szDesc_ByteArray[((int)num3) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szDesc_ByteArray) + 1; if (num3 != num4) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } 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.readUInt64(ref this.ullUid); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = srcBuf.readUInt32(ref this.dwLogicWorldId); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt32(ref this.dwAcntPvpLevel); 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.szUserName.GetLength(0)) { if (dest > LENGTH_szUserName) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szUserName = new byte[dest]; } if (1 > dest) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szUserName, (int)dest); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (this.szUserName[((int)dest) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szUserName) + 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.szUserHeadUrl.GetLength(0)) { if (num3 > LENGTH_szUserHeadUrl) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szUserHeadUrl = new byte[num3]; } if (1 > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szUserHeadUrl, (int)num3); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (this.szUserHeadUrl[((int)num3) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szUserHeadUrl) + 1; if (num3 != num4) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } type = srcBuf.readUInt64(ref this.ullDyeSeq); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } } return(type); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || ResOrganCfgInfo.CURRVERSION < cutVer) { cutVer = ResOrganCfgInfo.CURRVERSION; } if (ResOrganCfgInfo.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); } errorType = srcBuf.readInt32(ref this.iDifficultyLevel); 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)ResOrganCfgInfo.LENGTH_szName)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szName_ByteArray = new byte[num]; } if (1u > num) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szName_ByteArray, (int)num); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szName_ByteArray[(int)(num - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szName_ByteArray) + 1; if ((ulong)num != (ulong)((long)num2)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } uint num3 = 0u; errorType = srcBuf.readUInt32(ref num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (num3 > (uint)srcBuf.getLeftSize()) { return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ); } if (num3 > (uint)this.szCharacterInfo_ByteArray.GetLength(0)) { if ((long)num3 > (long)((ulong)ResOrganCfgInfo.LENGTH_szCharacterInfo)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szCharacterInfo_ByteArray = new byte[num3]; } if (1u > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szCharacterInfo_ByteArray, (int)num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szCharacterInfo_ByteArray[(int)(num3 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szCharacterInfo_ByteArray) + 1; if ((ulong)num3 != (ulong)((long)num4)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } errorType = srcBuf.readInt32(ref this.iOutBattleHPAdd); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iSightR); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseHP); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iHPLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseHPAdd); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iHPAddLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseATT); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iATTLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseINT); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iINTLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseDEF); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iDEFLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseRES); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iRESLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBaseSpeed); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iAtkSpdAddLvlup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iPhyArmorHurtRate); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iAktRouteID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iDeadEnemySoldier); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 3; i++) { errorType = srcBuf.readInt32(ref this.SkillIDs[i]); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } errorType = srcBuf.readUInt8(ref this.bOrganType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iDynamicInfoType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iSoulExp); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt16(ref this.wGoldCoinInBattle); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwDynamicPropertyCfg); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iContiAttakAdd); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iContiAttakMax); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bShowInMinimap); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwClashMark); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iNoEnemyAddPhyDef); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iNoEnemyAddMgcDef); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iHorizonRadius); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBlockHeroAtkDamage); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iBlockHeroAtkDamageMSec); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iNoEnemyBlockHeroAtkDamage); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readInt32(ref this.iNoEnemyBlockHeroAtkDamageMSec); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } this.TransferData(); return(errorType); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; if ((cutVer == 0) || (CURRVERSION < cutVer)) { cutVer = CURRVERSION; } if (BASEVERSION > cutVer) { return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL); } type = srcBuf.readUInt32(ref this.dwID); 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.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.wUniquePassiveGroup); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } for (int i = 0; i < 3; i++) { type = srcBuf.readUInt32(ref this.PassiveRmvSkillFuncID[i]); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } this.TransferData(); } } return(type); }
public override TdrError.ErrorType pack(ref TdrWriteBuf destBuf, 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; } int pos = destBuf.getUsedSize(); type = destBuf.reserve(4); if (type == TdrError.ErrorType.TDR_NO_ERROR) { int num2 = destBuf.getUsedSize(); int count = TdrTypeUtil.cstrlen(this.szGuildName); if (count >= 0x20) { return TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG; } type = destBuf.writeCString(this.szGuildName, count); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = destBuf.writeUInt8(0); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } int num4 = destBuf.getUsedSize() - num2; type = destBuf.writeUInt32((uint) num4, pos); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = destBuf.writeUInt64(this.ullGuildID); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = destBuf.writeUInt64(this.ullAcntUid); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = destBuf.writeUInt32(this.dwGameEntity); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = destBuf.writeUInt32(this.dwLogicWorldID); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = this.stGuildBriefInfo.pack(ref destBuf, cutVer); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } type = destBuf.writeUInt8(this.bSearchType); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return type; } } return type; }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || ResPassiveSkill.CURRVERSION < cutVer) { cutVer = ResPassiveSkill.CURRVERSION; } if (ResPassiveSkill.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.szDesc_ByteArray.GetLength(0)) { if ((ulong)num > (ulong)ResPassiveSkill.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.readUInt16(ref this.wUniquePassiveGroup); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 3; i++) { errorType = srcBuf.readUInt32(ref this.PassiveRmvSkillFuncID[i]); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } this.TransferData(); return(errorType); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || ResHuoYueDuReward.CURRVERSION < cutVer) { cutVer = ResHuoYueDuReward.CURRVERSION; } if (ResHuoYueDuReward.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.szIcon_ByteArray.GetLength(0)) { if ((ulong)num > (ulong)ResHuoYueDuReward.LENGTH_szIcon) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szIcon_ByteArray = new byte[num]; } if (1u > num) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szIcon_ByteArray, (int)num); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szIcon_ByteArray[(int)(num - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szIcon_ByteArray) + 1; if ((ulong)num != (ulong)((long)num2)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } errorType = srcBuf.readUInt32(ref this.dwHuoYueDu); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bHuoYueDuType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bRewardType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRewardID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRewardNum); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 10; i++) { errorType = this.astPeriodInfo[i].unpack(ref srcBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } this.TransferData(); return(errorType); }
public override TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; if ((cutVer == 0) || (CURRVERSION < cutVer)) { cutVer = CURRVERSION; } if (BASEVERSION > cutVer) { return(TdrError.ErrorType.TDR_ERR_CUTVER_TOO_SMALL); } type = srcBuf.readUInt64(ref this.ullVisitorUid); if (type == TdrError.ErrorType.TDR_NO_ERROR) { type = srcBuf.readUInt32(ref this.dwAcntSeq); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readInt32(ref this.iDbVersion); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bRevertTransFlag); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bRevertRegisterName); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bRevertAcntInfo); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bRevertHeroInfo); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = srcBuf.readUInt8(ref this.bRevertItemInfo); 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.szRegisterName.GetLength(0)) { if (dest > LENGTH_szRegisterName) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szRegisterName = new byte[dest]; } if (1 > dest) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } type = srcBuf.readCString(ref this.szRegisterName, (int)dest); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (this.szRegisterName[((int)dest) - 1] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szRegisterName) + 1; if (dest != num2) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } } } return(type); }
public override TdrError.ErrorType pack(ref TdrWriteBuf destBuf, 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 = destBuf.writeUInt64(this.ullUid); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize = destBuf.getUsedSize(); errorType = destBuf.reserve(4); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize2 = destBuf.getUsedSize(); int num = TdrTypeUtil.cstrlen(this.szAcntName); if (num >= 64) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } errorType = destBuf.writeCString(this.szAcntName, num); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(0); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int src = destBuf.getUsedSize() - usedSize2; errorType = destBuf.writeUInt32((uint)src, usedSize); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize3 = destBuf.getUsedSize(); errorType = destBuf.reserve(4); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize4 = destBuf.getUsedSize(); int num2 = TdrTypeUtil.cstrlen(this.szOpenID); if (num2 >= 64) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } errorType = destBuf.writeCString(this.szOpenID, num2); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(0); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int src2 = destBuf.getUsedSize() - usedSize4; errorType = destBuf.writeUInt32((uint)src2, usedSize3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeInt32(this.iLogicWorldId); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(this.bIsOnline); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwLastLoginTime); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize5 = destBuf.getUsedSize(); errorType = destBuf.reserve(4); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize6 = destBuf.getUsedSize(); int num3 = TdrTypeUtil.cstrlen(this.szOpenUrl); if (num3 >= 256) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } errorType = destBuf.writeCString(this.szOpenUrl, num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(0); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int src3 = destBuf.getUsedSize() - usedSize6; errorType = destBuf.writeUInt32((uint)src3, usedSize5); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwLevel); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwExp); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwPower); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwPvpLevel); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwPvpExp); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(this.bGradeOfRank); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(this.bMaxGradeOfRank); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stGameVip.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stStatistic.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stGuildInfo.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stBanTime.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stMostUsedHero.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (CSDT_ACNT_DETAIL_INFO.VERSION_dwQQVIPMask <= cutVer) { errorType = destBuf.writeUInt32(this.dwQQVIPMask); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } if (CSDT_ACNT_DETAIL_INFO.VERSION_bPrivilege <= cutVer) { errorType = destBuf.writeUInt8(this.bPrivilege); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } if (CSDT_ACNT_DETAIL_INFO.VERSION_bGender <= cutVer) { errorType = destBuf.writeUInt8(this.bGender); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } errorType = this.stHonorInfo.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwCreditValue); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stRankInfo.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwCurClassOfRank); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (CSDT_ACNT_DETAIL_INFO.VERSION_stLikeNum <= cutVer) { errorType = this.stLikeNum.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } errorType = destBuf.writeUInt32(this.dwAchieveMentScore); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } for (int i = 0; i < 3; i++) { errorType = this.astShowAchievement[i].pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } int usedSize7 = destBuf.getUsedSize(); errorType = destBuf.reserve(4); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int usedSize8 = destBuf.getUsedSize(); int num4 = TdrTypeUtil.cstrlen(this.szSignatureInfo); if (num4 >= 128) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } errorType = destBuf.writeCString(this.szSignatureInfo, num4); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt8(0); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int src4 = destBuf.getUsedSize() - usedSize8; errorType = destBuf.writeUInt32((uint)src4, usedSize7); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwRefuseFriendBits); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = this.stAcntMasterInfo.pack(ref destBuf, cutVer); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeInt32(this.iSumDelCreditValue); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = destBuf.writeUInt32(this.dwMostDelCreditType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } return(errorType); }
public TdrError.ErrorType unpack(ref TdrReadBuf srcBuf, uint cutVer) { if (cutVer == 0u || ResDT_HuoYueDuReward_PeriodInfo.CURRVERSION < cutVer) { cutVer = ResDT_HuoYueDuReward_PeriodInfo.CURRVERSION; } if (ResDT_HuoYueDuReward_PeriodInfo.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.szStartTime_ByteArray.GetLength(0)) { if ((ulong)num > (ulong)ResDT_HuoYueDuReward_PeriodInfo.LENGTH_szStartTime) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szStartTime_ByteArray = new byte[num]; } if (1u > num) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szStartTime_ByteArray, (int)num); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szStartTime_ByteArray[(int)(num - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num2 = TdrTypeUtil.cstrlen(this.szStartTime_ByteArray) + 1; if ((ulong)num != (ulong)((long)num2)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } uint num3 = 0u; errorType = srcBuf.readUInt32(ref num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (num3 > (uint)srcBuf.getLeftSize()) { return(TdrError.ErrorType.TDR_ERR_SHORT_BUF_FOR_READ); } if (num3 > (uint)this.szEndTime_ByteArray.GetLength(0)) { if ((ulong)num3 > (ulong)ResDT_HuoYueDuReward_PeriodInfo.LENGTH_szEndTime) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szEndTime_ByteArray = new byte[num3]; } if (1u > num3) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szEndTime_ByteArray, (int)num3); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szEndTime_ByteArray[(int)(num3 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num4 = TdrTypeUtil.cstrlen(this.szEndTime_ByteArray) + 1; if ((ulong)num3 != (ulong)((long)num4)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } errorType = srcBuf.readUInt32(ref this.dwStartTimeGen); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwEndTimeGen); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt8(ref this.bRewardType); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRewardID); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = srcBuf.readUInt32(ref this.dwRewardNum); 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.szIcon_ByteArray.GetLength(0)) { if ((ulong)num5 > (ulong)ResDT_HuoYueDuReward_PeriodInfo.LENGTH_szIcon) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_BIG); } this.szIcon_ByteArray = new byte[num5]; } if (1u > num5) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_TOO_SMALL); } errorType = srcBuf.readCString(ref this.szIcon_ByteArray, (int)num5); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (this.szIcon_ByteArray[(int)(num5 - 1u)] != 0) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } int num6 = TdrTypeUtil.cstrlen(this.szIcon_ByteArray) + 1; if ((ulong)num5 != (ulong)((long)num6)) { return(TdrError.ErrorType.TDR_ERR_STR_LEN_CONFLICT); } this.TransferData(); return(errorType); }