From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/XRequestDocument.cs | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XRequestDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XRequestDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XRequestDocument.cs b/Client/Assets/Scripts/XMainClient/XRequestDocument.cs new file mode 100644 index 00000000..019d488d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XRequestDocument.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XRequestDocument : XDocComponent + { + public List List + { + get + { + return this._list; + } + } + + public override uint ID + { + get + { + return XRequestDocument.uuID; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("RequestDocument"); + + private List _list = new List(); + + public int MainInterfaceNum = 0; + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public void QueryRequestList() + { + RpcC2G_GetGuildCampPartyExchangeInfo rpc = new RpcC2G_GetGuildCampPartyExchangeInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnRequestListGet(List list) + { + this._list.Clear(); + for (int i = 0; i < list.Count; i++) + { + this._list.Add(this.Copy(list[i])); + } + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(true); + } + } + + public void RemoveList(bool isAll, ulong uid) + { + if (isAll) + { + this._list.Clear(); + } + else + { + for (int i = 0; i < this._list.Count; i++) + { + bool flag = this._list[i].role_id == uid; + if (flag) + { + this._list.RemoveAt(i); + break; + } + } + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.Refresh(true); + } + } + + public PartyExchangeItemInfo Copy(PartyExchangeItemInfo info) + { + return new PartyExchangeItemInfo + { + level = info.level, + name = info.name, + profession_id = info.profession_id, + time = info.time, + role_id = info.role_id + }; + } + + public void ClearList() + { + RpcC2G_ReplyPartyExchangeItemOpt rpcC2G_ReplyPartyExchangeItemOpt = new RpcC2G_ReplyPartyExchangeItemOpt(); + rpcC2G_ReplyPartyExchangeItemOpt.oArg.operate_type = 2u; + XSingleton.singleton.Send(rpcC2G_ReplyPartyExchangeItemOpt); + } + + public void QueryAcceptExchange(ulong uid) + { + RpcC2G_ReplyPartyExchangeItemOpt rpcC2G_ReplyPartyExchangeItemOpt = new RpcC2G_ReplyPartyExchangeItemOpt(); + rpcC2G_ReplyPartyExchangeItemOpt.oArg.lauch_role_id = uid; + rpcC2G_ReplyPartyExchangeItemOpt.oArg.operate_type = 3u; + XSingleton.singleton.Send(rpcC2G_ReplyPartyExchangeItemOpt); + } + + public void QueryRefuseExchange(ulong uid) + { + RpcC2G_ReplyPartyExchangeItemOpt rpcC2G_ReplyPartyExchangeItemOpt = new RpcC2G_ReplyPartyExchangeItemOpt(); + rpcC2G_ReplyPartyExchangeItemOpt.oArg.lauch_role_id = uid; + rpcC2G_ReplyPartyExchangeItemOpt.oArg.operate_type = 1u; + XSingleton.singleton.Send(rpcC2G_ReplyPartyExchangeItemOpt); + } + + public void SetMainInterfaceNum(int num) + { + this.MainInterfaceNum = num; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_Exchange, true); + } + } +} -- cgit v1.1-26-g67d0