diff --git a/Assets/LuaFramework/Scripts/SDK/Proxy.cs b/Assets/LuaFramework/Scripts/SDK/Proxy.cs index 7a30909a98..20f5e0d3b9 100644 --- a/Assets/LuaFramework/Scripts/SDK/Proxy.cs +++ b/Assets/LuaFramework/Scripts/SDK/Proxy.cs @@ -19,7 +19,7 @@ namespace SDK private Queue messages = new Queue(); public void PushMessage(Message msg) { lock (messages) { messages.Enqueue(msg); } } public Message PopMessage() { lock (messages) { return messages.Count > 0 ? messages.Dequeue() : null; } } - public virtual void CustomEvent(string events,string desc) { } + public virtual void CustomEvent(string events,string desc, string type) { } } } diff --git a/Assets/LuaFramework/Scripts/SDK/Proxy/AndroidProxy.cs b/Assets/LuaFramework/Scripts/SDK/Proxy/AndroidProxy.cs index f2f1644dd9..98764c7304 100644 --- a/Assets/LuaFramework/Scripts/SDK/Proxy/AndroidProxy.cs +++ b/Assets/LuaFramework/Scripts/SDK/Proxy/AndroidProxy.cs @@ -123,9 +123,9 @@ namespace SDK } //sdk打点功能 - public override void CustomEvent(string events, string desc) + public override void CustomEvent(string events, string desc, string type) { - currentActivity.Call("CustomEvent", events, desc); + currentActivity.Call("CustomEvent", events, desc , type); } //登出 public override void Logout() diff --git a/Assets/LuaFramework/Scripts/SDK/SDKManager.cs b/Assets/LuaFramework/Scripts/SDK/SDKManager.cs index 59f105fe51..e3c38f9cd7 100644 --- a/Assets/LuaFramework/Scripts/SDK/SDKManager.cs +++ b/Assets/LuaFramework/Scripts/SDK/SDKManager.cs @@ -160,9 +160,9 @@ namespace SDK proxy.Logout(); } //sdk 埋点 - public void CustomEvent(string events, string desc) + public void CustomEvent(string events, string desc, string type) { - proxy.CustomEvent(events,desc); + proxy.CustomEvent(events,desc, type); } /// /// ///////// sdk层回调 diff --git a/Assets/ManagedResources/~Lua/Logic/Network.lua b/Assets/ManagedResources/~Lua/Logic/Network.lua index 040a5403f8..3390fe4d79 100644 --- a/Assets/ManagedResources/~Lua/Logic/Network.lua +++ b/Assets/ManagedResources/~Lua/Logic/Network.lua @@ -261,11 +261,12 @@ function Network:Update() elseif self.resendTimes == self.maxResendTimes then RequestPanel.Hide() MsgPanel.ShowTwo("请求失败,是否重新请求?", function() - Framework.Dispose() - if AppConst.isSDKLogin then + if AppConst.isSDKLogin then SDKMgr:Logout() + else + Framework.Dispose() + App.Instance:ReStart() end - App.Instance:ReStart() end, function() self.resendTimes = 0 end, "重新登录") diff --git a/Assets/ManagedResources/~Lua/Modules/DataCenterService/CustomEventManager.lua b/Assets/ManagedResources/~Lua/Modules/DataCenterService/CustomEventManager.lua index 4f4ca7e7e6..24607c36ad 100644 --- a/Assets/ManagedResources/~Lua/Modules/DataCenterService/CustomEventManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/DataCenterService/CustomEventManager.lua @@ -2,25 +2,25 @@ CustomEventManager = {} local this = CustomEventManager local IsSDKLogin = AppConst.isSDKLogin local FBSDKCustomEvents = { - [1] = {id = 1, info = 1,FBSDKCustomEventType = 1,event = "Registration",data = "用户完成注册或使用第三方渠道首次登陆"}, - [2] = {id = 2, info = 2,FBSDKCustomEventType = 1,event = "Next day login",data = "次日登陆,即 次留"}, - [3] = {id = 3, info = 3,FBSDKCustomEventType = 1,event = "3rd day login",data = "3留" }, - [4] = {id = 4, info = 7,FBSDKCustomEventType = 1,event = "7th day login",data = "7留" }, - [5] = {id = 5, info = 2,FBSDKCustomEventType = 2,event = "特权等级 2",data = "特权等级达到2" }, - [6] = {id = 6, info = 4,FBSDKCustomEventType = 2,event = "特权等级 4",data = "特权等级达到4" }, - [7] = {id = 7, info = 6,FBSDKCustomEventType = 2,event = "特权等级 6",data = "特权等级达到6" }, - [8] = {id = 8, info = 8,FBSDKCustomEventType = 2,event = "特权等级 8",data = "特权等级达到8" }, - [9] = {id = 9, info = 10,FBSDKCustomEventType = 2,event = "特权等级 10",data = "特权等级达到10" }, - [10] = {id = 10, info = 13,FBSDKCustomEventType = 2,event = "特权等级 13",data = "特权等级达到13"}, - [11] = {id = 11, info = 0,FBSDKCustomEventType = 3,event = "New role tutorial",data = "完成新手指引"}, - [12] = {id = 12, info = 10,FBSDKCustomEventType = 4,event = "Levels achieved",data = "角色等级10"}, - [13] = {id = 13, info = 20,FBSDKCustomEventType = 4,event = "Lv. 20",data = "角色等级20" }, - [14] = {id = 14, info = 40,FBSDKCustomEventType = 4,event = "Lv. 40",data = "角色等级40"}, - [15] = {id = 15, info = 80,FBSDKCustomEventType = 4,event = "Lv. 80",data = "角色等级80" }, - [16] = {id = 16, info = 100,FBSDKCustomEventType = 4,event = "Lv. 100",data = "角色等级100" }, - [17] = {id = 17, info = 0,FBSDKCustomEventType = 5,event = "Monthly card",data = "首次购买普通月卡" }, - [18] = {id = 18, info = 0,FBSDKCustomEventType = 6,event = "Supreme card",data = "首次购买豪华月卡" }, - [19] = {id = 19, info = 0,FBSDKCustomEventType = 7,event = "First topup",data = "完成首次充值" }, + [1] = {id = 1,type = 1, info = 1,FBSDKCustomEventType = 1,event = "Registration",data = "用户完成注册或使用第三方渠道首次登陆"}, + [2] = {id = 2, type = 1,info = 2,FBSDKCustomEventType = 1,event = "Next day login",data = "次日登陆,即 次留"}, + [3] = {id = 3, type = 1,info = 3,FBSDKCustomEventType = 1,event = "3rd day login",data = "3留" }, + [4] = {id = 4, type = 1,info = 7,FBSDKCustomEventType = 1,event = "7th day login",data = "7留" }, + [5] = {id = 5, type = 1,info = 2,FBSDKCustomEventType = 2,event = "特权等级 2",data = "特权等级达到2" }, + [6] = {id = 6, type = 1,info = 4,FBSDKCustomEventType = 2,event = "特权等级 4",data = "特权等级达到4" }, + [7] = {id = 7, type = 1,info = 6,FBSDKCustomEventType = 2,event = "特权等级 6",data = "特权等级达到6" }, + [8] = {id = 8, type = 1,info = 8,FBSDKCustomEventType = 2,event = "特权等级 8",data = "特权等级达到8" }, + [9] = {id = 9, type = 1,info = 10,FBSDKCustomEventType = 2,event = "特权等级 10",data = "特权等级达到10" }, + [10] = {id = 10, type = 1,info = 13,FBSDKCustomEventType = 2,event = "特权等级 13",data = "特权等级达到13"}, + [11] = {id = 11, type = 1,info = 0,FBSDKCustomEventType = 3,event = "New role tutorial",data = "完成新手指引"}, + [12] = {id = 12, type = 1,info = 10,FBSDKCustomEventType = 4,event = "Levels achieved",data = "角色等级10"}, + [13] = {id = 13, type = 1,info = 20,FBSDKCustomEventType = 4,event = "Lv. 20",data = "角色等级20" }, + [14] = {id = 14, type = 1,info = 40,FBSDKCustomEventType = 4,event = "Lv. 40",data = "角色等级40"}, + [15] = {id = 15, type = 1,info = 80,FBSDKCustomEventType = 4,event = "Lv. 80",data = "角色等级80" }, + [16] = {id = 16, type = 1,info = 100,FBSDKCustomEventType = 4,event = "Lv. 100",data = "角色等级100" }, + [17] = {id = 17, type = 1,info = 0,FBSDKCustomEventType = 5,event = "Monthly card",data = "首次购买普通月卡" }, + [18] = {id = 18, type = 1,info = 0,FBSDKCustomEventType = 6,event = "Supreme card",data = "首次购买豪华月卡" }, + [19] = {id = 19, type = 1,info = 0,FBSDKCustomEventType = 7,event = "First topup",data = "完成首次充值" }, } function this.SetisFirstLogVal(isDayFirst) if isDayFirst == 0 then--今天第一次登陆 @@ -36,22 +36,20 @@ function this.SendCustomEvents(CustomType,info) local index = 0 for i = 1, #FBSDKCustomEvents do local curFBSDKCustomEvents = FBSDKCustomEvents[i] - -- LogGreen("埋点上报数据1 : "..curFBSDKCustomEvents.event.." "..curFBSDKCustomEvents.data.." "..CustomType.." "..info) if CustomType == curFBSDKCustomEvents.FBSDKCustomEventType and info == curFBSDKCustomEvents.info then - -- LogGreen("埋点上报数据2 : "..curFBSDKCustomEvents.id) index = curFBSDKCustomEvents.id break end end if index > 0 then LogGreen("埋点上报数据 成功 : "..FBSDKCustomEvents[index].event.." "..FBSDKCustomEvents[index].data) - this.SendCustomEvent(FBSDKCustomEvents[index].event,FBSDKCustomEvents[index].data) + this.SendCustomEvent(FBSDKCustomEvents[index].event,FBSDKCustomEvents[index].data,FBSDKCustomEvents[index].type) end end -- 打点事件 -function this.SendCustomEvent(event, data) +function this.SendCustomEvent(event, data,type) if IsSDKLogin then - SDKMgr:CustomEvent(event,data) + SDKMgr:CustomEvent(event,data,type) end end diff --git a/Assets/Source/Generate/SDK_SDKManagerWrap.cs b/Assets/Source/Generate/SDK_SDKManagerWrap.cs index f1c8c6516d..616ceddd72 100644 --- a/Assets/Source/Generate/SDK_SDKManagerWrap.cs +++ b/Assets/Source/Generate/SDK_SDKManagerWrap.cs @@ -211,11 +211,12 @@ public class SDK_SDKManagerWrap { try { - ToLua.CheckArgsCount(L, 3); + ToLua.CheckArgsCount(L, 4); SDK.SDKManager obj = (SDK.SDKManager)ToLua.CheckObject(L, 1); string arg0 = ToLua.CheckString(L, 2); string arg1 = ToLua.CheckString(L, 3); - obj.CustomEvent(arg0, arg1); + string arg2 = ToLua.CheckString(L, 4); + obj.CustomEvent(arg0, arg1, arg2); return 0; } catch (Exception e)