-module(pt_331).
-include("common.hrl").
-export([
        read/2,
        write/2
    ]).

read(33101, _) ->
    {ok, []};
read(33104, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33105, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<Grade:16, _Bin3/binary>> = Bin2, 
    {ok, [BaseType, SubType, Grade]};
read(33106, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<ModId:16, Bin3/binary>> = Bin2, 
    <<CounterId:16, _Bin4/binary>> = Bin3, 
    {ok, [BaseType, SubType, ModId, CounterId]};
read(33107, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33108, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<Grade:16, _Bin3/binary>> = Bin2, 
    {ok, [BaseType, SubType, Grade]};
read(33109, Bin0) ->
    <<Module:16, Bin1/binary>> = Bin0, 
    <<SubMod:16, Bin2/binary>> = Bin1, 
    <<SubAct:16, _Bin3/binary>> = Bin2, 
    {ok, [Module, SubMod, SubAct]};
read(33111, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33112, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33113, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<BuyNum:16, Bin2/binary>> = Bin1, 
    <<IfAutoBuy:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, BuyNum, IfAutoBuy]};
read(33114, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33115, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33116, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<WeddingTypeId:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, WeddingTypeId]};
read(33118, _) ->
    {ok, []};
read(33119, _) ->
    {ok, []};
read(33120, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33121, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33122, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<Index:8, Bin3/binary>> = Bin2, 
    <<AutoBuy:8, _Bin4/binary>> = Bin3, 
    {ok, [BaseType, SubType, Index, AutoBuy]};
read(33123, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<Times:16, _Bin3/binary>> = Bin2, 
    {ok, [BaseType, SubType, Times]};
read(33124, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33125, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<GoodsId:32, _Bin3/binary>> = Bin2, 
    {ok, [BaseType, SubType, GoodsId]};
read(33126, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33127, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33128, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33129, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    FunArray0 = fun(<<RestBin0/binary>>) -> 
        <<Grade:16, _Args01/binary>> = RestBin0, 
        <<Num:8, _Args02/binary>> = _Args01, 
        {{Grade, Num},_Args02}
        end,
    {GradeList, Bin2} = pt:read_array(FunArray0, Bin1),

    <<DiscountId:32, Bin3/binary>> = Bin2, 
    <<AbDiscount:32, _Bin4/binary>> = Bin3, 
    {ok, [SubType, GradeList, DiscountId, AbDiscount]};
read(33130, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33131, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33132, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Money:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Money]};
read(33133, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33134, Bin0) ->
    <<RankType:32, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<IsPublic:8, _Bin3/binary>> = Bin2, 
    {ok, [RankType, SubType, IsPublic]};
read(33135, Bin0) ->
    <<RankType:32, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [RankType, SubType]};
read(33136, Bin0) ->
    <<SubType:8, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33137, Bin0) ->
    <<SubType:8, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33138, Bin0) ->
    <<SubType:8, Bin1/binary>> = Bin0, 
    <<Num:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Num]};
read(33140, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33141, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33142, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Grade]};
read(33143, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33144, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:8, Bin2/binary>> = Bin1, 
    <<Day:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Grade, Day]};
read(33145, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33146, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33148, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33149, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33150, _) ->
    {ok, []};
read(33151, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<DrawType:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, DrawType]};
read(33152, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33153, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33154, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Grade]};
read(33155, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33156, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33157, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<GoodsId:64, Bin2/binary>> = Bin1, 
    <<GtypeId:32, Bin3/binary>> = Bin2, 
    <<SplitNum:16, _Bin4/binary>> = Bin3, 
    {ok, [SubType, GoodsId, GtypeId, SplitNum]};
read(33158, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<RedEnvelopesId:64, _Bin2/binary>> = Bin1, 
    {ok, [SubType, RedEnvelopesId]};
read(33159, _) ->
    {ok, []};
read(33160, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33161, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Type]};
read(33162, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33163, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<PutType:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, PutType]};
read(33164, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33165, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33166, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33167, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<BigRewardId:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, BigRewardId]};
read(33168, Bin0) ->
    <<Opty:8, _Bin1/binary>> = Bin0, 
    {ok, [Opty]};
read(33169, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33170, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, Subtype]};
read(33171, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, Subtype]};
read(33172, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, Subtype]};
read(33174, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, Bin2/binary>> = Bin1, 
    <<ProductId:32, Bin3/binary>> = Bin2, 
    <<BuyNum:16, Bin4/binary>> = Bin3, 
    <<AutoBuy:8, _Bin5/binary>> = Bin4, 
    {ok, [Type, Subtype, ProductId, BuyNum, AutoBuy]};
read(33175, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, Subtype]};
read(33177, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, Subtype]};
read(33178, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<Subtype:16, Bin2/binary>> = Bin1, 
    FunArray1 = fun(<<RestBin1/binary>>) -> 
        <<GradeId:16, _Args101/binary>> = RestBin1, 
        {GradeId,_Args101}
        end,
    {GradeIdList, _Bin3} = pt:read_array(FunArray1, Bin2),

    {ok, [Type, Subtype, GradeIdList]};
read(33179, Bin0) ->
    <<Subtype:16, _Bin1/binary>> = Bin0, 
    {ok, [Subtype]};
read(33180, _) ->
    {ok, []};
read(33181, Bin0) ->
    <<Count:16, _Bin1/binary>> = Bin0, 
    {ok, [Count]};
read(33182, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<Grade:16, _Bin3/binary>> = Bin2, 
    {ok, [BaseType, SubType, Grade]};
read(33183, Bin0) ->
    <<PageSize:8, Bin1/binary>> = Bin0, 
    <<PageNum:8, _Bin2/binary>> = Bin1, 
    {ok, [PageSize, PageNum]};
read(33184, Bin0) ->
    <<DrawResult:8, Bin1/binary>> = Bin0, 
    {Sign, _Bin2} = pt:read_string_binary(Bin1), 
    {ok, [DrawResult, Sign]};
read(33185, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33186, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, Bin2/binary>> = Bin1, 
    <<Grade:16, _Bin3/binary>> = Bin2, 
    {ok, [BaseType, SubType, Grade]};
read(33187, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33188, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Round:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Round]};
read(33189, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33190, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<GradeId:16, Bin2/binary>> = Bin1, 
    <<Round:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, GradeId, Round]};
read(33191, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<GradeId:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, GradeId]};
read(33192, Bin0) ->
    <<Status:8, _Bin1/binary>> = Bin0, 
    {ok, [Status]};
read(33195, _) ->
    {ok, []};
read(33196, _) ->
    {ok, []};
read(33197, Bin0) ->
    <<TaskId:8, _Bin1/binary>> = Bin0, 
    {ok, [TaskId]};
read(33198, Bin0) ->
    FunArray1 = fun(<<RestBin1/binary>>) -> 
        <<PosId:8, _Args101/binary>> = RestBin1, 
        <<RewardId:16, _Args102/binary>> = _Args101, 
        {{PosId, RewardId},_Args102}
        end,
    {RewardList, _Bin1} = pt:read_array(FunArray1, Bin0),

    {ok, [RewardList]};
read(33199, _) ->
    {ok, []};
read(_Cmd, _R) -> {error, no_match}.

write (33100,[
    ErrorCode
] = Src_Data) ->
    Data = <<
        ErrorCode:32
    >>,
    {ok, pt:encode(33100, Data, Src_Data)};

write (33101,[
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_0(List_Item) || List_Item <- List
    ], 

    List_Len = length(List), 
    Bin_List = list_to_binary(BinList_List),

    Data = <<
        List_Len:16, Bin_List/binary
    >>,
    {ok, pt:encode(33101, Data, Src_Data)};

write (33102,[
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_1(List_Item) || List_Item <- List
    ], 

    List_Len = length(List), 
    Bin_List = list_to_binary(BinList_List),

    Data = <<
        List_Len:16, Bin_List/binary
    >>,
    {ok, pt:encode(33102, Data, Src_Data)};

write (33103,[
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_2(List_Item) || List_Item <- List
    ], 

    List_Len = length(List), 
    Bin_List = list_to_binary(BinList_List),

    Data = <<
        List_Len:16, Bin_List/binary
    >>,
    {ok, pt:encode(33103, Data, Src_Data)};

write (33104,[
    BaseType,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_3(RewardList_Item) || RewardList_Item <- RewardList
    ], 

    RewardList_Len = length(RewardList), 
    Bin_RewardList = list_to_binary(BinList_RewardList),

    Data = <<
        BaseType:16,
        SubType:16,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33104, Data, Src_Data)};

write (33105,[
    Errcode,
    BaseType,
    SubType,
    Grade
] = Src_Data) ->
    Data = <<
        Errcode:32,
        BaseType:16,
        SubType:16,
        Grade:16
    >>,
    {ok, pt:encode(33105, Data, Src_Data)};

write (33106,[
    BaseType,
    SubType,
    ModId,
    CounterId,
    Count
] = Src_Data) ->
    Data = <<
        BaseType:16,
        SubType:16,
        ModId:16,
        CounterId:16,
        Count:16
    >>,
    {ok, pt:encode(33106, Data, Src_Data)};

write (33107,[
    BaseType,
    SubType,
    Values
] = Src_Data) ->
    BinList_Values = [
        item_to_bin_4(Values_Item) || Values_Item <- Values
    ], 

    Values_Len = length(Values), 
    Bin_Values = list_to_binary(BinList_Values),

    Data = <<
        BaseType:16,
        SubType:16,
        Values_Len:16, Bin_Values/binary
    >>,
    {ok, pt:encode(33107, Data, Src_Data)};

write (33108,[
    Errcode,
    BaseType,
    SubType,
    Grade
] = Src_Data) ->
    Data = <<
        Errcode:32,
        BaseType:16,
        SubType:16,
        Grade:16
    >>,
    {ok, pt:encode(33108, Data, Src_Data)};

write (33109,[
    Module,
    SubMod,
    SubAct,
    Rates
] = Src_Data) ->
    BinList_Rates = [
        item_to_bin_5(Rates_Item) || Rates_Item <- Rates
    ], 

    Rates_Len = length(Rates), 
    Bin_Rates = list_to_binary(BinList_Rates),

    Data = <<
        Module:16,
        SubMod:16,
        SubAct:16,
        Rates_Len:16, Bin_Rates/binary
    >>,
    {ok, pt:encode(33109, Data, Src_Data)};

write (33111,[
    Errcode,
    BaseType,
    SubType,
    GradeNumList
] = Src_Data) ->
    BinList_GradeNumList = [
        item_to_bin_6(GradeNumList_Item) || GradeNumList_Item <- GradeNumList
    ], 

    GradeNumList_Len = length(GradeNumList), 
    Bin_GradeNumList = list_to_binary(BinList_GradeNumList),

    Data = <<
        Errcode:32,
        BaseType:16,
        SubType:16,
        GradeNumList_Len:16, Bin_GradeNumList/binary
    >>,
    {ok, pt:encode(33111, Data, Src_Data)};

write (33112,[
    Errcode,
    SubType,
    IfKf,
    NextRewardTime,
    NotLimitBeginTime,
    AllBuyNum,
    BigRewardId,
    AllBuyList,
    SelfBuyNum,
    LessBuyNum
] = Src_Data) ->
    BinList_AllBuyList = [
        item_to_bin_7(AllBuyList_Item) || AllBuyList_Item <- AllBuyList
    ], 

    AllBuyList_Len = length(AllBuyList), 
    Bin_AllBuyList = list_to_binary(BinList_AllBuyList),

    Data = <<
        Errcode:32,
        SubType:16,
        IfKf:8,
        NextRewardTime:32,
        NotLimitBeginTime:32,
        AllBuyNum:32,
        BigRewardId:16,
        AllBuyList_Len:16, Bin_AllBuyList/binary,
        SelfBuyNum:32,
        LessBuyNum:32
    >>,
    {ok, pt:encode(33112, Data, Src_Data)};

write (33113,[
    Errcode,
    SubType,
    BuyList
] = Src_Data) ->
    BinList_BuyList = [
        item_to_bin_8(BuyList_Item) || BuyList_Item <- BuyList
    ], 

    BuyList_Len = length(BuyList), 
    Bin_BuyList = list_to_binary(BinList_BuyList),

    Data = <<
        Errcode:32,
        SubType:16,
        BuyList_Len:16, Bin_BuyList/binary
    >>,
    {ok, pt:encode(33113, Data, Src_Data)};

write (33114,[
    SubType,
    BigBingoId,
    BingoPlayerList
] = Src_Data) ->
    BinList_BingoPlayerList = [
        item_to_bin_9(BingoPlayerList_Item) || BingoPlayerList_Item <- BingoPlayerList
    ], 

    BingoPlayerList_Len = length(BingoPlayerList), 
    Bin_BingoPlayerList = list_to_binary(BinList_BingoPlayerList),

    Data = <<
        SubType:16,
        BigBingoId:16,
        BingoPlayerList_Len:16, Bin_BingoPlayerList/binary
    >>,
    {ok, pt:encode(33114, Data, Src_Data)};

write (33115,[
    Code,
    SubType,
    LoverRoleId,
    LoverName,
    IfGetReward,
    WeddingTypeList,
    WeddingAllLogList,
    SelfLogList,
    WeddingTypes
] = Src_Data) ->
    Bin_LoverName = pt:write_string(LoverName), 

    BinList_WeddingTypeList = [
        item_to_bin_10(WeddingTypeList_Item) || WeddingTypeList_Item <- WeddingTypeList
    ], 

    WeddingTypeList_Len = length(WeddingTypeList), 
    Bin_WeddingTypeList = list_to_binary(BinList_WeddingTypeList),

    BinList_WeddingAllLogList = [
        item_to_bin_11(WeddingAllLogList_Item) || WeddingAllLogList_Item <- WeddingAllLogList
    ], 

    WeddingAllLogList_Len = length(WeddingAllLogList), 
    Bin_WeddingAllLogList = list_to_binary(BinList_WeddingAllLogList),

    BinList_SelfLogList = [
        item_to_bin_12(SelfLogList_Item) || SelfLogList_Item <- SelfLogList
    ], 

    SelfLogList_Len = length(SelfLogList), 
    Bin_SelfLogList = list_to_binary(BinList_SelfLogList),

    BinList_WeddingTypes = [
        item_to_bin_13(WeddingTypes_Item) || WeddingTypes_Item <- WeddingTypes
    ], 

    WeddingTypes_Len = length(WeddingTypes), 
    Bin_WeddingTypes = list_to_binary(BinList_WeddingTypes),

    Data = <<
        Code:32,
        SubType:16,
        LoverRoleId:64,
        Bin_LoverName/binary,
        IfGetReward:8,
        WeddingTypeList_Len:16, Bin_WeddingTypeList/binary,
        WeddingAllLogList_Len:16, Bin_WeddingAllLogList/binary,
        SelfLogList_Len:16, Bin_SelfLogList/binary,
        WeddingTypes_Len:16, Bin_WeddingTypes/binary
    >>,
    {ok, pt:encode(33115, Data, Src_Data)};

write (33116,[
    Code,
    SubType,
    WeddingTypeId
] = Src_Data) ->
    Data = <<
        Code:32,
        SubType:16,
        WeddingTypeId:8
    >>,
    {ok, pt:encode(33116, Data, Src_Data)};

write (33117,[
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_14(RewardList_Item) || RewardList_Item <- RewardList
    ], 

    RewardList_Len = length(RewardList), 
    Bin_RewardList = list_to_binary(BinList_RewardList),

    Data = <<
        SubType:16,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33117, Data, Src_Data)};

write (33118,[
    BaseType,
    SubType
] = Src_Data) ->
    Data = <<
        BaseType:16,
        SubType:16
    >>,
    {ok, pt:encode(33118, Data, Src_Data)};

write (33119,[
    SmashedEggGoodsCfg,
    FreeSmashedTimeCfg
] = Src_Data) ->
    BinList_SmashedEggGoodsCfg = [
        item_to_bin_15(SmashedEggGoodsCfg_Item) || SmashedEggGoodsCfg_Item <- SmashedEggGoodsCfg
    ], 

    SmashedEggGoodsCfg_Len = length(SmashedEggGoodsCfg), 
    Bin_SmashedEggGoodsCfg = list_to_binary(BinList_SmashedEggGoodsCfg),

    BinList_FreeSmashedTimeCfg = [
        item_to_bin_16(FreeSmashedTimeCfg_Item) || FreeSmashedTimeCfg_Item <- FreeSmashedTimeCfg
    ], 

    FreeSmashedTimeCfg_Len = length(FreeSmashedTimeCfg), 
    Bin_FreeSmashedTimeCfg = list_to_binary(BinList_FreeSmashedTimeCfg),

    Data = <<
        SmashedEggGoodsCfg_Len:16, Bin_SmashedEggGoodsCfg/binary,
        FreeSmashedTimeCfg_Len:16, Bin_FreeSmashedTimeCfg/binary
    >>,
    {ok, pt:encode(33119, Data, Src_Data)};

write (33120,[
    BaseType,
    SubType,
    HasFreeTimes,
    NextFreeTime,
    UsedFreeTimes,
    OnlineTime,
    FreeRefreshTimes,
    SmashedTimes,
    ShowList,
    Eggs,
    Record,
    CumulateReward
] = Src_Data) ->
    BinList_ShowList = [
        item_to_bin_17(ShowList_Item) || ShowList_Item <- ShowList
    ], 

    ShowList_Len = length(ShowList), 
    Bin_ShowList = list_to_binary(BinList_ShowList),

    BinList_Eggs = [
        item_to_bin_18(Eggs_Item) || Eggs_Item <- Eggs
    ], 

    Eggs_Len = length(Eggs), 
    Bin_Eggs = list_to_binary(BinList_Eggs),

    BinList_Record = [
        item_to_bin_19(Record_Item) || Record_Item <- Record
    ], 

    Record_Len = length(Record), 
    Bin_Record = list_to_binary(BinList_Record),

    BinList_CumulateReward = [
        item_to_bin_20(CumulateReward_Item) || CumulateReward_Item <- CumulateReward
    ], 

    CumulateReward_Len = length(CumulateReward), 
    Bin_CumulateReward = list_to_binary(BinList_CumulateReward),

    Data = <<
        BaseType:16,
        SubType:16,
        HasFreeTimes:8,
        NextFreeTime:32,
        UsedFreeTimes:16,
        OnlineTime:32,
        FreeRefreshTimes:16,
        SmashedTimes:16,
        ShowList_Len:16, Bin_ShowList/binary,
        Eggs_Len:16, Bin_Eggs/binary,
        Record_Len:16, Bin_Record/binary,
        CumulateReward_Len:16, Bin_CumulateReward/binary
    >>,
    {ok, pt:encode(33120, Data, Src_Data)};

write (33121,[
    Errcode
] = Src_Data) ->
    Data = <<
        Errcode:32
    >>,
    {ok, pt:encode(33121, Data, Src_Data)};

write (33122,[
    Errcode,
    Eggs
] = Src_Data) ->
    BinList_Eggs = [
        item_to_bin_21(Eggs_Item) || Eggs_Item <- Eggs
    ], 

    Eggs_Len = length(Eggs), 
    Bin_Eggs = list_to_binary(BinList_Eggs),

    Data = <<
        Errcode:32,
        Eggs_Len:16, Bin_Eggs/binary
    >>,
    {ok, pt:encode(33122, Data, Src_Data)};

write (33123,[
    Errcode,
    CumulateReward
] = Src_Data) ->
    BinList_CumulateReward = [
        item_to_bin_22(CumulateReward_Item) || CumulateReward_Item <- CumulateReward
    ], 

    CumulateReward_Len = length(CumulateReward), 
    Bin_CumulateReward = list_to_binary(BinList_CumulateReward),

    Data = <<
        Errcode:32,
        CumulateReward_Len:16, Bin_CumulateReward/binary
    >>,
    {ok, pt:encode(33123, Data, Src_Data)};

write (33124,[
    Reward
] = Src_Data) ->
    BinList_Reward = [
        item_to_bin_23(Reward_Item) || Reward_Item <- Reward
    ], 

    Reward_Len = length(Reward), 
    Bin_Reward = list_to_binary(BinList_Reward),

    Data = <<
        Reward_Len:16, Bin_Reward/binary
    >>,
    {ok, pt:encode(33124, Data, Src_Data)};

write (33125,[
    Errcode
] = Src_Data) ->
    Data = <<
        Errcode:32
    >>,
    {ok, pt:encode(33125, Data, Src_Data)};

write (33126,[
    SubType,
    FreeCount
] = Src_Data) ->
    Data = <<
        SubType:16,
        FreeCount:8
    >>,
    {ok, pt:encode(33126, Data, Src_Data)};

write (33127,[
    SubType,
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_24(List_Item) || List_Item <- List
    ], 

    List_Len = length(List), 
    Bin_List = list_to_binary(BinList_List),

    Data = <<
        SubType:16,
        List_Len:16, Bin_List/binary
    >>,
    {ok, pt:encode(33127, Data, Src_Data)};

write (33128,[
    SubType,
    Res,
    GoodsId
] = Src_Data) ->
    Data = <<
        SubType:16,
        Res:32,
        GoodsId:32
    >>,
    {ok, pt:encode(33128, Data, Src_Data)};

write (33129,[
    Errcode,
    SubType
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16
    >>,
    {ok, pt:encode(33129, Data, Src_Data)};

write (33130,[
    SubType,
    GoodsList
] = Src_Data) ->
    BinList_GoodsList = [
        item_to_bin_26(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

    GoodsList_Len = length(GoodsList), 
    Bin_GoodsList = list_to_binary(BinList_GoodsList),

    Data = <<
        SubType:16,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    {ok, pt:encode(33130, Data, Src_Data)};

write (33131,[
    SubType,
    Total,
    LastTime,
    Stime,
    Etime
] = Src_Data) ->
    Data = <<
        SubType:16,
        Total:32,
        LastTime:32,
        Stime:32,
        Etime:32
    >>,
    {ok, pt:encode(33131, Data, Src_Data)};

write (33132,[
    Result,
    SubType
] = Src_Data) ->
    Data = <<
        Result:32,
        SubType:16
    >>,
    {ok, pt:encode(33132, Data, Src_Data)};

write (33133,[
    Result,
    SubType
] = Src_Data) ->
    Data = <<
        Result:32,
        SubType:16
    >>,
    {ok, pt:encode(33133, Data, Src_Data)};

write (33134,[
    Record
] = Src_Data) ->
    Data = <<
        Record:32
    >>,
    {ok, pt:encode(33134, Data, Src_Data)};

write (33135,[
    RankType,
    RoleRank,
    IsPublic,
    SelVal,
    Sum,
    MaxRankLen,
    Limit,
    RankList
] = Src_Data) ->
    BinList_RankList = [
        item_to_bin_27(RankList_Item) || RankList_Item <- RankList
    ], 

    RankList_Len = length(RankList), 
    Bin_RankList = list_to_binary(BinList_RankList),

    Data = <<
        RankType:32,
        RoleRank:32,
        IsPublic:8,
        SelVal:32,
        Sum:32,
        MaxRankLen:32,
        Limit:32,
        RankList_Len:16, Bin_RankList/binary
    >>,
    {ok, pt:encode(33135, Data, Src_Data)};

write (33136,[
    SubType,
    Round,
    DayLuckyLimit,
    AlreadyGetList,
    GetId
] = Src_Data) ->
    BinList_AlreadyGetList = [
        item_to_bin_28(AlreadyGetList_Item) || AlreadyGetList_Item <- AlreadyGetList
    ], 

    AlreadyGetList_Len = length(AlreadyGetList), 
    Bin_AlreadyGetList = list_to_binary(BinList_AlreadyGetList),

    BinList_GetId = [
        item_to_bin_29(GetId_Item) || GetId_Item <- GetId
    ], 

    GetId_Len = length(GetId), 
    Bin_GetId = list_to_binary(BinList_GetId),

    Data = <<
        SubType:8,
        Round:8,
        DayLuckyLimit:8,
        AlreadyGetList_Len:16, Bin_AlreadyGetList/binary,
        GetId_Len:16, Bin_GetId/binary
    >>,
    {ok, pt:encode(33136, Data, Src_Data)};

write (33137,[
    Res,
    SubType
] = Src_Data) ->
    Data = <<
        Res:32,
        SubType:8
    >>,
    {ok, pt:encode(33137, Data, Src_Data)};

write (33138,[
    Res,
    SubType,
    DayLuckyLimit,
    GetId
] = Src_Data) ->
    BinList_GetId = [
        item_to_bin_30(GetId_Item) || GetId_Item <- GetId
    ], 

    GetId_Len = length(GetId), 
    Bin_GetId = list_to_binary(BinList_GetId),

    Data = <<
        Res:32,
        SubType:8,
        DayLuckyLimit:8,
        GetId_Len:16, Bin_GetId/binary
    >>,
    {ok, pt:encode(33138, Data, Src_Data)};

write (33140,[
    BaseType,
    SubType,
    SumPoints,
    ModList
] = Src_Data) ->
    BinList_ModList = [
        item_to_bin_31(ModList_Item) || ModList_Item <- ModList
    ], 

    ModList_Len = length(ModList), 
    Bin_ModList = list_to_binary(BinList_ModList),

    Data = <<
        BaseType:16,
        SubType:16,
        SumPoints:32,
        ModList_Len:16, Bin_ModList/binary
    >>,
    {ok, pt:encode(33140, Data, Src_Data)};

write (33141,[
    SubType,
    InvestmentList
] = Src_Data) ->
    BinList_InvestmentList = [
        item_to_bin_32(InvestmentList_Item) || InvestmentList_Item <- InvestmentList
    ], 

    InvestmentList_Len = length(InvestmentList), 
    Bin_InvestmentList = list_to_binary(BinList_InvestmentList),

    Data = <<
        SubType:16,
        InvestmentList_Len:16, Bin_InvestmentList/binary
    >>,
    {ok, pt:encode(33141, Data, Src_Data)};

write (33142,[
    Res,
    SubType,
    Grade
] = Src_Data) ->
    Data = <<
        Res:32,
        SubType:16,
        Grade:8
    >>,
    {ok, pt:encode(33142, Data, Src_Data)};

write (33143,[
    TodayConsume,
    ContinueDay
] = Src_Data) ->
    Data = <<
        TodayConsume:32,
        ContinueDay:8
    >>,
    {ok, pt:encode(33143, Data, Src_Data)};

write (33144,[
    Res,
    SubType,
    Grade,
    Day
] = Src_Data) ->
    Data = <<
        Res:32,
        SubType:16,
        Grade:8,
        Day:8
    >>,
    {ok, pt:encode(33144, Data, Src_Data)};

write (33145,[
    SubType,
    Total,
    Resign
] = Src_Data) ->
    Data = <<
        SubType:16,
        Total:32,
        Resign:8
    >>,
    {ok, pt:encode(33145, Data, Src_Data)};

write (33146,[
    Res,
    SubType
] = Src_Data) ->
    Data = <<
        Res:32,
        SubType:16
    >>,
    {ok, pt:encode(33146, Data, Src_Data)};

write (33148,[
    SubType,
    Time
] = Src_Data) ->
    Data = <<
        SubType:16,
        Time:32
    >>,
    {ok, pt:encode(33148, Data, Src_Data)};

write (33149,[
    SubType,
    Time
] = Src_Data) ->
    Data = <<
        SubType:16,
        Time:32
    >>,
    {ok, pt:encode(33149, Data, Src_Data)};

write (33150,[
    Type,
    KvList,
    RewardCfg
] = Src_Data) ->
    BinList_KvList = [
        item_to_bin_34(KvList_Item) || KvList_Item <- KvList
    ], 

    KvList_Len = length(KvList), 
    Bin_KvList = list_to_binary(BinList_KvList),

    BinList_RewardCfg = [
        item_to_bin_35(RewardCfg_Item) || RewardCfg_Item <- RewardCfg
    ], 

    RewardCfg_Len = length(RewardCfg), 
    Bin_RewardCfg = list_to_binary(BinList_RewardCfg),

    Data = <<
        Type:16,
        KvList_Len:16, Bin_KvList/binary,
        RewardCfg_Len:16, Bin_RewardCfg/binary
    >>,
    {ok, pt:encode(33150, Data, Src_Data)};

write (33151,[
    SubType,
    DrawType,
    RewardList
] = Src_Data) ->
    Bin_RewardList = pt:write_object_list(RewardList), 

    Data = <<
        SubType:16,
        DrawType:16,
        Bin_RewardList/binary
    >>,
    {ok, pt:encode(33151, Data, Src_Data)};

write (33152,[
    Wlv
] = Src_Data) ->
    Data = <<
        Wlv:16
    >>,
    {ok, pt:encode(33152, Data, Src_Data)};

write (33153,[
    SubType,
    Grades,
    Tasks
] = Src_Data) ->
    BinList_Grades = [
        item_to_bin_36(Grades_Item) || Grades_Item <- Grades
    ], 

    Grades_Len = length(Grades), 
    Bin_Grades = list_to_binary(BinList_Grades),

    BinList_Tasks = [
        item_to_bin_37(Tasks_Item) || Tasks_Item <- Tasks
    ], 

    Tasks_Len = length(Tasks), 
    Bin_Tasks = list_to_binary(BinList_Tasks),

    Data = <<
        SubType:16,
        Grades_Len:16, Bin_Grades/binary,
        Tasks_Len:16, Bin_Tasks/binary
    >>,
    {ok, pt:encode(33153, Data, Src_Data)};

write (33154,[
    Res,
    SubType,
    Grade
] = Src_Data) ->
    Data = <<
        Res:32,
        SubType:16,
        Grade:16
    >>,
    {ok, pt:encode(33154, Data, Src_Data)};

write (33155,[
    TipsInfo
] = Src_Data) ->
    Data = <<
        TipsInfo:8
    >>,
    {ok, pt:encode(33155, Data, Src_Data)};

write (33156,[
    RedEnvelopesList
] = Src_Data) ->
    BinList_RedEnvelopesList = [
        item_to_bin_38(RedEnvelopesList_Item) || RedEnvelopesList_Item <- RedEnvelopesList
    ], 

    RedEnvelopesList_Len = length(RedEnvelopesList), 
    Bin_RedEnvelopesList = list_to_binary(BinList_RedEnvelopesList),

    Data = <<
        RedEnvelopesList_Len:16, Bin_RedEnvelopesList/binary
    >>,
    {ok, pt:encode(33156, Data, Src_Data)};

write (33157,[
    Errcode
] = Src_Data) ->
    Data = <<
        Errcode:32
    >>,
    {ok, pt:encode(33157, Data, Src_Data)};

write (33158,[
    RedEnvelopesId,
    RoleId,
    RoleName,
    Career,
    Sex,
    Turn,
    Picture,
    PictureVer,
    Status,
    ReceiveMoney,
    TotalNum,
    RecipientsNum,
    Money,
    Type,
    Extra,
    RecipientList
] = Src_Data) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Bin_Picture = pt:write_string(Picture), 

    BinList_RecipientList = [
        item_to_bin_39(RecipientList_Item) || RecipientList_Item <- RecipientList
    ], 

    RecipientList_Len = length(RecipientList), 
    Bin_RecipientList = list_to_binary(BinList_RecipientList),

    Data = <<
        RedEnvelopesId:64,
        RoleId:64,
        Bin_RoleName/binary,
        Career:8,
        Sex:8,
        Turn:8,
        Bin_Picture/binary,
        PictureVer:32,
        Status:8,
        ReceiveMoney:32,
        TotalNum:16,
        RecipientsNum:16,
        Money:32,
        Type:8,
        Extra:32,
        RecipientList_Len:16, Bin_RecipientList/binary
    >>,
    {ok, pt:encode(33158, Data, Src_Data)};

write (33159,[
    EvaluationMainCfg,
    EvaluationWeightCfg
] = Src_Data) ->
    BinList_EvaluationMainCfg = [
        item_to_bin_40(EvaluationMainCfg_Item) || EvaluationMainCfg_Item <- EvaluationMainCfg
    ], 

    EvaluationMainCfg_Len = length(EvaluationMainCfg), 
    Bin_EvaluationMainCfg = list_to_binary(BinList_EvaluationMainCfg),

    BinList_EvaluationWeightCfg = [
        item_to_bin_41(EvaluationWeightCfg_Item) || EvaluationWeightCfg_Item <- EvaluationWeightCfg
    ], 

    EvaluationWeightCfg_Len = length(EvaluationWeightCfg), 
    Bin_EvaluationWeightCfg = list_to_binary(BinList_EvaluationWeightCfg),

    Data = <<
        EvaluationMainCfg_Len:16, Bin_EvaluationMainCfg/binary,
        EvaluationWeightCfg_Len:16, Bin_EvaluationWeightCfg/binary
    >>,
    {ok, pt:encode(33159, Data, Src_Data)};

write (33160,[
    Errcode,
    SubType,
    ChooseBigRewardId,
    LuckyNum,
    LuckyNumMax
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        ChooseBigRewardId:16,
        LuckyNum:32,
        LuckyNumMax:32
    >>,
    {ok, pt:encode(33160, Data, Src_Data)};

write (33161,[
    Errcode,
    SubType,
    Type,
    ChooseBigRewardId,
    LuckyNum,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_42(RewardList_Item) || RewardList_Item <- RewardList
    ], 

    RewardList_Len = length(RewardList), 
    Bin_RewardList = list_to_binary(BinList_RewardList),

    Data = <<
        Errcode:32,
        SubType:16,
        Type:8,
        ChooseBigRewardId:16,
        LuckyNum:32,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33161, Data, Src_Data)};

write (33162,[
    Errcode,
    SubType,
    NowPoint,
    SelfNowPoint,
    ExpEndTime,
    DropEndTime,
    GetRewardIdList
] = Src_Data) ->
    BinList_GetRewardIdList = [
        item_to_bin_43(GetRewardIdList_Item) || GetRewardIdList_Item <- GetRewardIdList
    ], 

    GetRewardIdList_Len = length(GetRewardIdList), 
    Bin_GetRewardIdList = list_to_binary(BinList_GetRewardIdList),

    Data = <<
        Errcode:32,
        SubType:16,
        NowPoint:32,
        SelfNowPoint:32,
        ExpEndTime:32,
        DropEndTime:32,
        GetRewardIdList_Len:16, Bin_GetRewardIdList/binary
    >>,
    {ok, pt:encode(33162, Data, Src_Data)};

write (33163,[
    Errcode,
    SubType,
    PutType,
    RewardType,
    RewardId
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        PutType:8,
        RewardType:8,
        RewardId:32
    >>,
    {ok, pt:encode(33163, Data, Src_Data)};

write (33164,[
    Errcode,
    SubType,
    RechargeNum,
    ConsumeNum
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        RechargeNum:32,
        ConsumeNum:32
    >>,
    {ok, pt:encode(33164, Data, Src_Data)};

write (33165,[
    Errcode,
    SubType,
    RewardLogList
] = Src_Data) ->
    BinList_RewardLogList = [
        item_to_bin_44(RewardLogList_Item) || RewardLogList_Item <- RewardLogList
    ], 

    RewardLogList_Len = length(RewardLogList), 
    Bin_RewardLogList = list_to_binary(BinList_RewardLogList),

    Data = <<
        Errcode:32,
        SubType:16,
        RewardLogList_Len:16, Bin_RewardLogList/binary
    >>,
    {ok, pt:encode(33165, Data, Src_Data)};

write (33166,[
    Errcode,
    SubType,
    RollId
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        RollId:16
    >>,
    {ok, pt:encode(33166, Data, Src_Data)};

write (33167,[
    Errcode,
    SubType,
    BigRewardId
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        BigRewardId:16
    >>,
    {ok, pt:encode(33167, Data, Src_Data)};

write (33168,[
    Result,
    Args,
    Opty,
    Grade,
    Time
] = Src_Data) ->
    Bin_Args = pt:write_string(Args), 

    Data = <<
        Result:32,
        Bin_Args/binary,
        Opty:8,
        Grade:8,
        Time:32
    >>,
    {ok, pt:encode(33168, Data, Src_Data)};

write (33169,[
    BaseType,
    SubType,
    MyRank,
    MyVieNum,
    RankList
] = Src_Data) ->
    BinList_RankList = [
        item_to_bin_45(RankList_Item) || RankList_Item <- RankList
    ], 

    RankList_Len = length(RankList), 
    Bin_RankList = list_to_binary(BinList_RankList),

    Data = <<
        BaseType:16,
        SubType:16,
        MyRank:16,
        MyVieNum:32,
        RankList_Len:16, Bin_RankList/binary
    >>,
    {ok, pt:encode(33169, Data, Src_Data)};

write (33170,[
    Type,
    Subtype,
    Stage,
    IsNotLim,
    Etime,
    ShowList
] = Src_Data) ->
    BinList_ShowList = [
        item_to_bin_46(ShowList_Item) || ShowList_Item <- ShowList
    ], 

    ShowList_Len = length(ShowList), 
    Bin_ShowList = list_to_binary(BinList_ShowList),

    Data = <<
        Type:16,
        Subtype:16,
        Stage:8,
        IsNotLim:8,
        Etime:32,
        ShowList_Len:16, Bin_ShowList/binary
    >>,
    {ok, pt:encode(33170, Data, Src_Data)};

write (33171,[
    Type,
    Subtype,
    ProductList,
    Record
] = Src_Data) ->
    BinList_ProductList = [
        item_to_bin_47(ProductList_Item) || ProductList_Item <- ProductList
    ], 

    ProductList_Len = length(ProductList), 
    Bin_ProductList = list_to_binary(BinList_ProductList),

    BinList_Record = [
        item_to_bin_48(Record_Item) || Record_Item <- Record
    ], 

    Record_Len = length(Record), 
    Bin_Record = list_to_binary(BinList_Record),

    Data = <<
        Type:16,
        Subtype:16,
        ProductList_Len:16, Bin_ProductList/binary,
        Record_Len:16, Bin_Record/binary
    >>,
    {ok, pt:encode(33171, Data, Src_Data)};

write (33172,[
    Type,
    Subtype,
    ObtainList
] = Src_Data) ->
    BinList_ObtainList = [
        item_to_bin_49(ObtainList_Item) || ObtainList_Item <- ObtainList
    ], 

    ObtainList_Len = length(ObtainList), 
    Bin_ObtainList = list_to_binary(BinList_ObtainList),

    Data = <<
        Type:16,
        Subtype:16,
        ObtainList_Len:16, Bin_ObtainList/binary
    >>,
    {ok, pt:encode(33172, Data, Src_Data)};

write (33173,[
    Type,
    Subtype,
    Utype
] = Src_Data) ->
    Data = <<
        Type:16,
        Subtype:16,
        Utype:8
    >>,
    {ok, pt:encode(33173, Data, Src_Data)};

write (33174,[
    Errcode,
    Type,
    Subtype,
    ProductId,
    SelfBuyNum,
    SelfBuyLim,
    TotalBuyNum,
    TotalNumLim,
    Reward
] = Src_Data) ->
    BinList_Reward = [
        item_to_bin_50(Reward_Item) || Reward_Item <- Reward
    ], 

    Reward_Len = length(Reward), 
    Bin_Reward = list_to_binary(BinList_Reward),

    Data = <<
        Errcode:32,
        Type:16,
        Subtype:16,
        ProductId:32,
        SelfBuyNum:16,
        SelfBuyLim:16,
        TotalBuyNum:16,
        TotalNumLim:16,
        Reward_Len:16, Bin_Reward/binary
    >>,
    {ok, pt:encode(33174, Data, Src_Data)};

write (33175,[
    WinnerList
] = Src_Data) ->
    BinList_WinnerList = [
        item_to_bin_51(WinnerList_Item) || WinnerList_Item <- WinnerList
    ], 

    WinnerList_Len = length(WinnerList), 
    Bin_WinnerList = list_to_binary(BinList_WinnerList),

    Data = <<
        WinnerList_Len:16, Bin_WinnerList/binary
    >>,
    {ok, pt:encode(33175, Data, Src_Data)};

write (33176,[
    Type,
    Subtype,
    Stage,
    Etime
] = Src_Data) ->
    Data = <<
        Type:16,
        Subtype:16,
        Stage:8,
        Etime:32
    >>,
    {ok, pt:encode(33176, Data, Src_Data)};

write (33177,[
    LoginTime,
    CumulativeTime
] = Src_Data) ->
    Data = <<
        LoginTime:32,
        CumulativeTime:32
    >>,
    {ok, pt:encode(33177, Data, Src_Data)};

write (33178,[
    RewardMultiple
] = Src_Data) ->
    BinList_RewardMultiple = [
        item_to_bin_52(RewardMultiple_Item) || RewardMultiple_Item <- RewardMultiple
    ], 

    RewardMultiple_Len = length(RewardMultiple), 
    Bin_RewardMultiple = list_to_binary(BinList_RewardMultiple),

    Data = <<
        RewardMultiple_Len:16, Bin_RewardMultiple/binary
    >>,
    {ok, pt:encode(33178, Data, Src_Data)};

write (33179,[
    Errcode,
    Time,
    DrawKey
] = Src_Data) ->
    Bin_DrawKey = pt:write_string(DrawKey), 

    Data = <<
        Errcode:32,
        Time:32,
        Bin_DrawKey/binary
    >>,
    {ok, pt:encode(33179, Data, Src_Data)};

write (33180,[
    Round,
    CurrCount,
    AwardStatus
] = Src_Data) ->
    BinList_AwardStatus = [
        item_to_bin_53(AwardStatus_Item) || AwardStatus_Item <- AwardStatus
    ], 

    AwardStatus_Len = length(AwardStatus), 
    Bin_AwardStatus = list_to_binary(BinList_AwardStatus),

    Data = <<
        Round:8,
        CurrCount:16,
        AwardStatus_Len:16, Bin_AwardStatus/binary
    >>,
    {ok, pt:encode(33180, Data, Src_Data)};

write (33181,[
    Errcode,
    AwardId
] = Src_Data) ->
    Data = <<
        Errcode:32,
        AwardId:8
    >>,
    {ok, pt:encode(33181, Data, Src_Data)};

write (33182,[
    BaseType,
    SubType,
    Grade,
    Progress,
    Status,
    ReceiveTimes
] = Src_Data) ->
    Data = <<
        BaseType:16,
        SubType:16,
        Grade:16,
        Progress:32,
        Status:8,
        ReceiveTimes:16
    >>,
    {ok, pt:encode(33182, Data, Src_Data)};

write (33183,[
    PageSize,
    PageNum,
    PageMax,
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_54(List_Item) || List_Item <- List
    ], 

    List_Len = length(List), 
    Bin_List = list_to_binary(BinList_List),

    Data = <<
        PageSize:8,
        PageNum:8,
        PageMax:16,
        List_Len:16, Bin_List/binary
    >>,
    {ok, pt:encode(33183, Data, Src_Data)};

write (33184,[
    Errcode,
    AwardId
] = Src_Data) ->
    Data = <<
        Errcode:32,
        AwardId:8
    >>,
    {ok, pt:encode(33184, Data, Src_Data)};

write (33185,[
    BaseType,
    SubType,
    StartTime,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_55(RewardList_Item) || RewardList_Item <- RewardList
    ], 

    RewardList_Len = length(RewardList), 
    Bin_RewardList = list_to_binary(BinList_RewardList),

    Data = <<
        BaseType:16,
        SubType:16,
        StartTime:32,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33185, Data, Src_Data)};

write (33186,[
    Errcode,
    BaseType,
    SubType,
    Grade,
    Time,
    Status
] = Src_Data) ->
    Data = <<
        Errcode:32,
        BaseType:16,
        SubType:16,
        Grade:16,
        Time:32,
        Status:8
    >>,
    {ok, pt:encode(33186, Data, Src_Data)};

write (33187,[
    SubType,
    Round,
    StartTime,
    EndTime,
    RoundInfo
] = Src_Data) ->
    BinList_RoundInfo = [
        item_to_bin_56(RoundInfo_Item) || RoundInfo_Item <- RoundInfo
    ], 

    RoundInfo_Len = length(RoundInfo), 
    Bin_RoundInfo = list_to_binary(BinList_RoundInfo),

    Data = <<
        SubType:16,
        Round:8,
        StartTime:32,
        EndTime:32,
        RoundInfo_Len:16, Bin_RoundInfo/binary
    >>,
    {ok, pt:encode(33187, Data, Src_Data)};

write (33188,[
    Round,
    RoundInfo
] = Src_Data) ->
    BinList_RoundInfo = [
        item_to_bin_57(RoundInfo_Item) || RoundInfo_Item <- RoundInfo
    ], 

    RoundInfo_Len = length(RoundInfo), 
    Bin_RoundInfo = list_to_binary(BinList_RoundInfo),

    Data = <<
        Round:8,
        RoundInfo_Len:16, Bin_RoundInfo/binary
    >>,
    {ok, pt:encode(33188, Data, Src_Data)};

write (33189,[
    BuyLog
] = Src_Data) ->
    BinList_BuyLog = [
        item_to_bin_58(BuyLog_Item) || BuyLog_Item <- BuyLog
    ], 

    BuyLog_Len = length(BuyLog), 
    Bin_BuyLog = list_to_binary(BinList_BuyLog),

    Data = <<
        BuyLog_Len:16, Bin_BuyLog/binary
    >>,
    {ok, pt:encode(33189, Data, Src_Data)};

write (33190,[
    Res,
    GradeId,
    Round,
    BuyLog
] = Src_Data) ->
    BinList_BuyLog = [
        item_to_bin_59(BuyLog_Item) || BuyLog_Item <- BuyLog
    ], 

    BuyLog_Len = length(BuyLog), 
    Bin_BuyLog = list_to_binary(BinList_BuyLog),

    Data = <<
        Res:32,
        GradeId:16,
        Round:8,
        BuyLog_Len:16, Bin_BuyLog/binary
    >>,
    {ok, pt:encode(33190, Data, Src_Data)};

write (33191,[
    GradeId,
    Res,
    Round
] = Src_Data) ->
    Data = <<
        GradeId:16,
        Res:32,
        Round:8
    >>,
    {ok, pt:encode(33191, Data, Src_Data)};



write (33193,[
    ServerNum,
    Name,
    Cost,
    GoodsId,
    GoodsNum,
    GradeId,
    Round,
    TvId
] = Src_Data) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        ServerNum:16,
        Bin_Name/binary,
        Cost:32,
        GoodsId:32,
        GoodsNum:16,
        GradeId:16,
        Round:8,
        TvId:16
    >>,
    {ok, pt:encode(33193, Data, Src_Data)};

write (33194,[
    Round
] = Src_Data) ->
    Data = <<
        Round:8
    >>,
    {ok, pt:encode(33194, Data, Src_Data)};

write (33195,[
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_60(List_Item) || List_Item <- List
    ], 

    List_Len = length(List), 
    Bin_List = list_to_binary(BinList_List),

    Data = <<
        List_Len:16, Bin_List/binary
    >>,
    {ok, pt:encode(33195, Data, Src_Data)};

write (33196,[
    SubType,
    ServerNum,
    Count,
    RewardList,
    TaskList,
    ServerLog,
    SelfLog
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_61(RewardList_Item) || RewardList_Item <- RewardList
    ], 

    RewardList_Len = length(RewardList), 
    Bin_RewardList = list_to_binary(BinList_RewardList),

    BinList_TaskList = [
        item_to_bin_62(TaskList_Item) || TaskList_Item <- TaskList
    ], 

    TaskList_Len = length(TaskList), 
    Bin_TaskList = list_to_binary(BinList_TaskList),

    BinList_ServerLog = [
        item_to_bin_63(ServerLog_Item) || ServerLog_Item <- ServerLog
    ], 

    ServerLog_Len = length(ServerLog), 
    Bin_ServerLog = list_to_binary(BinList_ServerLog),

    BinList_SelfLog = [
        item_to_bin_64(SelfLog_Item) || SelfLog_Item <- SelfLog
    ], 

    SelfLog_Len = length(SelfLog), 
    Bin_SelfLog = list_to_binary(BinList_SelfLog),

    Data = <<
        SubType:16,
        ServerNum:16,
        Count:8,
        RewardList_Len:16, Bin_RewardList/binary,
        TaskList_Len:16, Bin_TaskList/binary,
        ServerLog_Len:16, Bin_ServerLog/binary,
        SelfLog_Len:16, Bin_SelfLog/binary
    >>,
    {ok, pt:encode(33196, Data, Src_Data)};

write (33197,[
    ErrorCode,
    TaskId
] = Src_Data) ->
    Data = <<
        ErrorCode:32,
        TaskId:8
    >>,
    {ok, pt:encode(33197, Data, Src_Data)};

write (33198,[
    ErrorCode,
    SubType
] = Src_Data) ->
    Data = <<
        ErrorCode:32,
        SubType:16
    >>,
    {ok, pt:encode(33198, Data, Src_Data)};

write (33199,[
    ErrorCode,
    SubType,
    PosId,
    RewardId,
    ServerNum
] = Src_Data) ->
    Data = <<
        ErrorCode:32,
        SubType:16,
        PosId:8,
        RewardId:16,
        ServerNum:16
    >>,
    {ok, pt:encode(33199, Data, Src_Data)};

write(_Cmd, _R) -> ?DEBUG("no_match:~p,~p~n", [_Cmd, _R]), {ok, pt:pack(0, <<>>)}.


item_to_bin_0 ({
    BaseType,
    SubType,
    ActType,
    Wlv,
    Name,
    Desc,
    Condition,
    Stime,
    Etime,
    IsFirstOpen
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_Desc = pt:write_string(Desc), 

    Bin_Condition = pt:write_string(Condition), 

    Data = <<
        BaseType:16,
        SubType:16,
        ActType:8,
        Wlv:16,
        Bin_Name/binary,
        Bin_Desc/binary,
        Bin_Condition/binary,
        Stime:32,
        Etime:32,
        IsFirstOpen:8
    >>,
    Data.
item_to_bin_1 ({
    BaseType,
    SubType,
    ActType,
    Wlv,
    Name,
    Desc,
    Condition,
    Stime,
    Etime,
    IsFirstOpen
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_Desc = pt:write_string(Desc), 

    Bin_Condition = pt:write_string(Condition), 

    Data = <<
        BaseType:16,
        SubType:16,
        ActType:8,
        Wlv:16,
        Bin_Name/binary,
        Bin_Desc/binary,
        Bin_Condition/binary,
        Stime:32,
        Etime:32,
        IsFirstOpen:8
    >>,
    Data.
item_to_bin_2 ({
    BaseType,
    SubType
}) ->
    Data = <<
        BaseType:16,
        SubType:16
    >>,
    Data.
item_to_bin_3 ({
    Grade,
    FormType,
    Progress,
    Status,
    ReceiveTimes,
    Name,
    Desc,
    Conditon,
    Reward
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_Desc = pt:write_string(Desc), 

    Bin_Conditon = pt:write_string(Conditon), 

    Bin_Reward = pt:write_string(Reward), 

    Data = <<
        Grade:16,
        FormType:8,
        Progress:32,
        Status:8,
        ReceiveTimes:16,
        Bin_Name/binary,
        Bin_Desc/binary,
        Bin_Conditon/binary,
        Bin_Reward/binary
    >>,
    Data.
item_to_bin_4 ({
    Type,
    Value
}) ->
    Data = <<
        Type:8,
        Value:32
    >>,
    Data.
item_to_bin_5 ({
    Awardid,
    Name,
    GoodsName,
    Radio
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_GoodsName = pt:write_string(GoodsName), 

    Data = <<
        Awardid:16,
        Bin_Name/binary,
        Bin_GoodsName/binary,
        Radio:16
    >>,
    Data.
item_to_bin_6 ({
    Grade,
    CostType,
    CostNum,
    CostDiscount,
    LessNum,
    AllNum,
    LessNumSelf,
    AllNumSelf
}) ->
    Data = <<
        Grade:16,
        CostType:16,
        CostNum:32,
        CostDiscount:16,
        LessNum:16,
        AllNum:16,
        LessNumSelf:16,
        AllNumSelf:16
    >>,
    Data.
item_to_bin_7 ({
    Platform,
    ServerNum,
    Name,
    PlayerBuyNum
}) ->
    Bin_Platform = pt:write_string(Platform), 

    Bin_Name = pt:write_string(Name), 

    Data = <<
        Bin_Platform/binary,
        ServerNum:16,
        Bin_Name/binary,
        PlayerBuyNum:16
    >>,
    Data.
item_to_bin_8 ({
    RewardId,
    RewardNum
}) ->
    Data = <<
        RewardId:16,
        RewardNum:16
    >>,
    Data.
item_to_bin_9 ({
    Platform,
    ServerNum,
    Name,
    RoleId
}) ->
    Bin_Platform = pt:write_string(Platform), 

    Bin_Name = pt:write_string(Name), 

    Data = <<
        Bin_Platform/binary,
        ServerNum:16,
        Bin_Name/binary,
        RoleId:64
    >>,
    Data.
item_to_bin_10 ({
    WeddingTypeId,
    WeddingTimes,
    ReceiveStatus
}) ->
    Data = <<
        WeddingTypeId:8,
        WeddingTimes:16,
        ReceiveStatus:8
    >>,
    Data.
item_to_bin_11 ({
    RoleIdM,
    NameM,
    RoleIdW,
    NameW,
    Time
}) ->
    Bin_NameM = pt:write_string(NameM), 

    Bin_NameW = pt:write_string(NameW), 

    Data = <<
        RoleIdM:64,
        Bin_NameM/binary,
        RoleIdW:64,
        Bin_NameW/binary,
        Time:32
    >>,
    Data.
item_to_bin_12 ({
    RoleIdM,
    NameM,
    RoleIdW,
    NameW,
    Time
}) ->
    Bin_NameM = pt:write_string(NameM), 

    Bin_NameW = pt:write_string(NameW), 

    Data = <<
        RoleIdM:64,
        Bin_NameM/binary,
        RoleIdW:64,
        Bin_NameW/binary,
        Time:32
    >>,
    Data.
item_to_bin_13 (
    WeddingType
) ->
    Data = <<
        WeddingType:8
    >>,
    Data.
item_to_bin_14 ({
    WeddingTypeId,
    ReceiveStatus
}) ->
    Data = <<
        WeddingTypeId:8,
        ReceiveStatus:8
    >>,
    Data.
item_to_bin_15 ({
    Id,
    MinWlv,
    MaxWlv,
    GoodsId,
    GoodsNum,
    Effect,
    IsRare
}) ->
    Data = <<
        Id:16,
        MinWlv:16,
        MaxWlv:16,
        GoodsId:32,
        GoodsNum:16,
        Effect:8,
        IsRare:8
    >>,
    Data.
item_to_bin_16 ({
    Times,
    Time
}) ->
    Data = <<
        Times:8,
        Time:32
    >>,
    Data.
item_to_bin_17 ({
    GoodsId,
    GoodsNum,
    Effect
}) ->
    Data = <<
        GoodsId:32,
        GoodsNum:32,
        Effect:8
    >>,
    Data.
item_to_bin_18 ({
    Id,
    Status,
    GoodsId,
    GoodsNum,
    Effect
}) ->
    Data = <<
        Id:8,
        Status:8,
        GoodsId:32,
        GoodsNum:32,
        Effect:8
    >>,
    Data.
item_to_bin_19 ({
    Name,
    GoodsId,
    GoodsNum,
    Time
}) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        Bin_Name/binary,
        GoodsId:32,
        GoodsNum:32,
        Time:32
    >>,
    Data.
item_to_bin_20 ({
    Times,
    Reward,
    Status
}) ->
    Bin_Reward = pt:write_object_list(Reward), 

    Data = <<
        Times:16,
        Bin_Reward/binary,
        Status:8
    >>,
    Data.
item_to_bin_21 ({
    Id,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        Id:8,
        GoodsId:32,
        GoodsNum:32
    >>,
    Data.
item_to_bin_22 ({
    Times,
    Reward,
    Status
}) ->
    Bin_Reward = pt:write_object_list(Reward), 

    Data = <<
        Times:16,
        Bin_Reward/binary,
        Status:8
    >>,
    Data.
item_to_bin_23 ({
    GoodsType,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsType:16,
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_24 ({
    Time,
    CouponDiscount,
    CouponAbDiscount,
    Money,
    GoodsList
}) ->
    BinList_GoodsList = [
        item_to_bin_25(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

    GoodsList_Len = length(GoodsList), 
    Bin_GoodsList = list_to_binary(BinList_GoodsList),

    Data = <<
        Time:32,
        CouponDiscount:32,
        CouponAbDiscount:32,
        Money:32,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    Data.
item_to_bin_25 ({
    GoodsId,
    Num
}) ->
    Data = <<
        GoodsId:32,
        Num:8
    >>,
    Data.
item_to_bin_26 (
    GoodsId
) ->
    Data = <<
        GoodsId:32
    >>,
    Data.
item_to_bin_27 ({
    PlayerId,
    Figure,
    IsPublic,
    FirstValue,
    Rank
}) ->
    Bin_Figure = pt:write_figure(Figure), 

    Data = <<
        PlayerId:64,
        Bin_Figure/binary,
        IsPublic:8,
        FirstValue:32,
        Rank:32
    >>,
    Data.
item_to_bin_28 ({
    GradeId,
    GetNum,
    Status
}) ->
    Data = <<
        GradeId:8,
        GetNum:16,
        Status:8
    >>,
    Data.
item_to_bin_29 (
    AwardId
) ->
    Data = <<
        AwardId:16
    >>,
    Data.
item_to_bin_30 (
    AwardId
) ->
    Data = <<
        AwardId:16
    >>,
    Data.
item_to_bin_31 ({
    ModId,
    Name,
    OnePoints,
    MaxPoints,
    Times,
    OrderId,
    JumpId,
    SecValue
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_JumpId = pt:write_string(JumpId), 

    Data = <<
        ModId:32,
        Bin_Name/binary,
        OnePoints:32,
        MaxPoints:32,
        Times:32,
        OrderId:16,
        Bin_JumpId/binary,
        SecValue:32
    >>,
    Data.
item_to_bin_32 ({
    Grade,
    IsBuy,
    Awards
}) ->
    BinList_Awards = [
        item_to_bin_33(Awards_Item) || Awards_Item <- Awards
    ], 

    Awards_Len = length(Awards), 
    Bin_Awards = list_to_binary(BinList_Awards),

    Data = <<
        Grade:8,
        IsBuy:8,
        Awards_Len:16, Bin_Awards/binary
    >>,
    Data.
item_to_bin_33 ({
    AwardId,
    Status
}) ->
    Data = <<
        AwardId:16,
        Status:8
    >>,
    Data.
item_to_bin_34 ({
    Id,
    Key,
    Value
}) ->
    Bin_Key = pt:write_string(Key), 

    Bin_Value = pt:write_string(Value), 

    Data = <<
        Id:16,
        Bin_Key/binary,
        Bin_Value/binary
    >>,
    Data.
item_to_bin_35 ({
    Id,
    LowerWlv,
    UpperWlv,
    RewardType,
    Rewards,
    GoodsNum,
    Weight,
    Rare
}) ->
    Bin_Rewards = pt:write_string(Rewards), 

    Data = <<
        Id:32,
        LowerWlv:16,
        UpperWlv:16,
        RewardType:8,
        Bin_Rewards/binary,
        GoodsNum:16,
        Weight:16,
        Rare:8
    >>,
    Data.
item_to_bin_36 (
    Grade
) ->
    Data = <<
        Grade:8
    >>,
    Data.
item_to_bin_37 ({
    TaskRow,
    TaskColu,
    TaskNum,
    TaskState
}) ->
    Data = <<
        TaskRow:8,
        TaskColu:8,
        TaskNum:8,
        TaskState:8
    >>,
    Data.
item_to_bin_38 ({
    Id,
    RoleId,
    RoleName,
    Career,
    Sex,
    Turn,
    Picture,
    PictureVer,
    Type,
    Extra,
    Status,
    ReceiveStatus
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Bin_Picture = pt:write_string(Picture), 

    Data = <<
        Id:64,
        RoleId:64,
        Bin_RoleName/binary,
        Career:8,
        Sex:8,
        Turn:8,
        Bin_Picture/binary,
        PictureVer:32,
        Type:8,
        Extra:32,
        Status:8,
        ReceiveStatus:8
    >>,
    Data.
item_to_bin_39 ({
    RoleId,
    RoleName,
    Career,
    Sex,
    Turn,
    Picture,
    PictureVer,
    ReceiveMoney,
    Time
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Bin_Picture = pt:write_string(Picture), 

    Data = <<
        RoleId:64,
        Bin_RoleName/binary,
        Career:8,
        Sex:8,
        Turn:8,
        Bin_Picture/binary,
        PictureVer:32,
        ReceiveMoney:32,
        Time:32
    >>,
    Data.
item_to_bin_40 ({
    MainRewardId,
    RewardId,
    ImageStr,
    Power,
    KindId,
    ImageId,
    AttrList,
    RewardType,
    GoodsList,
    Weight
}) ->
    Bin_ImageStr = pt:write_string(ImageStr), 

    Bin_AttrList = pt:write_string(AttrList), 

    Bin_GoodsList = pt:write_string(GoodsList), 

    Data = <<
        MainRewardId:16,
        RewardId:16,
        Bin_ImageStr/binary,
        Power:32,
        KindId:8,
        ImageId:32,
        Bin_AttrList/binary,
        RewardType:8,
        Bin_GoodsList/binary,
        Weight:16
    >>,
    Data.
item_to_bin_41 ({
    MainRewardId,
    RewardId,
    RewardType,
    GoodsList,
    Weight
}) ->
    Bin_GoodsList = pt:write_string(GoodsList), 

    Data = <<
        MainRewardId:16,
        RewardId:16,
        RewardType:8,
        Bin_GoodsList/binary,
        Weight:16
    >>,
    Data.
item_to_bin_42 (
    RewardId
) ->
    Data = <<
        RewardId:32
    >>,
    Data.
item_to_bin_43 (
    RewardId
) ->
    Data = <<
        RewardId:32
    >>,
    Data.
item_to_bin_44 ({
    RoleId,
    Name,
    RollId
}) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        RoleId:64,
        Bin_Name/binary,
        RollId:16
    >>,
    Data.
item_to_bin_45 ({
    Id,
    Name,
    Vip,
    SvipType,
    ServerNum,
    Rank,
    VieNum
}) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        Id:64,
        Bin_Name/binary,
        Vip:8,
        SvipType:8,
        ServerNum:32,
        Rank:16,
        VieNum:32
    >>,
    Data.
item_to_bin_46 ({
    ObjectType,
    GtypeId,
    Num,
    IsBind,
    IsRare
}) ->
    Data = <<
        ObjectType:8,
        GtypeId:32,
        Num:32,
        IsBind:8,
        IsRare:8
    >>,
    Data.
item_to_bin_47 ({
    ProductId,
    ProductName,
    Grade,
    GtypeId,
    GoodsNum,
    TotalBuyNum,
    TotalNumLim,
    SelfBuyNum,
    SelfBuyLim,
    WinnerNumLim,
    IsWinner
}) ->
    Bin_ProductName = pt:write_string(ProductName), 

    Data = <<
        ProductId:32,
        Bin_ProductName/binary,
        Grade:16,
        GtypeId:32,
        GoodsNum:32,
        TotalBuyNum:16,
        TotalNumLim:16,
        SelfBuyNum:16,
        SelfBuyLim:16,
        WinnerNumLim:16,
        IsWinner:8
    >>,
    Data.
item_to_bin_48 ({
    ServerNum,
    RoleName,
    ProductName,
    BuyNum
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Bin_ProductName = pt:write_string(ProductName), 

    Data = <<
        ServerNum:16,
        Bin_RoleName/binary,
        Bin_ProductName/binary,
        BuyNum:16
    >>,
    Data.
item_to_bin_49 ({
    RoleName,
    GtypeId,
    Num,
    Time
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        Bin_RoleName/binary,
        GtypeId:32,
        Num:32,
        Time:32
    >>,
    Data.
item_to_bin_50 ({
    ObjectType,
    GtypeId,
    Num
}) ->
    Data = <<
        ObjectType:8,
        GtypeId:32,
        Num:32
    >>,
    Data.
item_to_bin_51 ({
    RewardList,
    RewardLevel,
    ServerNum,
    RoleName
}) ->
    Bin_RewardList = pt:write_object_list(RewardList), 

    Bin_RewardLevel = pt:write_string(RewardLevel), 

    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        Bin_RewardList/binary,
        Bin_RewardLevel/binary,
        ServerNum:16,
        Bin_RoleName/binary
    >>,
    Data.
item_to_bin_52 ({
    Type,
    Subtype,
    GradeId,
    Multiple
}) ->
    Data = <<
        Type:16,
        Subtype:16,
        GradeId:16,
        Multiple:16
    >>,
    Data.
item_to_bin_53 ({
    Count,
    Status
}) ->
    Data = <<
        Count:16,
        Status:8
    >>,
    Data.
item_to_bin_54 ({
    Id,
    Name,
    GoodsTypeId,
    GoodsNum,
    GetType
}) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        Id:64,
        Bin_Name/binary,
        GoodsTypeId:32,
        GoodsNum:16,
        GetType:8
    >>,
    Data.
item_to_bin_55 ({
    Grade,
    Time,
    Status
}) ->
    Data = <<
        Grade:16,
        Time:32,
        Status:8
    >>,
    Data.
item_to_bin_56 ({
    RoundId,
    RoundTime,
    Duration,
    Label
}) ->
    Bin_RoundTime = pt:write_string(RoundTime), 

    Data = <<
        RoundId:8,
        Bin_RoundTime/binary,
        Duration:32,
        Label:8
    >>,
    Data.
item_to_bin_57 ({
    GradeId,
    Goods,
    Condition,
    BuyCount,
    SelfBuy
}) ->
    Bin_Goods = pt:write_string(Goods), 

    Bin_Condition = pt:write_string(Condition), 

    Data = <<
        GradeId:16,
        Bin_Goods/binary,
        Bin_Condition/binary,
        BuyCount:8,
        SelfBuy:8
    >>,
    Data.
item_to_bin_58 ({
    ServerNum,
    Name,
    Cost,
    GoodsId,
    GoodsNum,
    TvId
}) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        ServerNum:16,
        Bin_Name/binary,
        Cost:32,
        GoodsId:32,
        GoodsNum:16,
        TvId:16
    >>,
    Data.
item_to_bin_59 ({
    ServerNum,
    Name
}) ->
    Bin_Name = pt:write_string(Name), 

    Data = <<
        ServerNum:16,
        Bin_Name/binary
    >>,
    Data.
item_to_bin_60 ({
    BaseType,
    SubType,
    ActType,
    Name,
    Desc,
    Condition,
    Stime
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_Desc = pt:write_string(Desc), 

    Bin_Condition = pt:write_string(Condition), 

    Data = <<
        BaseType:16,
        SubType:16,
        ActType:8,
        Bin_Name/binary,
        Bin_Desc/binary,
        Bin_Condition/binary,
        Stime:32
    >>,
    Data.
item_to_bin_61 ({
    PosId,
    RewardId
}) ->
    Data = <<
        PosId:8,
        RewardId:16
    >>,
    Data.
item_to_bin_62 ({
    TaskId,
    TaskStatus,
    TaskProgress
}) ->
    Data = <<
        TaskId:16,
        TaskStatus:8,
        TaskProgress:16
    >>,
    Data.
item_to_bin_63 ({
    RoleId,
    RoleName,
    ServerNum,
    RewardId
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        RoleId:64,
        Bin_RoleName/binary,
        ServerNum:16,
        RewardId:16
    >>,
    Data.
item_to_bin_64 (
    RewardId
) ->
    Data = <<
        RewardId:16
    >>,
    Data.
