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

read(33201, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33202, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<TurnType:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, TurnType]};
read(33203, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<TurnType:8, Bin2/binary>> = Bin1, 
    <<Skip:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, TurnType, Skip]};
read(33204, _) ->
    {ok, []};
read(33205, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33206, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33207, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<RewardId:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, RewardId]};
read(33208, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<DrawType:16, Bin2/binary>> = Bin1, 
    <<BuyType:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, DrawType, BuyType]};
read(33209, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33210, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, SubType]};
read(33211, Bin0) ->
    <<Type:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [Type, SubType]};
read(33212, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Grade]};
read(33213, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Grade]};
read(33214, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33215, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    FunArray0 = fun(<<RestBin0/binary>>) -> 
        <<GradeId:16, _Args1/binary>> = RestBin0, 
        {GradeId,_Args1}
        end,
    {DrawList, _Bin2} = pt:read_array(FunArray0, Bin1),

    {ok, [SubType, DrawList]};
read(33216, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33217, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Times:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Times]};
read(33218, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33219, _) ->
    {ok, []};
read(33220, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33221, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33222, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33223, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33225, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33226, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<TaskType:16, Bin2/binary>> = Bin1, 
    <<Id:16, _Bin3/binary>> = Bin2, 
    {ok, [SubType, TaskType, Id]};
read(33227, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<StartDay:16, Bin2/binary>> = Bin1, 
    <<EndDay:16, _Bin3/binary>> = Bin2, 
    {ok, [SubType, StartDay, EndDay]};
read(33228, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33229, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Type]};
read(33230, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33231, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Circle:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Circle]};
read(33232, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33233, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33234, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, Bin2/binary>> = Bin1, 
    <<TypeId:16, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Type, TypeId]};
read(33235, _) ->
    {ok, []};
read(33236, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, Bin2/binary>> = Bin1, 
    <<Lv:16, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Type, Lv]};
read(33237, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Discount:8, Bin2/binary>> = Bin1, 
    <<Type:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Discount, Type]};
read(33238, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33239, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, Bin2/binary>> = Bin1, 
    <<Lv:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Type, Lv]};
read(33240, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33241, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33242, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33243, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<TurnType:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, TurnType]};
read(33244, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33245, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Option:8, Bin2/binary>> = Bin1, 
    <<Pos:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Option, Pos]};
read(33246, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33247, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33248, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33249, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33250, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33251, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33252, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33253, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33254, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33255, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33256, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Pos:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Pos]};
read(33257, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33258, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33260, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33261, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Phase:8, Bin2/binary>> = Bin1, 
    <<GradeId:16, Bin3/binary>> = Bin2, 
    <<ExchangeNum:32, _Bin4/binary>> = Bin3, 
    {ok, [SubType, Phase, GradeId, ExchangeNum]};
read(33262, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Phase:8, Bin2/binary>> = Bin1, 
    <<Option:8, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Phase, Option]};
read(33263, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33264, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Type]};
read(33265, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33266, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33267, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33268, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33269, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33270, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<IsChoose:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, IsChoose]};
read(33271, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33272, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<OptionType:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, OptionType]};
read(33273, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    FunArray0 = fun(<<RestBin0/binary>>) -> 
        <<X:8, _Args1/binary>> = RestBin0, 
        <<Y:8, _Args2/binary>> = _Args1, 
        {{X, Y},_Args2}
        end,
    {ChangeList, _Bin2} = pt:read_array(FunArray0, Bin1),

    {ok, [SubType, ChangeList]};
read(33275, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33276, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Day:16, Bin2/binary>> = Bin1, 
    <<TaskType:16, Bin3/binary>> = Bin2, 
    <<Id:16, _Bin4/binary>> = Bin3, 
    {ok, [SubType, Day, TaskType, Id]};
read(33277, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Day:16, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Day]};
read(33278, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33280, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33281, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Kind:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Kind]};
read(33282, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33283, Bin0) ->
    <<ActType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [ActType, SubType]};
read(33284, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33285, Bin0) ->
    <<ActType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [ActType, SubType]};
read(33286, Bin0) ->
    <<ActType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [ActType, SubType]};
read(33287, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Grade]};
read(33288, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Grade:8, _Bin2/binary>> = Bin1, 
    {ok, [SubType, Grade]};
read(33289, Bin0) ->
    <<BaseType:16, Bin1/binary>> = Bin0, 
    <<SubType:16, _Bin2/binary>> = Bin1, 
    {ok, [BaseType, SubType]};
read(33290, Bin0) ->
    <<Slv:16, Bin1/binary>> = Bin0, 
    <<Elv:16, Bin2/binary>> = Bin1, 
    <<SubType:16, _Bin3/binary>> = Bin2, 
    {ok, [Slv, Elv, SubType]};
read(33292, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, Bin2/binary>> = Bin1, 
    <<Id:32, Bin3/binary>> = Bin2, 
    <<RoleId:64, _Bin4/binary>> = Bin3, 
    {ok, [SubType, Type, Id, RoleId]};
read(33293, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    <<Type:8, Bin2/binary>> = Bin1, 
    <<Id:32, _Bin3/binary>> = Bin2, 
    {ok, [SubType, Type, Id]};
read(33294, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33295, Bin0) ->
    <<SubType:16, Bin1/binary>> = Bin0, 
    FunArray0 = fun(<<RestBin0/binary>>) -> 
        <<GoodsId:32, _Args1/binary>> = RestBin0, 
        <<Num:32, _Args2/binary>> = _Args1, 
        {{GoodsId, Num},_Args2}
        end,
    {GoodsList, _Bin2} = pt:read_array(FunArray0, Bin1),

    {ok, [SubType, GoodsList]};
read(33296, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33297, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(33298, _) ->
    {ok, []};
read(33299, Bin0) ->
    <<SubType:16, _Bin1/binary>> = Bin0, 
    {ok, [SubType]};
read(_Cmd, _R) -> {error, no_match}.

write (33201,[
    TotalRecharge,
    LeftTime
] = Src_Data) ->
    Data = <<
        TotalRecharge:32,
        LeftTime:16
    >>,
    {ok, pt:encode(33201, Data, Src_Data)};

write (33202,[
    SubType,
    TurnType,
    MaxTimes,
    Times,
    UseTimes,
    TotalRecharge,
    NeedRecharge,
    TotalConsume,
    NeedConsume
] = Src_Data) ->
    Data = <<
        SubType:16,
        TurnType:8,
        MaxTimes:16,
        Times:16,
        UseTimes:16,
        TotalRecharge:32,
        NeedRecharge:32,
        TotalConsume:32,
        NeedConsume:32
    >>,
    {ok, pt:encode(33202, Data, Src_Data)};

write (33203,[
    SubType,
    TurnType,
    Result,
    Grade,
    Reward
] = Src_Data) ->
    Bin_Reward = pt:write_object_list(Reward), 

    Data = <<
        SubType:16,
        TurnType:8,
        Result:32,
        Grade:16,
        Bin_Reward/binary
    >>,
    {ok, pt:encode(33203, Data, Src_Data)};

write (33204,[
    TaskList
] = Src_Data) ->
    BinList_TaskList = [
        item_to_bin_0(TaskList_Item) || TaskList_Item <- TaskList
    ], 

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

    Data = <<
        TaskList_Len:16, Bin_TaskList/binary
    >>,
    {ok, pt:encode(33204, Data, Src_Data)};

write (33205,[
    SubType,
    TargetList
] = Src_Data) ->
    BinList_TargetList = [
        item_to_bin_1(TargetList_Item) || TargetList_Item <- TargetList
    ], 

    TargetList_Len = length(TargetList), 
    Bin_TargetList = list_to_binary(BinList_TargetList),

    Data = <<
        SubType:16,
        TargetList_Len:16, Bin_TargetList/binary
    >>,
    {ok, pt:encode(33205, Data, Src_Data)};

write (33206,[
    SubType,
    Score,
    RewardInfo
] = Src_Data) ->
    BinList_RewardInfo = [
        item_to_bin_2(RewardInfo_Item) || RewardInfo_Item <- RewardInfo
    ], 

    RewardInfo_Len = length(RewardInfo), 
    Bin_RewardInfo = list_to_binary(BinList_RewardInfo),

    Data = <<
        SubType:16,
        Score:32,
        RewardInfo_Len:16, Bin_RewardInfo/binary
    >>,
    {ok, pt:encode(33206, Data, Src_Data)};

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

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

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

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

write (33210,[
    Type,
    SubType,
    RoleId,
    SelfRecord,
    WholeRecord
] = Src_Data) ->
    BinList_SelfRecord = [
        item_to_bin_3(SelfRecord_Item) || SelfRecord_Item <- SelfRecord
    ], 

    SelfRecord_Len = length(SelfRecord), 
    Bin_SelfRecord = list_to_binary(BinList_SelfRecord),

    BinList_WholeRecord = [
        item_to_bin_4(WholeRecord_Item) || WholeRecord_Item <- WholeRecord
    ], 

    WholeRecord_Len = length(WholeRecord), 
    Bin_WholeRecord = list_to_binary(BinList_WholeRecord),

    Data = <<
        Type:16,
        SubType:16,
        RoleId:64,
        SelfRecord_Len:16, Bin_SelfRecord/binary,
        WholeRecord_Len:16, Bin_WholeRecord/binary
    >>,
    {ok, pt:encode(33210, Data, Src_Data)};

write (33211,[
    Type,
    SubType,
    RoleId,
    SelfRecord,
    WholeRecord
] = Src_Data) ->
    BinList_SelfRecord = [
        item_to_bin_5(SelfRecord_Item) || SelfRecord_Item <- SelfRecord
    ], 

    SelfRecord_Len = length(SelfRecord), 
    Bin_SelfRecord = list_to_binary(BinList_SelfRecord),

    BinList_WholeRecord = [
        item_to_bin_6(WholeRecord_Item) || WholeRecord_Item <- WholeRecord
    ], 

    WholeRecord_Len = length(WholeRecord), 
    Bin_WholeRecord = list_to_binary(BinList_WholeRecord),

    Data = <<
        Type:16,
        SubType:16,
        RoleId:64,
        SelfRecord_Len:16, Bin_SelfRecord/binary,
        WholeRecord_Len:16, Bin_WholeRecord/binary
    >>,
    {ok, pt:encode(33211, Data, Src_Data)};

write (33212,[
    SubType,
    Grade,
    NormalPrice,
    Price,
    Percent
] = Src_Data) ->
    Data = <<
        SubType:16,
        Grade:16,
        NormalPrice:16,
        Price:16,
        Percent:16
    >>,
    {ok, pt:encode(33212, Data, Src_Data)};

write (33213,[
    SubType,
    Grade,
    Price,
    Percent
] = Src_Data) ->
    Data = <<
        SubType:16,
        Grade:16,
        Price:16,
        Percent:16
    >>,
    {ok, pt:encode(33213, Data, Src_Data)};

write (33214,[
    SubType,
    DrawList,
    ReceiveList,
    NowTimes,
    Turn
] = Src_Data) ->
    BinList_DrawList = [
        item_to_bin_7(DrawList_Item) || DrawList_Item <- DrawList
    ], 

    DrawList_Len = length(DrawList), 
    Bin_DrawList = list_to_binary(BinList_DrawList),

    BinList_ReceiveList = [
        item_to_bin_8(ReceiveList_Item) || ReceiveList_Item <- ReceiveList
    ], 

    ReceiveList_Len = length(ReceiveList), 
    Bin_ReceiveList = list_to_binary(BinList_ReceiveList),

    Data = <<
        SubType:16,
        DrawList_Len:16, Bin_DrawList/binary,
        ReceiveList_Len:16, Bin_ReceiveList/binary,
        NowTimes:16,
        Turn:16
    >>,
    {ok, pt:encode(33214, Data, Src_Data)};

write (33215,[
    SubType,
    DrawList
] = Src_Data) ->
    BinList_DrawList = [
        item_to_bin_9(DrawList_Item) || DrawList_Item <- DrawList
    ], 

    DrawList_Len = length(DrawList), 
    Bin_DrawList = list_to_binary(BinList_DrawList),

    Data = <<
        SubType:16,
        DrawList_Len:16, Bin_DrawList/binary
    >>,
    {ok, pt:encode(33215, Data, Src_Data)};

write (33216,[
    SubType,
    DrawList,
    NowTimes,
    Turn
] = Src_Data) ->
    BinList_DrawList = [
        item_to_bin_10(DrawList_Item) || DrawList_Item <- DrawList
    ], 

    DrawList_Len = length(DrawList), 
    Bin_DrawList = list_to_binary(BinList_DrawList),

    Data = <<
        SubType:16,
        DrawList_Len:16, Bin_DrawList/binary,
        NowTimes:16,
        Turn:16
    >>,
    {ok, pt:encode(33216, Data, Src_Data)};

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

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

write (33219,[
    Cfglist
] = Src_Data) ->
    BinList_Cfglist = [
        item_to_bin_11(Cfglist_Item) || Cfglist_Item <- Cfglist
    ], 

    Cfglist_Len = length(Cfglist), 
    Bin_Cfglist = list_to_binary(BinList_Cfglist),

    Data = <<
        Cfglist_Len:16, Bin_Cfglist/binary
    >>,
    {ok, pt:encode(33219, Data, Src_Data)};

write (33220,[
    BaseType,
    SubType,
    Times,
    Recharge
] = Src_Data) ->
    Data = <<
        BaseType:16,
        SubType:16,
        Times:8,
        Recharge:32
    >>,
    {ok, pt:encode(33220, Data, Src_Data)};

write (33221,[
    Res,
    BaseType,
    SubType,
    Times,
    Sort,
    Mult
] = Src_Data) ->
    Data = <<
        Res:32,
        BaseType:16,
        SubType:16,
        Times:8,
        Sort:8,
        Mult:16
    >>,
    {ok, pt:encode(33221, Data, Src_Data)};

write (33222,[
    BaseType,
    SubType,
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_14(List_Item) || List_Item <- List
    ], 

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

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

write (33223,[
    SubType,
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_15(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(33223, Data, Src_Data)};

write (33224,[
    SubType,
    Grade,
    Member,
    Price
] = Src_Data) ->
    Data = <<
        SubType:16,
        Grade:8,
        Member:16,
        Price:16
    >>,
    {ok, pt:encode(33224, Data, Src_Data)};

write (33225,[
    SubType,
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_16(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(33225, Data, Src_Data)};

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

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

write (33228,[
    SubType,
    Round,
    CurIndex,
    NormalCount,
    GoldCount,
    NormalDayCount,
    GoldDayCount,
    DesignCount,
    UseDesignCount,
    DayRechargeNum,
    LuckyPools,
    DiceList,
    CircleRewards
] = Src_Data) ->
    BinList_LuckyPools = [
        item_to_bin_18(LuckyPools_Item) || LuckyPools_Item <- LuckyPools
    ], 

    LuckyPools_Len = length(LuckyPools), 
    Bin_LuckyPools = list_to_binary(BinList_LuckyPools),

    BinList_DiceList = [
        item_to_bin_19(DiceList_Item) || DiceList_Item <- DiceList
    ], 

    DiceList_Len = length(DiceList), 
    Bin_DiceList = list_to_binary(BinList_DiceList),

    BinList_CircleRewards = [
        item_to_bin_21(CircleRewards_Item) || CircleRewards_Item <- CircleRewards
    ], 

    CircleRewards_Len = length(CircleRewards), 
    Bin_CircleRewards = list_to_binary(BinList_CircleRewards),

    Data = <<
        SubType:16,
        Round:8,
        CurIndex:8,
        NormalCount:8,
        GoldCount:8,
        NormalDayCount:8,
        GoldDayCount:8,
        DesignCount:8,
        UseDesignCount:8,
        DayRechargeNum:32,
        LuckyPools_Len:16, Bin_LuckyPools/binary,
        DiceList_Len:16, Bin_DiceList/binary,
        CircleRewards_Len:16, Bin_CircleRewards/binary
    >>,
    {ok, pt:encode(33228, Data, Src_Data)};

write (33229,[
    Errcode,
    SubType,
    PassDice,
    DiceList
] = Src_Data) ->
    BinList_DiceList = [
        item_to_bin_22(DiceList_Item) || DiceList_Item <- DiceList
    ], 

    DiceList_Len = length(DiceList), 
    Bin_DiceList = list_to_binary(BinList_DiceList),

    Data = <<
        Errcode:32,
        SubType:16,
        PassDice:8,
        DiceList_Len:16, Bin_DiceList/binary
    >>,
    {ok, pt:encode(33229, Data, Src_Data)};

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

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

write (33232,[
    Errcode,
    SubType,
    Score,
    ConLv,
    DailyScore,
    IsPay,
    Show,
    ActInfo,
    RewardList
] = Src_Data) ->
    Bin_Show = pt:write_string(Show), 

    Bin_ActInfo = pt:write_string(ActInfo), 

    BinList_RewardList = [
        item_to_bin_24(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Errcode:32,
        SubType:16,
        Score:16,
        ConLv:16,
        DailyScore:16,
        IsPay:8,
        Bin_Show/binary,
        Bin_ActInfo/binary,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33232, Data, Src_Data)};

write (33233,[
    SubType,
    UpdateTime,
    TaskList
] = Src_Data) ->
    BinList_TaskList = [
        item_to_bin_25(TaskList_Item) || TaskList_Item <- TaskList
    ], 

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

    Data = <<
        SubType:16,
        UpdateTime:32,
        TaskList_Len:16, Bin_TaskList/binary
    >>,
    {ok, pt:encode(33233, Data, Src_Data)};

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

write (33235,[
    SubType,
    UpdateTasks
] = Src_Data) ->
    BinList_UpdateTasks = [
        item_to_bin_27(UpdateTasks_Item) || UpdateTasks_Item <- UpdateTasks
    ], 

    UpdateTasks_Len = length(UpdateTasks), 
    Bin_UpdateTasks = list_to_binary(BinList_UpdateTasks),

    Data = <<
        SubType:16,
        UpdateTasks_Len:16, Bin_UpdateTasks/binary
    >>,
    {ok, pt:encode(33235, Data, Src_Data)};

write (33236,[
    Result,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_28(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

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

write (33238,[
    Errcode,
    SubType,
    Score,
    ConLv,
    IsPay,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_29(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Errcode:32,
        SubType:16,
        Score:8,
        ConLv:8,
        IsPay:8,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33238, Data, Src_Data)};

write (33239,[
    Result,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_30(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

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

write (33241,[
    Result,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_31(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

write (33242,[
    Result,
    SubType,
    TaskList
] = Src_Data) ->
    BinList_TaskList = [
        item_to_bin_32(TaskList_Item) || TaskList_Item <- TaskList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        TaskList_Len:16, Bin_TaskList/binary
    >>,
    {ok, pt:encode(33242, Data, Src_Data)};

write (33243,[
    SubType,
    TurnType,
    RecordList
] = Src_Data) ->
    BinList_RecordList = [
        item_to_bin_33(RecordList_Item) || RecordList_Item <- RecordList
    ], 

    RecordList_Len = length(RecordList), 
    Bin_RecordList = list_to_binary(BinList_RecordList),

    Data = <<
        SubType:16,
        TurnType:8,
        RecordList_Len:16, Bin_RecordList/binary
    >>,
    {ok, pt:encode(33243, Data, Src_Data)};

write (33244,[
    SubType,
    CardList,
    RewardList
] = Src_Data) ->
    BinList_CardList = [
        item_to_bin_34(CardList_Item) || CardList_Item <- CardList
    ], 

    CardList_Len = length(CardList), 
    Bin_CardList = list_to_binary(BinList_CardList),

    BinList_RewardList = [
        item_to_bin_36(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

write (33245,[
    Res,
    SubType,
    Option,
    Score,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_37(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Res:32,
        SubType:16,
        Option:8,
        Score:32,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33245, Data, Src_Data)};

write (33246,[
    SubType,
    DrawList,
    Score,
    NextScore,
    RewardList
] = Src_Data) ->
    BinList_DrawList = [
        item_to_bin_39(DrawList_Item) || DrawList_Item <- DrawList
    ], 

    DrawList_Len = length(DrawList), 
    Bin_DrawList = list_to_binary(BinList_DrawList),

    BinList_RewardList = [
        item_to_bin_40(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        SubType:16,
        DrawList_Len:16, Bin_DrawList/binary,
        Score:32,
        NextScore:16,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33246, Data, Src_Data)};

write (33247,[
    Res,
    SubType,
    DrawList,
    Pos,
    Score,
    NextScore,
    RewardList
] = Src_Data) ->
    BinList_DrawList = [
        item_to_bin_42(DrawList_Item) || DrawList_Item <- DrawList
    ], 

    DrawList_Len = length(DrawList), 
    Bin_DrawList = list_to_binary(BinList_DrawList),

    BinList_RewardList = [
        item_to_bin_43(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Res:32,
        SubType:16,
        DrawList_Len:16, Bin_DrawList/binary,
        Pos:8,
        Score:32,
        NextScore:16,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33247, Data, Src_Data)};

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

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

write (33250,[
    SubType,
    Id,
    DrawTimes,
    CanReceive,
    RechargeNum,
    BoxHasReceive
] = Src_Data) ->
    Data = <<
        SubType:16,
        Id:16,
        DrawTimes:8,
        CanReceive:8,
        RechargeNum:32,
        BoxHasReceive:8
    >>,
    {ok, pt:encode(33250, Data, Src_Data)};

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

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

write (33253,[
    SubType,
    LogList
] = Src_Data) ->
    BinList_LogList = [
        item_to_bin_45(LogList_Item) || LogList_Item <- LogList
    ], 

    LogList_Len = length(LogList), 
    Bin_LogList = list_to_binary(BinList_LogList),

    Data = <<
        SubType:16,
        LogList_Len:16, Bin_LogList/binary
    >>,
    {ok, pt:encode(33253, Data, Src_Data)};

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

write (33255,[
    Res,
    SubType,
    CardList,
    RewardPool
] = Src_Data) ->
    BinList_CardList = [
        item_to_bin_46(CardList_Item) || CardList_Item <- CardList
    ], 

    CardList_Len = length(CardList), 
    Bin_CardList = list_to_binary(BinList_CardList),

    BinList_RewardPool = [
        item_to_bin_47(RewardPool_Item) || RewardPool_Item <- RewardPool
    ], 

    RewardPool_Len = length(RewardPool), 
    Bin_RewardPool = list_to_binary(BinList_RewardPool),

    Data = <<
        Res:32,
        SubType:16,
        CardList_Len:16, Bin_CardList/binary,
        RewardPool_Len:16, Bin_RewardPool/binary
    >>,
    {ok, pt:encode(33255, Data, Src_Data)};

write (33256,[
    Errcode,
    SubType,
    Pos,
    Index,
    GoodsType,
    GoodsId,
    Num
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        Pos:8,
        Index:16,
        GoodsType:32,
        GoodsId:32,
        Num:32
    >>,
    {ok, pt:encode(33256, Data, Src_Data)};

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

write (33258,[
    Errcode,
    SubType,
    GoodsLog
] = Src_Data) ->
    BinList_GoodsLog = [
        item_to_bin_48(GoodsLog_Item) || GoodsLog_Item <- GoodsLog
    ], 

    GoodsLog_Len = length(GoodsLog), 
    Bin_GoodsLog = list_to_binary(BinList_GoodsLog),

    Data = <<
        Errcode:32,
        SubType:16,
        GoodsLog_Len:16, Bin_GoodsLog/binary
    >>,
    {ok, pt:encode(33258, Data, Src_Data)};

write (33259,[
    Subtype,
    GoodsType,
    GoodsId,
    GoodsNum,
    RoleName
] = Src_Data) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        Subtype:16,
        GoodsType:32,
        GoodsId:32,
        GoodsNum:32,
        Bin_RoleName/binary
    >>,
    {ok, pt:encode(33259, Data, Src_Data)};

write (33260,[
    SubType,
    GoodsPhase
] = Src_Data) ->
    BinList_GoodsPhase = [
        item_to_bin_49(GoodsPhase_Item) || GoodsPhase_Item <- GoodsPhase
    ], 

    GoodsPhase_Len = length(GoodsPhase), 
    Bin_GoodsPhase = list_to_binary(BinList_GoodsPhase),

    Data = <<
        SubType:16,
        GoodsPhase_Len:16, Bin_GoodsPhase/binary
    >>,
    {ok, pt:encode(33260, Data, Src_Data)};

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

write (33262,[
    Res,
    Option,
    SubType,
    Phase,
    GoodsList
] = Src_Data) ->
    BinList_GoodsList = [
        item_to_bin_51(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

    Data = <<
        Res:32,
        Option:8,
        SubType:16,
        Phase:8,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    {ok, pt:encode(33262, Data, Src_Data)};

write (33263,[
    Result,
    SubType,
    Score,
    Progress,
    Recharge,
    TaskList
] = Src_Data) ->
    BinList_TaskList = [
        item_to_bin_52(TaskList_Item) || TaskList_Item <- TaskList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        Score:16,
        Progress:16,
        Recharge:16,
        TaskList_Len:16, Bin_TaskList/binary
    >>,
    {ok, pt:encode(33263, Data, Src_Data)};

write (33264,[
    Result,
    SubType,
    AddProgress,
    Score,
    Progress,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_53(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        AddProgress:8,
        Score:16,
        Progress:16,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33264, Data, Src_Data)};

write (33265,[
    Result,
    SubType,
    ModList,
    RewardList
] = Src_Data) ->
    BinList_ModList = [
        item_to_bin_54(ModList_Item) || ModList_Item <- ModList
    ], 

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

    BinList_RewardList = [
        item_to_bin_55(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        ModList_Len:16, Bin_ModList/binary,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33265, Data, Src_Data)};

write (33266,[
    Result,
    SubType,
    Score,
    FreeTimes,
    Cost,
    RewardList
] = Src_Data) ->
    Bin_Cost = pt:write_string(Cost), 

    BinList_RewardList = [
        item_to_bin_56(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        Score:16,
        FreeTimes:8,
        Bin_Cost/binary,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33266, Data, Src_Data)};

write (33267,[
    Result,
    SubType,
    FreeTimes,
    Cost,
    RewardList
] = Src_Data) ->
    Bin_Cost = pt:write_string(Cost), 

    BinList_RewardList = [
        item_to_bin_57(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        FreeTimes:8,
        Bin_Cost/binary,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33267, Data, Src_Data)};

write (33268,[
    Result,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_58(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

write (33269,[
    Result,
    SubType,
    Score,
    Cost,
    OtherCost,
    RewardList
] = Src_Data) ->
    Bin_Cost = pt:write_string(Cost), 

    Bin_OtherCost = pt:write_string(OtherCost), 

    BinList_RewardList = [
        item_to_bin_59(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Result:32,
        SubType:16,
        Score:16,
        Bin_Cost/binary,
        Bin_OtherCost/binary,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33269, Data, Src_Data)};

write (33270,[
    Result,
    SubType,
    Score,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_60(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

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

write (33272,[
    SubType,
    OptionType,
    PictureId,
    CardList,
    StartTime,
    EndTime
] = Src_Data) ->
    BinList_CardList = [
        item_to_bin_61(CardList_Item) || CardList_Item <- CardList
    ], 

    CardList_Len = length(CardList), 
    Bin_CardList = list_to_binary(BinList_CardList),

    Data = <<
        SubType:16,
        OptionType:8,
        PictureId:8,
        CardList_Len:16, Bin_CardList/binary,
        StartTime:64,
        EndTime:64
    >>,
    {ok, pt:encode(33272, Data, Src_Data)};

write (33273,[
    SubType,
    CardList
] = Src_Data) ->
    BinList_CardList = [
        item_to_bin_62(CardList_Item) || CardList_Item <- CardList
    ], 

    CardList_Len = length(CardList), 
    Bin_CardList = list_to_binary(BinList_CardList),

    Data = <<
        SubType:16,
        CardList_Len:16, Bin_CardList/binary
    >>,
    {ok, pt:encode(33273, Data, Src_Data)};

write (33274,[
    SubType,
    Res,
    RewardList,
    Stage,
    PuzzleTimes
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_63(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        SubType:16,
        Res:32,
        RewardList_Len:16, Bin_RewardList/binary,
        Stage:8,
        PuzzleTimes:8
    >>,
    {ok, pt:encode(33274, Data, Src_Data)};

write (33275,[
    SubType,
    List
] = Src_Data) ->
    BinList_List = [
        item_to_bin_64(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(33275, Data, Src_Data)};

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

write (33277,[
    SubType,
    Res,
    Day,
    BuyTimes,
    AwardList
] = Src_Data) ->
    BinList_AwardList = [
        item_to_bin_66(AwardList_Item) || AwardList_Item <- AwardList
    ], 

    AwardList_Len = length(AwardList), 
    Bin_AwardList = list_to_binary(BinList_AwardList),

    Data = <<
        SubType:16,
        Res:32,
        Day:16,
        BuyTimes:16,
        AwardList_Len:16, Bin_AwardList/binary
    >>,
    {ok, pt:encode(33277, Data, Src_Data)};

write (33278,[
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_67(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(33278, Data, Src_Data)};

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

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

write (33281,[
    Res,
    SubType,
    Kind,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_68(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Res:32,
        SubType:16,
        Kind:8,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33281, Data, Src_Data)};

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

write (33283,[
    Result,
    ActType,
    SubType,
    Active,
    IsPay,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_69(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

    Data = <<
        Result:32,
        ActType:16,
        SubType:16,
        Active:16,
        IsPay:8,
        RewardList_Len:16, Bin_RewardList/binary
    >>,
    {ok, pt:encode(33283, Data, Src_Data)};

write (33284,[
    Result,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_70(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

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

write (33286,[
    Result,
    ActType,
    SubType,
    RewardList
] = Src_Data) ->
    BinList_RewardList = [
        item_to_bin_71(RewardList_Item) || RewardList_Item <- RewardList
    ], 

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

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

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

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

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

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

write (33292,[
    Errcode,
    SubType,
    Type,
    Id,
    RoleId
] = Src_Data) ->
    Data = <<
        Errcode:32,
        SubType:16,
        Type:8,
        Id:32,
        RoleId:64
    >>,
    {ok, pt:encode(33292, Data, Src_Data)};

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

write (33294,[
    SubType,
    PrintList
] = Src_Data) ->
    BinList_PrintList = [
        item_to_bin_72(PrintList_Item) || PrintList_Item <- PrintList
    ], 

    PrintList_Len = length(PrintList), 
    Bin_PrintList = list_to_binary(BinList_PrintList),

    Data = <<
        SubType:16,
        PrintList_Len:16, Bin_PrintList/binary
    >>,
    {ok, pt:encode(33294, Data, Src_Data)};

write (33295,[
    Errcode,
    SubType,
    GoodsList
] = Src_Data) ->
    BinList_GoodsList = [
        item_to_bin_73(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

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

write (33296,[
    SubType,
    Type,
    PrintList
] = Src_Data) ->
    BinList_PrintList = [
        item_to_bin_74(PrintList_Item) || PrintList_Item <- PrintList
    ], 

    PrintList_Len = length(PrintList), 
    Bin_PrintList = list_to_binary(BinList_PrintList),

    Data = <<
        SubType:16,
        Type:8,
        PrintList_Len:16, Bin_PrintList/binary
    >>,
    {ok, pt:encode(33296, Data, Src_Data)};

write (33297,[
    SubType,
    RoldList
] = Src_Data) ->
    BinList_RoldList = [
        item_to_bin_75(RoldList_Item) || RoldList_Item <- RoldList
    ], 

    RoldList_Len = length(RoldList), 
    Bin_RoldList = list_to_binary(BinList_RoldList),

    Data = <<
        SubType:16,
        RoldList_Len:16, Bin_RoldList/binary
    >>,
    {ok, pt:encode(33297, Data, Src_Data)};

write (33298,[
    SubType,
    RoleName,
    Id
] = Src_Data) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        SubType:16,
        Bin_RoleName/binary,
        Id:32
    >>,
    {ok, pt:encode(33298, Data, Src_Data)};

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

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


item_to_bin_0 ({
    TaskId,
    TaskStatus,
    TaskProgress
}) ->
    Data = <<
        TaskId:16,
        TaskStatus:8,
        TaskProgress:16
    >>,
    Data.
item_to_bin_1 ({
    GoalId,
    TargetType,
    SelFirstVal,
    SelSecondVal,
    NeedFirstVal,
    NeedSecondVal,
    RewardList,
    RewardDescribe,
    State
}) ->
    Bin_RewardList = pt:write_string(RewardList), 

    Bin_RewardDescribe = pt:write_string(RewardDescribe), 

    Data = <<
        GoalId:16,
        TargetType:16,
        SelFirstVal:32,
        SelSecondVal:32,
        NeedFirstVal:32,
        NeedSecondVal:32,
        Bin_RewardList/binary,
        Bin_RewardDescribe/binary,
        State:8
    >>,
    Data.
item_to_bin_2 ({
    GoalId,
    NeedScore,
    RewardList,
    RewardDescribe,
    State
}) ->
    Bin_RewardList = pt:write_string(RewardList), 

    Bin_RewardDescribe = pt:write_string(RewardDescribe), 

    Data = <<
        GoalId:16,
        NeedScore:32,
        Bin_RewardList/binary,
        Bin_RewardDescribe/binary,
        State:8
    >>,
    Data.
item_to_bin_3 ({
    RewardList,
    Time
}) ->
    Bin_RewardList = pt:write_object_list(RewardList), 

    Data = <<
        Bin_RewardList/binary,
        Time:32
    >>,
    Data.
item_to_bin_4 ({
    Name,
    RewardList,
    Time
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_RewardList = pt:write_object_list(RewardList), 

    Data = <<
        Bin_Name/binary,
        Bin_RewardList/binary,
        Time:32
    >>,
    Data.
item_to_bin_5 ({
    GradeId,
    Time
}) ->
    Data = <<
        GradeId:32,
        Time:32
    >>,
    Data.
item_to_bin_6 ({
    ServerId,
    Platform,
    ServerNum,
    Name,
    GradeId,
    Time
}) ->
    Bin_Platform = pt:write_string(Platform), 

    Bin_Name = pt:write_string(Name), 

    Data = <<
        ServerId:32,
        Bin_Platform/binary,
        ServerNum:32,
        Bin_Name/binary,
        GradeId:32,
        Time:32
    >>,
    Data.
item_to_bin_7 ({
    GradeId,
    HasDraw
}) ->
    Data = <<
        GradeId:16,
        HasDraw:8
    >>,
    Data.
item_to_bin_8 (
    Times
) ->
    Data = <<
        Times:16
    >>,
    Data.
item_to_bin_9 (
    GradeId
) ->
    Data = <<
        GradeId:16
    >>,
    Data.
item_to_bin_10 ({
    GradeId,
    HasDraw
}) ->
    Data = <<
        GradeId:16,
        HasDraw:8
    >>,
    Data.
item_to_bin_11 ({
    BaseType,
    SubType,
    MaxTimes,
    Confs,
    Rebacks
}) ->
    BinList_Confs = [
        item_to_bin_12(Confs_Item) || Confs_Item <- Confs
    ], 

    Confs_Len = length(Confs), 
    Bin_Confs = list_to_binary(BinList_Confs),

    BinList_Rebacks = [
        item_to_bin_13(Rebacks_Item) || Rebacks_Item <- Rebacks
    ], 

    Rebacks_Len = length(Rebacks), 
    Bin_Rebacks = list_to_binary(BinList_Rebacks),

    Data = <<
        BaseType:16,
        SubType:16,
        MaxTimes:8,
        Confs_Len:16, Bin_Confs/binary,
        Rebacks_Len:16, Bin_Rebacks/binary
    >>,
    Data.
item_to_bin_12 ({
    Times,
    Cost,
    Recharge
}) ->
    Data = <<
        Times:8,
        Cost:16,
        Recharge:16
    >>,
    Data.
item_to_bin_13 ({
    Sort,
    Mult
}) ->
    Data = <<
        Sort:8,
        Mult:16
    >>,
    Data.
item_to_bin_14 ({
    RoleId,
    RoleName,
    Time,
    Times,
    Sort,
    Mult
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        RoleId:64,
        Bin_RoleName/binary,
        Time:32,
        Times:8,
        Sort:8,
        Mult:16
    >>,
    Data.
item_to_bin_15 ({
    Grade,
    Member,
    Price
}) ->
    Data = <<
        Grade:8,
        Member:16,
        Price:16
    >>,
    Data.
item_to_bin_16 ({
    StartDay,
    EndDay,
    Total,
    TotalState,
    TaskList
}) ->
    BinList_TaskList = [
        item_to_bin_17(TaskList_Item) || TaskList_Item <- TaskList
    ], 

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

    Data = <<
        StartDay:16,
        EndDay:16,
        Total:16,
        TotalState:8,
        TaskList_Len:16, Bin_TaskList/binary
    >>,
    Data.
item_to_bin_17 ({
    TaskType,
    Id,
    ServerPro,
    PersonPro,
    FinishPro,
    State
}) ->
    Data = <<
        TaskType:16,
        Id:16,
        ServerPro:32,
        PersonPro:32,
        FinishPro:8,
        State:8
    >>,
    Data.
item_to_bin_18 ({
    Index,
    Status
}) ->
    Data = <<
        Index:8,
        Status:8
    >>,
    Data.
item_to_bin_19 ({
    Index,
    Rewards,
    LuckyIndex
}) ->
    BinList_Rewards = [
        item_to_bin_20(Rewards_Item) || Rewards_Item <- Rewards
    ], 

    Rewards_Len = length(Rewards), 
    Bin_Rewards = list_to_binary(BinList_Rewards),

    Data = <<
        Index:8,
        Rewards_Len:16, Bin_Rewards/binary,
        LuckyIndex:8
    >>,
    Data.
item_to_bin_20 ({
    GoodsKind,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsKind:8,
        GoodsId:32,
        GoodsNum:32
    >>,
    Data.
item_to_bin_21 ({
    Circle,
    Status
}) ->
    Data = <<
        Circle:8,
        Status:8
    >>,
    Data.
item_to_bin_22 ({
    Index,
    Rewards,
    LuckyIndex
}) ->
    BinList_Rewards = [
        item_to_bin_23(Rewards_Item) || Rewards_Item <- Rewards
    ], 

    Rewards_Len = length(Rewards), 
    Bin_Rewards = list_to_binary(BinList_Rewards),

    Data = <<
        Index:8,
        Rewards_Len:16, Bin_Rewards/binary,
        LuckyIndex:8
    >>,
    Data.
item_to_bin_23 ({
    GoodsKind,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsKind:8,
        GoodsId:32,
        GoodsNum:32
    >>,
    Data.
item_to_bin_24 ({
    Lv,
    NormalStatus,
    ExtraStatus
}) ->
    Data = <<
        Lv:16,
        NormalStatus:8,
        ExtraStatus:8
    >>,
    Data.
item_to_bin_25 ({
    Type,
    Tasks
}) ->
    BinList_Tasks = [
        item_to_bin_26(Tasks_Item) || Tasks_Item <- Tasks
    ], 

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

    Data = <<
        Type:8,
        Tasks_Len:16, Bin_Tasks/binary
    >>,
    Data.
item_to_bin_26 ({
    TaskId,
    Val,
    Status
}) ->
    Data = <<
        TaskId:16,
        Val:16,
        Status:8
    >>,
    Data.
item_to_bin_27 ({
    TaskType,
    TaskId,
    Val,
    Status
}) ->
    Data = <<
        TaskType:8,
        TaskId:16,
        Val:16,
        Status:8
    >>,
    Data.
item_to_bin_28 ({
    Lv,
    RewardOpty
}) ->
    Data = <<
        Lv:16,
        RewardOpty:8
    >>,
    Data.
item_to_bin_29 ({
    Lv,
    NormalStatus,
    ExtraStatus
}) ->
    Data = <<
        Lv:16,
        NormalStatus:8,
        ExtraStatus:8
    >>,
    Data.
item_to_bin_30 ({
    Lv,
    RewardOpty
}) ->
    Data = <<
        Lv:8,
        RewardOpty:8
    >>,
    Data.
item_to_bin_31 ({
    Lv,
    NormalReward,
    TrumpReward,
    IsNode
}) ->
    Bin_NormalReward = pt:write_string(NormalReward), 

    Bin_TrumpReward = pt:write_string(TrumpReward), 

    Data = <<
        Lv:8,
        Bin_NormalReward/binary,
        Bin_TrumpReward/binary,
        IsNode:8
    >>,
    Data.
item_to_bin_32 ({
    TaskId,
    Times
}) ->
    Data = <<
        TaskId:8,
        Times:8
    >>,
    Data.
item_to_bin_33 ({
    RoleId,
    RoleName,
    GoodsId,
    GoodsNum
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        RoleId:64,
        Bin_RoleName/binary,
        GoodsId:64,
        GoodsNum:32
    >>,
    Data.
item_to_bin_34 ({
    Pos,
    GoodsList
}) ->
    BinList_GoodsList = [
        item_to_bin_35(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

    Data = <<
        Pos:8,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    Data.
item_to_bin_35 ({
    GoodsTypeId,
    Num
}) ->
    Data = <<
        GoodsTypeId:32,
        Num:16
    >>,
    Data.
item_to_bin_36 ({
    GoodsTypeId,
    Num
}) ->
    Data = <<
        GoodsTypeId:32,
        Num:16
    >>,
    Data.
item_to_bin_37 ({
    Pos,
    GoodsList
}) ->
    BinList_GoodsList = [
        item_to_bin_38(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

    Data = <<
        Pos:8,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    Data.
item_to_bin_38 ({
    GoodsTypeId,
    Num
}) ->
    Data = <<
        GoodsTypeId:32,
        Num:16
    >>,
    Data.
item_to_bin_39 (
    DrawPos
) ->
    Data = <<
        DrawPos:8
    >>,
    Data.
item_to_bin_40 ({
    Pos,
    GoodsList
}) ->
    BinList_GoodsList = [
        item_to_bin_41(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

    Data = <<
        Pos:8,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    Data.
item_to_bin_41 ({
    GoodsTypeId,
    Num
}) ->
    Data = <<
        GoodsTypeId:32,
        Num:16
    >>,
    Data.
item_to_bin_42 (
    DrawPos
) ->
    Data = <<
        DrawPos:8
    >>,
    Data.
item_to_bin_43 ({
    Pos,
    GoodsList
}) ->
    BinList_GoodsList = [
        item_to_bin_44(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

    Data = <<
        Pos:8,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    Data.
item_to_bin_44 ({
    GoodsTypeId,
    Num
}) ->
    Data = <<
        GoodsTypeId:32,
        Num:16
    >>,
    Data.
item_to_bin_45 ({
    RoleId,
    RoleName,
    Id,
    GradeId,
    Money,
    Time
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        RoleId:64,
        Bin_RoleName/binary,
        Id:16,
        GradeId:8,
        Money:16,
        Time:32
    >>,
    Data.
item_to_bin_46 ({
    Pos,
    Status
}) ->
    Data = <<
        Pos:8,
        Status:8
    >>,
    Data.
item_to_bin_47 ({
    Index,
    GoodsType,
    GoodsId,
    Num,
    Status
}) ->
    Data = <<
        Index:16,
        GoodsType:32,
        GoodsId:32,
        Num:32,
        Status:8
    >>,
    Data.
item_to_bin_48 ({
    GoodsType,
    GoodsId,
    GoodsNum,
    RoleName
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        GoodsType:32,
        GoodsId:32,
        GoodsNum:32,
        Bin_RoleName/binary
    >>,
    Data.
item_to_bin_49 ({
    Phase,
    OpenRewardStatus,
    GoodsList
}) ->
    BinList_GoodsList = [
        item_to_bin_50(GoodsList_Item) || GoodsList_Item <- GoodsList
    ], 

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

    Data = <<
        Phase:8,
        OpenRewardStatus:8,
        GoodsList_Len:16, Bin_GoodsList/binary
    >>,
    Data.
item_to_bin_50 ({
    Pos,
    GradeId,
    GoodsType,
    GoodsId,
    GoodsNum,
    ExchangeNum,
    LimitNum,
    CostGoodsNum
}) ->
    Data = <<
        Pos:8,
        GradeId:16,
        GoodsType:16,
        GoodsId:32,
        GoodsNum:32,
        ExchangeNum:32,
        LimitNum:32,
        CostGoodsNum:32
    >>,
    Data.
item_to_bin_51 ({
    GoodsType,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsType:16,
        GoodsId:32,
        GoodsNum:32
    >>,
    Data.
item_to_bin_52 ({
    ModId,
    SubId,
    Times
}) ->
    Data = <<
        ModId:32,
        SubId:32,
        Times:16
    >>,
    Data.
item_to_bin_53 ({
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_54 ({
    ModId,
    SubId,
    Name,
    OnePoints,
    MaxPoints,
    OrderId,
    JumpId
}) ->
    Bin_Name = pt:write_string(Name), 

    Bin_JumpId = pt:write_string(JumpId), 

    Data = <<
        ModId:32,
        SubId:32,
        Bin_Name/binary,
        OnePoints:32,
        MaxPoints:32,
        OrderId:16,
        Bin_JumpId/binary
    >>,
    Data.
item_to_bin_55 ({
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_56 ({
    Grade,
    Type,
    MinLucky,
    MaxLucky,
    Reward
}) ->
    Bin_Reward = pt:write_string(Reward), 

    Data = <<
        Grade:16,
        Type:8,
        MinLucky:16,
        MaxLucky:16,
        Bin_Reward/binary
    >>,
    Data.
item_to_bin_57 ({
    GridNum,
    IsLucky,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GridNum:8,
        IsLucky:8,
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_58 ({
    GridNum,
    Status,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GridNum:8,
        Status:8,
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_59 ({
    Type,
    Grade,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        Type:8,
        Grade:16,
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_60 ({
    Type,
    Grade,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        Type:8,
        Grade:16,
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_61 ({
    X,
    Y,
    Num
}) ->
    Data = <<
        X:8,
        Y:8,
        Num:8
    >>,
    Data.
item_to_bin_62 ({
    X,
    Y,
    Num
}) ->
    Data = <<
        X:8,
        Y:8,
        Num:8
    >>,
    Data.
item_to_bin_63 ({
    GoodsTypeId,
    GoodsId,
    Num
}) ->
    Data = <<
        GoodsTypeId:8,
        GoodsId:32,
        Num:8
    >>,
    Data.
item_to_bin_64 ({
    Day,
    BuyTimes,
    TaskList
}) ->
    BinList_TaskList = [
        item_to_bin_65(TaskList_Item) || TaskList_Item <- TaskList
    ], 

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

    Data = <<
        Day:16,
        BuyTimes:16,
        TaskList_Len:16, Bin_TaskList/binary
    >>,
    Data.
item_to_bin_65 ({
    TaskType,
    Id,
    ProNum,
    State
}) ->
    Data = <<
        TaskType:16,
        Id:16,
        ProNum:32,
        State:8
    >>,
    Data.
item_to_bin_66 ({
    GoodsKind,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        GoodsKind:8,
        GoodsId:32,
        GoodsNum:16
    >>,
    Data.
item_to_bin_67 ({
    GoodsTypeId,
    GoodsId,
    Num
}) ->
    Data = <<
        GoodsTypeId:8,
        GoodsId:32,
        Num:8
    >>,
    Data.
item_to_bin_68 ({
    Type,
    GoodsId,
    GoodsNum
}) ->
    Data = <<
        Type:8,
        GoodsId:32,
        GoodsNum:8
    >>,
    Data.
item_to_bin_69 ({
    Grade,
    Need,
    NormalStatus,
    ExtraStatus
}) ->
    Data = <<
        Grade:16,
        Need:16,
        NormalStatus:8,
        ExtraStatus:8
    >>,
    Data.
item_to_bin_70 ({
    Grade,
    RewardOpty
}) ->
    Data = <<
        Grade:8,
        RewardOpty:8
    >>,
    Data.
item_to_bin_71 ({
    Grade,
    Need,
    NormalReward,
    TrumpReward,
    IsNode
}) ->
    Bin_NormalReward = pt:write_string(NormalReward), 

    Bin_TrumpReward = pt:write_string(TrumpReward), 

    Data = <<
        Grade:8,
        Need:16,
        Bin_NormalReward/binary,
        Bin_TrumpReward/binary,
        IsNode:8
    >>,
    Data.
item_to_bin_72 (
    Id
) ->
    Data = <<
        Id:32
    >>,
    Data.
item_to_bin_73 ({
    GoodsId,
    Num
}) ->
    Data = <<
        GoodsId:32,
        Num:16
    >>,
    Data.
item_to_bin_74 ({
    Id,
    State
}) ->
    Data = <<
        Id:32,
        State:8
    >>,
    Data.
item_to_bin_75 ({
    RoleName,
    Id
}) ->
    Bin_RoleName = pt:write_string(RoleName), 

    Data = <<
        Bin_RoleName/binary,
        Id:32
    >>,
    Data.
