From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Guild/XGuildRankDocument.cs | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs new file mode 100644 index 00000000..ba8cd65b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs @@ -0,0 +1,102 @@ +using System; +using KKSG; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRankDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildRankDocument.uuID; + } + } + + public uint EndTime + { + get + { + return this.m_EndTime; + } + } + + public uint KeepTime + { + get + { + return this.m_KeepTime; + } + } + + public uint RankIndex + { + get + { + return this.m_rankIndex; + } + } + + public int LastTime + { + get + { + return this.m_lastTime; + } + set + { + this.m_lastTime = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildRankDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildRankRewardTable m_RankRewardTable = new GuildRankRewardTable(); + + private uint m_EndTime; + + private uint m_KeepTime; + + private uint m_rankIndex; + + public int m_lastTime = 0; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildRankDocument.AsyncLoader.AddTask("Table/GuildRankReward", XGuildRankDocument.m_RankRewardTable, false); + XGuildRankDocument.AsyncLoader.Execute(callback); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendGuildRankInfo(); + } + } + + public void SendGuildRankInfo() + { + RpcC2M_ReqGuildRankInfo rpc = new RpcC2M_ReqGuildRankInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildRankInfo(ReqGuildRankInfoRes res) + { + this.m_EndTime = res.endTime; + this.m_KeepTime = res.keepTime; + this.m_rankIndex = res.rank; + this.LastTime = (int)(res.endTime - res.nowTime); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(); + } + } + } +} -- cgit v1.1-26-g67d0