|
@@ -1,5 +1,6 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using ET;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -22,6 +23,9 @@ namespace GFGGame
|
|
|
public long startTime = 1668873600000;
|
|
|
public long endTime = 1672156799000;
|
|
|
|
|
|
+ //存储奖池免费时间,大于存储时间免费
|
|
|
+ public Dictionary<int, long> luckyBoxFreeTimeMillDic = new Dictionary<int, long>();
|
|
|
+
|
|
|
|
|
|
public int times = 0;
|
|
|
public int luckyBoxIndex;
|
|
@@ -65,6 +69,30 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void InitServerData(S2C_GetLuckyBoxInfo response)
|
|
|
+ {
|
|
|
+ luckyBoxFreeTimeMillDic.Clear();
|
|
|
+ int count = response.KsLuckyBoxId.Count;
|
|
|
+ for(var i = 0; i < count; i++)
|
|
|
+ {
|
|
|
+ luckyBoxFreeTimeMillDic[response.KsLuckyBoxId[i]] = response.VsFreeTime[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void UpdateFreeTime(int luckyBoxId, long freeTimeMill)
|
|
|
+ {
|
|
|
+ luckyBoxFreeTimeMillDic[luckyBoxId] = freeTimeMill;
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_FREE_TIME_CHANGED);
|
|
|
+ }
|
|
|
+
|
|
|
+ //返回奖池免费时间,如果是0,则不免费,大约0并且当前时间大于存储时间则免费
|
|
|
+ public long GetFreeTime(int luckyBoxId)
|
|
|
+ {
|
|
|
+ luckyBoxFreeTimeMillDic.TryGetValue(luckyBoxId, out var freeTime);
|
|
|
+ return freeTime;
|
|
|
+ }
|
|
|
+
|
|
|
public void InitData(int boxId)
|
|
|
{
|
|
|
LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|