|
|
@@ -121,12 +121,31 @@ adjus事件上报及对应的token
|
|
|
},
|
|
|
}
|
|
|
|
|
|
+function SDKEventReportMgr:ctor()
|
|
|
+ self:RegisterNetEvents()
|
|
|
+end
|
|
|
+
|
|
|
+function SDKEventReportMgr:RegisterNetEvents()
|
|
|
+ ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_DNY_SDK_NTF, self.OnSC_DNY_SDK_NTF, self)
|
|
|
+end
|
|
|
+
|
|
|
+function SDKEventReportMgr:UnRegisterNetEvents()
|
|
|
+ ManagerContainer.NetManager:UnRegisterPbIdCallback(ProtoMsgId.SC_DNY_SDK_NTF)
|
|
|
+end
|
|
|
+
|
|
|
+function SDKEventReportMgr:Destroy()
|
|
|
+ self:UnRegisterNetEvents()
|
|
|
+end
|
|
|
|
|
|
function SDKEventReportMgr:SendEvent(type)
|
|
|
if not SDKMgr.Instance:IsReportAction() then
|
|
|
return
|
|
|
end
|
|
|
local curCfg = self:GetCfgByType(type)
|
|
|
+ if curCfg == nil then
|
|
|
+ LogError("没找到对应统计 id ="..type)
|
|
|
+ return
|
|
|
+ end
|
|
|
local datas = System.Collections.Generic.Dictionary_object_object()
|
|
|
datas:Add('event', curCfg.event)
|
|
|
datas:Add('eventToken', curCfg.eventToken)
|
|
|
@@ -156,4 +175,11 @@ function SDKEventReportMgr:GetCfgByType(type)
|
|
|
return curCfg[type]
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+function SDKEventReportMgr:OnSC_DNY_SDK_NTF(data)
|
|
|
+ if data.error and data.error == 0 then
|
|
|
+ return
|
|
|
+ end
|
|
|
+ self:SendEvent(data.type);
|
|
|
+end
|
|
|
return SDKEventReportMgr
|