using UnityEngine;
using System;
using System.Collections;
using System.Linq;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
///
///
///
public class ActiveProxy : ProxyBase
{
#region ` constructor `
public ActiveProxy() => this.opeCode = OpeCode.ope_active;
#endregion
#region 七日签到奖励
///
/// [6502] 七日签到福利 - 领取奖励
///
/// 第x天(1~7)
/// 成功回调函数
public void Day7_DrawReward(int day, Action callback)
{
Post(CmdCode.cmd_active_day7_drawreward, new object[] { day },
resp =>
{
var p = UserProxy.Instance.player;
p.baseInfo.gold = Convert.ToInt32(resp.result["gold"].ToString());
p.baseInfo.cash = Convert.ToInt32(resp.result["cash"].ToString());
p.baseInfo.tili = Convert.ToInt32(resp.result["tili"].ToString());
p.collectHero.InitData((JObject)resp.result["hero"],p); // 英雄
p.PrivateState.day7_drawed.Add(day); // 同步领取记录
callback?.Invoke(sm_activity_day7.GetMoById(day).reward);
});
}
#endregion
///
/// [6503] 查询开服时间戳
///
/// 成功回调函数
public void GetZonePublicTs(Action callback)
{
Post(CmdCode.cmd_active_getZonePublicTs, new object[] { }, resp => callback?.Invoke(new DateTime().FromUnixStamp((uint)resp.result)));
}
#region ' 废弃 '
///
/// [6509] 抽奖(已经变为开箱子功能)
///
/// 道具的typeid
/// 卡槽id(0,1,2,3) ----这个变为数量
/// <>cash是免冷却开宝箱所需要费的钻石数量 <>
/// 成功回调函数
[Obsolete("2020.8.17")]
public void Lottery(int type, int slotid, int cash = 0, Action callback = null, Action