-define(SQL_UNITE_ACT_GET, <<"SELECT `act`,`stime`,`etime`,`process`,`click`,`need_add`,`add_per`,`buffs` FROM `unite_buff_mgr`">>).
-define(SQL_UNITE_ACT_INSERT,<<"REPLACE INTO `unite_buff_mgr` (`act`,`stime`,`etime`,`process`,`click`,`need_add`,`add_per`,`buffs`) VALUES (~p,~p,~p,~p,~p,~p,~p,'~ts')">>).
-define(SQL_UNITE_ACT_UPDATE,<<"UPDATE `unite_buff_mgr` SET `process` = ~p, `buffs` = '~ts' WHERE `act` = ~p">>).

-define(SQL_UNITE_ACT_BUFFS_GET, <<"SELECT `buffs` FROM `unite_buff_mgr` WHERE `act`=~p">>).

-define(CALC_ZONE, 15). %%N分钟一个区
-define(MAX_ZONE,  3).  %%最大区

%%材料提交个人数据
-record(act_unite_buff, {
	process = 0,         %%个人进度
	role_awards  = [],   %%个人进度领取
	server_awards = [],	 %%全服个人领取
	buffs = []
}).

-record(unite_buff, {
	dot = 0,
	bid = 0,
	stime = 0,
	etime = 0,
	used = []
}).

-record(act_pro_mgr, {
	act = 0,
	stime = 0,
	etime = 0,
	process = 0,

	click = 0,  %%已累计
	need_add = 0, %%本时段需累计
	add_per = 0,  %%每次累加

	buffs = []
}).

-record(time_zone, {
	zone = 0,
	roles = []
}).

-record(zone_log, {
	rid = 0,   %%玩家ID
	live = 0,  %%活跃度
	add = 0
}).

%%进度奖励
-record(base_unite_buff_awards,{
	suit = 0,  %%套件
	dot  = 0,  %%点位
	need = 0,  %%进度需求
	type = 0,  %%奖励类型1buff2道具
	awards = [] %%具体奖励
}).


%%进度控制
-record(base_unite_buff_ctrl,{
	suit = 0, %%套件
	check_time = 0, %%检测时间点
	check_cum  = 0, %%自增上限
	check_max  = 0, %%自增进度上限
	ratio = 0, %%全服系数
	awards = [] %%奖励
}).

-record(base_unite_buff, {
	id = 0,
	desc = "",
	kind = 0, %%buff类型
	data = 0, %%值
	discount = 0, %%折扣
	type = 0, %%1即时生效 限定有效时间 2 当天24有效
	time = 0  %%有效时间
}).

-record(base_unite_buff_kind, {
	kind = 0,
	name = "",
	func = underfind
}).
