From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/XPlatformAbilityDocument.cs | 146 +++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XPlatformAbilityDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XPlatformAbilityDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XPlatformAbilityDocument.cs b/Client/Assets/Scripts/XMainClient/XPlatformAbilityDocument.cs new file mode 100644 index 00000000..4ec5dc80 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XPlatformAbilityDocument.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using KKSG; +using MiniJSON; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XPlatformAbilityDocument : XDocComponent + { + public override uint ID + { + get + { + return XPlatformAbilityDocument.uuID; + } + } + + public static XPlatformAbilityDocument Doc + { + get + { + return XDocuments.GetSpecificDocument(XPlatformAbilityDocument.uuID); + } + } + + public QQVipInfoClient QQVipInfo + { + get + { + return this.m_qqVipInfo; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("PlatformAbilityDocument"); + + private QQVipInfoClient m_qqVipInfo = null; + + public bool QQVipRedPoint = false; + + public void ClickRedPointNtf() + { + bool flag = !this.QQVipRedPoint; + if (!flag) + { + PtcC2G_CloseHintNtf ptcC2G_CloseHintNtf = new PtcC2G_CloseHintNtf(); + ptcC2G_CloseHintNtf.Data.systemid = (uint)XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_QQVIP); + XSingleton.singleton.Send(ptcC2G_CloseHintNtf); + } + } + + public void QueryQQVipInfo() + { + bool flag = XSingleton.singleton.Channel == XAuthorizationChannel.XAuthorization_QQ && XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_QQVIP); + if (flag) + { + RpcC2G_QueryQQVipInfo rpcC2G_QueryQQVipInfo = new RpcC2G_QueryQQVipInfo(); + rpcC2G_QueryQQVipInfo.oArg.token = XSingleton.singleton.TokenCache; + XSingleton.singleton.Send(rpcC2G_QueryQQVipInfo); + } + } + + public void OnQueryQQVipInfo(QueryQQVipInfoArg oArg, QueryQQVipInfoRes oRes) + { + bool flag = oRes == null; + if (!flag) + { + bool flag2 = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + bool flag3 = oRes.info == null; + if (!flag3) + { + this.m_qqVipInfo = oRes.info; + XSingleton.singleton.AddLog(string.Concat(new string[] + { + "[QQVipInfo] isVip:", + this.m_qqVipInfo.is_svip.ToString(), + ", isSVip:", + this.m_qqVipInfo.is_svip.ToString(), + ",is_bigger_one_month:", + this.m_qqVipInfo.is_bigger_one_month.ToString() + }), null, null, null, null, null, XDebugColor.XDebug_None); + bool flag4 = DlgBase.singleton.IsVisible() && DlgBase.singleton.CurrentTab == OptionsTab.InfoTab; + if (flag4) + { + DlgBase.singleton.ShowQQVipInfo(); + } + bool flag5 = DlgBase.singleton.IsVisible(); + if (flag5) + { + DlgBase.singleton.RefreshQQVipInfo(); + } + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + DlgBase.singleton.RefreshQQVip(); + } + } + } + } + } + + public void OpenQQVipRechargeH5() + { + string text = string.Format("{0}?sRoleId={1}&sPartition={2}&sPfkey={3}", new object[] + { + XSingleton.singleton.GetValue("QQVipRechargeUrl"), + XSingleton.singleton.XPlayerData.RoleID, + XSingleton.singleton.ServerID, + "pfkey" + }); + XSingleton.singleton.AddLog("[OpenQQVipRechargeH5] url = " + text, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = new Dictionary(); + dictionary["url"] = text; + dictionary["screendir"] = "LANDSCAPE"; + XSingleton.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary)); + } + + public void OnQQVipPayCallback(string msg) + { + XSingleton.singleton.AddLog("Pay [OnQQVipPayCallback] msg:" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + bool flag = msg == "Success"; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("QQVIP_RECHARGE_SUC"), "fece00"); + this.QueryQQVipInfo(); + } + else + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("QQVIP_RECHARGE_FAIL"), "fece00"); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} -- cgit v1.1-26-g67d0