sdk修改
parent
37e4593381
commit
48715b151a
|
@ -325,6 +325,7 @@ GameObject:
|
|||
- component: {fileID: 57277738265262265}
|
||||
- component: {fileID: 1362306110787991495}
|
||||
- component: {fileID: 3471622135844523395}
|
||||
- component: {fileID: 3471622135844523396}
|
||||
m_Layer: 0
|
||||
m_Name: SDKConfig
|
||||
m_TagString: Untagged
|
||||
|
@ -345,3 +346,16 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
appid: wjtsq7xrwb48t2uw
|
||||
--- !u!114 &3471622135844523396
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3471622135844523394}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d7bc9cc33d9f7284590ba57b9743fb33, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
appid: 261348dcd3
|
||||
|
|
|
@ -106,6 +106,13 @@ public class App : UnitySingleton<App>
|
|||
return TapDBManager.Instance;
|
||||
}
|
||||
}
|
||||
public static BuglyManager BuglyMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
return BuglyManager.Instance;
|
||||
}
|
||||
}
|
||||
|
||||
//public static SoundManager SoundMgr {
|
||||
// get {
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using GameCore;
|
||||
namespace GameLogic
|
||||
{
|
||||
// 数数 数据平台
|
||||
public class BuglyConfig : MonoBehaviour
|
||||
{
|
||||
|
||||
public string appid = "";
|
||||
void Start()
|
||||
{
|
||||
BuglyManager.Instance.SetAppId(appid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class BuglyManager : UnitySingleton<BuglyManager>
|
||||
{
|
||||
public static string appId = "";
|
||||
|
||||
public void SetAppId(string appId)
|
||||
{
|
||||
BuglyManager.appId = appId;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
// bugly
|
||||
if(appId == "")
|
||||
{
|
||||
appId = VersionManager.Instance.GetVersionInfo("buglyId");
|
||||
}
|
||||
Debug.Log("Bugly Init: " + appId);
|
||||
BuglyAgent.InitWithAppId(appId);
|
||||
BuglyAgent.EnableExceptionHandler();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d7bc9cc33d9f7284590ba57b9743fb33
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -11,10 +11,7 @@ namespace GameLogic
|
|||
public string appid = "";
|
||||
void Start()
|
||||
{
|
||||
string channel = VersionManager.Instance.GetVersionInfo("channel");
|
||||
string subChannel = VersionManager.Instance.GetVersionInfo("subChannel");
|
||||
string v = VersionManager.Instance.GetVersionInfo("version");
|
||||
TapDBManager.Instance.Init(appid, channel+"_"+ subChannel, v);
|
||||
TapDBManager.Instance.SetAppId(appid);
|
||||
}
|
||||
|
||||
void OnApplicationPause(bool pauseStatus)
|
||||
|
@ -39,18 +36,35 @@ namespace GameLogic
|
|||
public static string channel = "";
|
||||
public static string version = "";
|
||||
|
||||
public void Init()
|
||||
{
|
||||
|
||||
string channel = VersionManager.Instance.GetVersionInfo("channel");
|
||||
string subChannel = VersionManager.Instance.GetVersionInfo("subChannel");
|
||||
string version = VersionManager.Instance.GetVersionInfo("version");
|
||||
|
||||
TapDBManager.channel = channel + "_" + subChannel;
|
||||
TapDBManager.version = version;
|
||||
}
|
||||
|
||||
public void Init(string appId, string channel, string version)
|
||||
{
|
||||
|
||||
TapDBManager.appId = appId;
|
||||
TapDBManager.channel = channel;
|
||||
TapDBManager.version = version;
|
||||
}
|
||||
|
||||
public void SetAppId(string appId)
|
||||
{
|
||||
TapDBManager.appId = appId;
|
||||
}
|
||||
|
||||
|
||||
public void OnStart()
|
||||
{
|
||||
Debug.LogWarning("TapDBManager:OnStart " + appId);
|
||||
TapDB.onStart(appId, channel, version);
|
||||
TapDB.onStart(TapDBManager.appId, TapDBManager.channel, TapDBManager.version);
|
||||
}
|
||||
|
||||
public void SetUser(string userId)
|
||||
|
|
|
@ -41,20 +41,18 @@ namespace GameLogic
|
|||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Awake()
|
||||
public void Init()
|
||||
{
|
||||
// 以时间戳校准 SDK 时间
|
||||
//ThinkingAnalyticsAPI.CalibrateTime(1585555578000);
|
||||
ThinkingAnalyticsAPI.CalibrateTimeWithNtp("ntp.aliyun.com");
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
// 开启自动采集启动和关闭事件
|
||||
ThinkingAnalyticsAPI.EnableAutoTrack(AUTO_TRACK_EVENTS.ALL);
|
||||
}
|
||||
|
||||
|
||||
// 校对时间
|
||||
public void CalibrateTime(long time)
|
||||
{
|
||||
|
|
|
@ -55,7 +55,9 @@ namespace SDK
|
|||
// 屏幕适配
|
||||
NotchScreenUtil.Instance.Init();
|
||||
// bugly
|
||||
BuglyAgent.InitWithAppId(VersionManager.Instance.GetVersionInfo("buglyId"));
|
||||
string bugly_app_id = VersionManager.Instance.GetVersionInfo("buglyId");
|
||||
Debug.Log("Bugly Init: " + bugly_app_id);
|
||||
BuglyAgent.InitWithAppId(bugly_app_id);
|
||||
BuglyAgent.EnableExceptionHandler();
|
||||
// 初始化
|
||||
Init();
|
||||
|
|
|
@ -5,6 +5,7 @@ local ManagerNames = {
|
|||
"DataCenterService/DataCenterManager",
|
||||
"DataCenterService/ThinkingAnalyticsManager",
|
||||
"DataCenterService/TapDBManager",
|
||||
"DataCenterService/BuglyManager",
|
||||
-- 游戏设置管理
|
||||
"Setting/SettingManager",
|
||||
--通信管理,所有的通信接口
|
||||
|
|
|
@ -76,7 +76,7 @@ end
|
|||
|
||||
function Network:ReceiveClientHeartBeat(buffer)
|
||||
local time = buffer:ReadIntToByte()
|
||||
Log("-------ReceiveClientHeartBeat----- time: "..time)
|
||||
-- Log("-------ReceiveClientHeartBeat----- time: "..time)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Network.OnReceiveHeartBeat, self, time)
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
BuglyManager = {}
|
||||
local this = BuglyManager
|
||||
function this.Initialize()
|
||||
if AppConst.isSDK then
|
||||
App.BuglyMgr:Init()
|
||||
end
|
||||
end
|
||||
|
||||
return BuglyManager
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e359c6a29a063ec4aa751b691bcc27d8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2,12 +2,7 @@
|
|||
local this = TapDBManager
|
||||
function this.Initialize()
|
||||
if AppConst.isSDK then
|
||||
local appId = "wjtsq7xrwb48t2uw"
|
||||
local channel = VersionManager:GetVersionInfo("channel")
|
||||
local subChannel = VersionManager:GetVersionInfo("subChannel")
|
||||
local version = VersionManager:GetVersionInfo("version")
|
||||
Debug.log("TapDBManager init: "..appId.."|"..channel.."_"..subChannel.."|"..version)
|
||||
App.TBDMgr:Init(appId, channel.."_"..subChannel, version)
|
||||
App.TBDMgr:Init()
|
||||
App.TBDMgr:OnStart()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,14 +24,16 @@ end
|
|||
|
||||
function this.Initialize()
|
||||
|
||||
-- 监听赛季结束事件
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Network.OnReceiveHeartBeat, function(network, time)
|
||||
if network.type == SocketType.LOGIN then
|
||||
this.CalibrateTime(time)
|
||||
end
|
||||
end)
|
||||
-- 尝试触发 安装事件(怀疑安装事件是在第一次触发track时触发的)
|
||||
this.Track("init")
|
||||
if AppConst.isSDK then
|
||||
-- 监听赛季结束事件
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Network.OnReceiveHeartBeat, function(network, time)
|
||||
if network.type == SocketType.LOGIN then
|
||||
this.CalibrateTime(time)
|
||||
end
|
||||
end)
|
||||
-- 尝试触发 安装事件(怀疑安装事件是在第一次触发track时触发的)
|
||||
App.TAMgr:Init()
|
||||
end
|
||||
end
|
||||
|
||||
-- 校对时间
|
||||
|
|
|
@ -223,6 +223,7 @@ public static class CustomSettings
|
|||
_GT(typeof(GameManager)),
|
||||
_GT(typeof(ThinkingAnalyticsManager)),
|
||||
_GT(typeof(TapDBManager)),
|
||||
_GT(typeof(BuglyManager)),
|
||||
_GT(typeof(LuaManager)),
|
||||
//_GT(typeof(SoundManager)),
|
||||
_GT(typeof(NetworkManager)),
|
||||
|
|
|
@ -23,6 +23,7 @@ public class AppWrap
|
|||
L.RegVar("GameMgr", get_GameMgr, null);
|
||||
L.RegVar("TAMgr", get_TAMgr, null);
|
||||
L.RegVar("TBDMgr", get_TBDMgr, null);
|
||||
L.RegVar("BuglyMgr", get_BuglyMgr, null);
|
||||
L.RegVar("ImageDownloadMgr", get_ImageDownloadMgr, null);
|
||||
L.RegVar("SpeakMgr", get_SpeakMgr, null);
|
||||
L.RegVar("SDKMgr", get_SDKMgr, null);
|
||||
|
@ -256,6 +257,20 @@ public class AppWrap
|
|||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int get_BuglyMgr(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.Push(L, App.BuglyMgr);
|
||||
return 1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int get_ImageDownloadMgr(IntPtr L)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
//this source code was auto-generated by tolua#, do not modify it
|
||||
using System;
|
||||
using LuaInterface;
|
||||
|
||||
public class GameCore_UnitySingleton_GameLogic_BuglyManagerWrap
|
||||
{
|
||||
public static void Register(LuaState L)
|
||||
{
|
||||
L.BeginClass(typeof(GameCore.UnitySingleton<GameLogic.BuglyManager>), typeof(UnityEngine.MonoBehaviour), "UnitySingleton_GameLogic_BuglyManager");
|
||||
L.RegFunction("__eq", op_Equality);
|
||||
L.RegFunction("__tostring", ToLua.op_ToString);
|
||||
L.RegVar("Instance", get_Instance, null);
|
||||
L.EndClass();
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int op_Equality(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 2);
|
||||
UnityEngine.Object arg0 = (UnityEngine.Object)ToLua.ToObject(L, 1);
|
||||
UnityEngine.Object arg1 = (UnityEngine.Object)ToLua.ToObject(L, 2);
|
||||
bool o = arg0 == arg1;
|
||||
LuaDLL.lua_pushboolean(L, o);
|
||||
return 1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int get_Instance(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.Push(L, GameCore.UnitySingleton<GameLogic.BuglyManager>.Instance);
|
||||
return 1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3bde787c082e0e04fa895687e54a406a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,98 @@
|
|||
//this source code was auto-generated by tolua#, do not modify it
|
||||
using System;
|
||||
using LuaInterface;
|
||||
|
||||
public class GameLogic_BuglyManagerWrap
|
||||
{
|
||||
public static void Register(LuaState L)
|
||||
{
|
||||
L.BeginClass(typeof(GameLogic.BuglyManager), typeof(GameCore.UnitySingleton<GameLogic.BuglyManager>));
|
||||
L.RegFunction("SetAppId", SetAppId);
|
||||
L.RegFunction("Init", Init);
|
||||
L.RegFunction("__eq", op_Equality);
|
||||
L.RegFunction("__tostring", ToLua.op_ToString);
|
||||
L.RegVar("appId", get_appId, set_appId);
|
||||
L.EndClass();
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int SetAppId(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 2);
|
||||
GameLogic.BuglyManager obj = (GameLogic.BuglyManager)ToLua.CheckObject<GameLogic.BuglyManager>(L, 1);
|
||||
string arg0 = ToLua.CheckString(L, 2);
|
||||
obj.SetAppId(arg0);
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int Init(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 1);
|
||||
GameLogic.BuglyManager obj = (GameLogic.BuglyManager)ToLua.CheckObject<GameLogic.BuglyManager>(L, 1);
|
||||
obj.Init();
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int op_Equality(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 2);
|
||||
UnityEngine.Object arg0 = (UnityEngine.Object)ToLua.ToObject(L, 1);
|
||||
UnityEngine.Object arg1 = (UnityEngine.Object)ToLua.ToObject(L, 2);
|
||||
bool o = arg0 == arg1;
|
||||
LuaDLL.lua_pushboolean(L, o);
|
||||
return 1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int get_appId(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
LuaDLL.lua_pushstring(L, GameLogic.BuglyManager.appId);
|
||||
return 1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int set_appId(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
string arg0 = ToLua.CheckString(L, 2);
|
||||
GameLogic.BuglyManager.appId = arg0;
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0eee73f5b0963d14b97e1e613a33f3af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -8,6 +8,7 @@ public class GameLogic_TapDBManagerWrap
|
|||
{
|
||||
L.BeginClass(typeof(GameLogic.TapDBManager), typeof(GameCore.UnitySingleton<GameLogic.TapDBManager>));
|
||||
L.RegFunction("Init", Init);
|
||||
L.RegFunction("SetAppId", SetAppId);
|
||||
L.RegFunction("OnStart", OnStart);
|
||||
L.RegFunction("SetUser", SetUser);
|
||||
L.RegFunction("SetServer", SetServer);
|
||||
|
@ -26,12 +27,43 @@ public class GameLogic_TapDBManagerWrap
|
|||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 4);
|
||||
int count = LuaDLL.lua_gettop(L);
|
||||
|
||||
if (count == 1)
|
||||
{
|
||||
GameLogic.TapDBManager obj = (GameLogic.TapDBManager)ToLua.CheckObject<GameLogic.TapDBManager>(L, 1);
|
||||
obj.Init();
|
||||
return 0;
|
||||
}
|
||||
else if (count == 4)
|
||||
{
|
||||
GameLogic.TapDBManager obj = (GameLogic.TapDBManager)ToLua.CheckObject<GameLogic.TapDBManager>(L, 1);
|
||||
string arg0 = ToLua.CheckString(L, 2);
|
||||
string arg1 = ToLua.CheckString(L, 3);
|
||||
string arg2 = ToLua.CheckString(L, 4);
|
||||
obj.Init(arg0, arg1, arg2);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LuaDLL.luaL_throw(L, "invalid arguments to method: GameLogic.TapDBManager.Init");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int SetAppId(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 2);
|
||||
GameLogic.TapDBManager obj = (GameLogic.TapDBManager)ToLua.CheckObject<GameLogic.TapDBManager>(L, 1);
|
||||
string arg0 = ToLua.CheckString(L, 2);
|
||||
string arg1 = ToLua.CheckString(L, 3);
|
||||
string arg2 = ToLua.CheckString(L, 4);
|
||||
obj.Init(arg0, arg1, arg2);
|
||||
obj.SetAppId(arg0);
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -8,6 +8,7 @@ public class GameLogic_ThinkingAnalyticsManagerWrap
|
|||
{
|
||||
L.BeginClass(typeof(GameLogic.ThinkingAnalyticsManager), typeof(GameCore.UnitySingleton<GameLogic.ThinkingAnalyticsManager>));
|
||||
L.RegFunction("GetDynamicSuperProperties", GetDynamicSuperProperties);
|
||||
L.RegFunction("Init", Init);
|
||||
L.RegFunction("CalibrateTime", CalibrateTime);
|
||||
L.RegFunction("SetDistinctId", SetDistinctId);
|
||||
L.RegFunction("GetDistinctId", GetDistinctId);
|
||||
|
@ -38,6 +39,22 @@ public class GameLogic_ThinkingAnalyticsManagerWrap
|
|||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int Init(IntPtr L)
|
||||
{
|
||||
try
|
||||
{
|
||||
ToLua.CheckArgsCount(L, 1);
|
||||
GameLogic.ThinkingAnalyticsManager obj = (GameLogic.ThinkingAnalyticsManager)ToLua.CheckObject<GameLogic.ThinkingAnalyticsManager>(L, 1);
|
||||
obj.Init();
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return LuaDLL.toluaL_exception(L, e);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||
static int CalibrateTime(IntPtr L)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue