%%%-------------------------------------------------------------------
%%% @author tyl
%%% @doc
%%%     源樱之礼(阶段抽奖) - 协议文件
%%% @end
%%% Created : 2021-03-10
%%%-------------------------------------------------------------------
-module(pp_sakura_gift).

-include("common.hrl").
-include("server.hrl").
-include("child.hrl").
-include("figure.hrl").
-include("def_module.hrl").
-include("predefine.hrl").
-include("errcode.hrl").

-export([handle/3]).

%% 基础信息
handle(33400, Player, [SubType]) ->
	sakura_gift:act_info(Player, SubType);

%% 抽奖
handle(33401, Player, [SubType, DrawType, IsAuto]) ->
	NewPlayer = sakura_gift:sakura_draw(Player, SubType, DrawType, IsAuto),
	{ok, NewPlayer};

%% 记录信息
handle(33402, Player, [SubType, LogType]) ->
	sakura_gift:send_draw_log(Player, SubType, LogType),
	ok;

%% 积分商城信息
handle(33403, Player, [SubType]) ->
	sakura_store:sakura_store_info(Player, SubType),
	ok;

%% 积分商城兑换
handle(33404, Player, [SubType, RewardId, ExchangeNum]) ->
	NewPlayer = sakura_store:exchange_store_goods(Player, SubType, RewardId, ExchangeNum),
	{ok, NewPlayer};

handle(_Cmd, _Player, _Msg) ->
	?ERR("sakura gift cmd err"),
	ok.