From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XUtliPoolLib/PDatabase.cs | 486 ++++++++++++++++++++++++ 1 file changed, 486 insertions(+) create mode 100644 Client/Assets/Scripts/XUtliPoolLib/PDatabase.cs (limited to 'Client/Assets/Scripts/XUtliPoolLib/PDatabase.cs') diff --git a/Client/Assets/Scripts/XUtliPoolLib/PDatabase.cs b/Client/Assets/Scripts/XUtliPoolLib/PDatabase.cs new file mode 100644 index 00000000..bb88b9d9 --- /dev/null +++ b/Client/Assets/Scripts/XUtliPoolLib/PDatabase.cs @@ -0,0 +1,486 @@ +using System; +using System.Collections.Generic; +using MiniJSON; + +namespace XUtliPoolLib +{ + public class PDatabase : XSingleton + { + public PlayerInfo playerInfo; + + public FriendInfo friendsInfo; + + public WXGroupInfo wxGroupInfo; + + public ShareCallBackType shareCallbackType = ShareCallBackType.Normal; + + public WXGroupCallBackType wxGroupCallbackType = WXGroupCallBackType.Guild; + + public void HandleExData(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]HandleExData msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + switch (this.GetApiId(msg)) + { + case 1: + this.SerialPlayerInfo(msg); + break; + case 2: + this.SerialFriendsInfo(msg); + break; + case 6: + this.SerialGuildGroupResult(msg); + break; + case 7: + this.SerialGuildGroupInfo(msg); + break; + case 8: + this.SerialGuildGroupResult(msg); + break; + case 9: + this.SerialShareResult(msg); + break; + case 12: + this.SerialHandleReplay(msg); + break; + case 16: + this.SerialQQVipPayInfo(msg); + break; + case 17: + this.SerialPaySubscribeInfo(msg); + break; + case 18: + this.SerialMarketingInfo(msg); + break; + case 19: + this.SerialGameCenterLaunch(msg); + break; + case 20: + this.SerialHandle3DTouch(msg); + break; + case 21: + this.SerialHandleScreenLock(msg); + break; + case 22: + this.SerialBuyGoodsInfo(msg); + break; + case 23: + this.SerialPandoraSDKBuyGoodsInfo(msg); + break; + } + } + + private int GetApiId(string msg) + { + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + int result = 1; + int.TryParse(dictionary["apiId"].ToString(), out result); + return result; + } + + public void SerialPlayerInfo(string msg) + { + this.playerInfo = XSingleton.singleton.Deserialize(msg); + } + + public void SerialFriendsInfo(string msg) + { + this.friendsInfo = XSingleton.singleton.Deserialize(msg); + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag = @interface == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialFriendsInfo entrance == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + @interface.OnGetPlatFriendsInfo(); + } + } + + public void SerialGuildGroupResult(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGuildGroupResult msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + WXGroupResult wxgroupResult = XSingleton.singleton.Deserialize(msg); + bool flag = wxgroupResult == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGuildGroupResult wxGroupResult == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag2 = @interface == null; + if (flag2) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGuildGroupResult entrance == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + @interface.OnWXGroupResult(wxgroupResult.apiId.ToString(), wxgroupResult.data.flag, wxgroupResult.data.errorCode, this.wxGroupCallbackType); + } + } + } + + public void SerialGuildGroupInfo(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGuildGroupInfo msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + this.wxGroupInfo = XSingleton.singleton.Deserialize(msg); + bool flag = this.wxGroupInfo == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGuildGroupInfo wxGroupInfo == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag2 = @interface == null; + if (flag2) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGuildGroupInfo entrance == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + @interface.RefreshWXGroupBtn(this.wxGroupCallbackType); + } + } + } + + public void SerialShareResult(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialShareResult msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialShareResult dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + object obj = null; + bool flag2 = dictionary.TryGetValue("data", out obj); + if (flag2) + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag3 = @interface != null; + if (flag3) + { + @interface.NoticeShareResult(obj.ToString(), this.shareCallbackType); + } + } + this.shareCallbackType = ShareCallBackType.Normal; + } + } + + public void SerialQQVipPayInfo(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialQQVipPayInfo msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialQQVipPayInfo dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + object obj; + bool flag2 = dictionary.TryGetValue("data", out obj); + if (flag2) + { + Dictionary dictionary2 = obj as Dictionary; + object obj2; + bool flag3 = dictionary2.TryGetValue("flag", out obj2); + if (flag3) + { + bool flag4 = @interface != null; + if (flag4) + { + XSingleton.singleton.AddLog("[PDatabase]SerialQQVipPayInfo result =" + obj2.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + @interface.OnQQVipPayCallback(obj2.ToString()); + } + } + } + } + } + + private void SerialGameCenterLaunch(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGameCenterLaunch msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialGameCenterLaunch dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + object obj; + bool flag2 = dictionary.TryGetValue("data", out obj) && @interface != null; + if (flag2) + { + Dictionary dictionary2 = obj as Dictionary; + object obj2 = null; + bool flag3 = dictionary2 != null && dictionary2.TryGetValue("wakeup_platform", out obj2); + if (flag3) + { + XSingleton.singleton.AddLog("[SerialGameCenterLaunch] platform: " + obj2.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + bool flag4 = (long)obj2 == 1L; + if (flag4) + { + XSingleton.singleton.AddLog("[SerialGameCenterLaunch] platform == 1", null, null, null, null, null, XDebugColor.XDebug_None); + object obj3 = null; + bool flag5 = dictionary2.TryGetValue("wakeup_wx_extInfo", out obj3); + if (flag5) + { + bool flag6 = obj3.ToString() == "WX_GameCenter"; + if (flag6) + { + @interface.OnGameCenterWakeUp(3); + XSingleton.singleton.AddLog("[SerialGameCenterLaunch] StartUpType.StartUp_WX", null, null, null, null, null, XDebugColor.XDebug_None); + } + } + } + else + { + bool flag7 = (long)obj2 == 2L; + if (flag7) + { + XSingleton.singleton.AddLog("[SerialGameCenterLaunch] platform == 2", null, null, null, null, null, XDebugColor.XDebug_None); + object obj4 = null; + bool flag8 = dictionary2.TryGetValue("wakeup_qq_extInfo", out obj4); + if (flag8) + { + bool flag9 = obj4.ToString() == "sq_gamecenter"; + if (flag9) + { + @interface.OnGameCenterWakeUp(2); + XSingleton.singleton.AddLog("[SerialGameCenterLaunch] StartUpType.StartUp_QQ", null, null, null, null, null, XDebugColor.XDebug_None); + } + } + } + } + } + } + } + } + + private void SerialHandle3DTouch(string msg) + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag = @interface != null; + if (flag) + { + @interface.SerialHandle3DTouch(msg); + } + } + + private void SerialHandleScreenLock(string msg) + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag = @interface != null; + if (flag) + { + @interface.SerialHandleScreenLock(msg); + } + } + + private void SerialMarketingInfo(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + object obj; + bool flag2 = dictionary.TryGetValue("data", out obj) && @interface != null; + if (flag2) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo data", null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary2 = obj as Dictionary; + object obj2 = null; + bool flag3 = dictionary2 != null && dictionary2.TryGetValue("flag", out obj2); + if (flag3) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo flag", null, null, null, null, null, XDebugColor.XDebug_None); + bool flag4 = obj2.ToString() == "Success"; + if (flag4) + { + object obj3 = null; + bool flag5 = dictionary2 != null && dictionary2.TryGetValue("mpinfo", out obj3); + if (flag5) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo mpinfo", null, null, null, null, null, XDebugColor.XDebug_None); + List list = obj3 as List; + bool flag6 = list != null; + if (flag6) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo array != null", null, null, null, null, null, XDebugColor.XDebug_None); + List list2 = new List(); + for (int i = 0; i < list.Count; i++) + { + object obj4 = list[i]; + Dictionary dictionary3 = obj4 as Dictionary; + PayMarketingInfo payMarketingInfo = new PayMarketingInfo(); + object obj5 = null; + bool flag7 = dictionary3 != null && dictionary3.TryGetValue("num", out obj5); + if (flag7) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo num = " + obj5.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + payMarketingInfo.diamondCount = int.Parse(obj5.ToString()); + } + object obj6 = null; + bool flag8 = dictionary3 != null && dictionary3.TryGetValue("send_num", out obj6); + if (flag8) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo send_num = " + obj6.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + payMarketingInfo.sendCount = int.Parse(obj6.ToString()); + } + object obj7 = null; + bool flag9 = dictionary3 != null && dictionary3.TryGetValue("send_ext", out obj7); + if (flag9) + { + XSingleton.singleton.AddLog("[PDatabase]SerialMarketingInfo send_ext = " + obj7.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + payMarketingInfo.sendExt = obj7.ToString(); + } + list2.Add(payMarketingInfo); + } + @interface.OnPayMarketingInfo(list2); + } + } + } + } + } + } + } + + private void SerialPaySubscribeInfo(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialPaySubscribeInfo msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialPaySubscribeInfo dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + object obj; + bool flag2 = dictionary.TryGetValue("data", out obj); + if (flag2) + { + Dictionary dictionary2 = obj as Dictionary; + object obj2 = null; + bool flag3 = dictionary2 != null && dictionary2.TryGetValue("flag", out obj2); + if (flag3) + { + bool flag4 = @interface != null; + if (flag4) + { + XSingleton.singleton.AddLog("[PDatabase]SerialPaySubscribeInfo result =" + obj2.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + @interface.OnPayCallback(obj2.ToString()); + return; + } + } + } + bool flag5 = @interface != null; + if (flag5) + { + @interface.OnPayCallback("Failure"); + } + } + } + + private void SerialBuyGoodsInfo(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialBuyGoodsInfo msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialBuyGoodsInfo dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + object obj; + bool flag2 = dictionary.TryGetValue("data", out obj); + if (flag2) + { + Dictionary dictionary2 = obj as Dictionary; + object obj2 = null; + bool flag3 = dictionary2 != null && dictionary2.TryGetValue("flag", out obj2); + if (flag3) + { + bool flag4 = @interface != null; + if (flag4) + { + XSingleton.singleton.AddLog("[PDatabase]SerialBuyGoodsInfo result =" + obj2.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + @interface.OnPayCallback(obj2.ToString()); + return; + } + } + } + bool flag5 = @interface != null; + if (flag5) + { + @interface.OnPayCallback("Failure"); + } + } + } + + private void SerialPandoraSDKBuyGoodsInfo(string msg) + { + XSingleton.singleton.AddLog("[PDatabase]SerialPandoraSDKBuyGoodsInfo msg" + msg, null, null, null, null, null, XDebugColor.XDebug_None); + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag = dictionary == null; + if (flag) + { + XSingleton.singleton.AddLog("[PDatabase]SerialPandoraSDKBuyGoodsInfo dict == null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + object obj; + bool flag2 = dictionary.TryGetValue("data", out obj); + if (flag2) + { + Dictionary dictionary2 = obj as Dictionary; + object obj2 = null; + bool flag3 = dictionary2 != null && dictionary2.TryGetValue("flag", out obj2); + if (flag3) + { + bool flag4 = @interface != null; + if (flag4) + { + XSingleton.singleton.AddLog("[PDatabase]SerialBuyGoodsInfo result =" + obj2.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + @interface.OnPayCallback(obj2.ToString()); + return; + } + } + } + bool flag5 = @interface != null; + if (flag5) + { + @interface.OnPayCallback("Failure"); + } + } + } + + private void SerialHandleReplay(string msg) + { + IUiUtility @interface = XSingleton.singleton.GetInterface(XSingleton.singleton.XHash("IUiUtility")); + bool flag = @interface != null; + if (flag) + { + @interface.OnReplayStart(); + } + } + } +} -- cgit v1.1-26-g67d0