|
@@ -1,5 +1,7 @@
|
|
|
-using TapTap.Bootstrap;
|
|
|
+using ET;
|
|
|
+using TapTap.Bootstrap;
|
|
|
using TapTap.Common;
|
|
|
+using TapTap.TapDB;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -7,14 +9,44 @@ namespace GFGGame
|
|
|
{
|
|
|
public static void InitSDK()
|
|
|
{
|
|
|
+ if (!PlatformManager.IsTaptap)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
var config = new TapConfig.Builder()
|
|
|
.ClientID("K7bDyPGYlVx2AAtk6q")
|
|
|
.ClientToken("fjwWBtibB4Dj3UjyRQxK2tZ3f8fGNgg14tcRW38D")
|
|
|
.ServerURL("https://k7bdypgy.cloud.tds1.tapapis.cn")
|
|
|
.RegionType(RegionType.CN)
|
|
|
+ .TapDBConfig(true, "tap", null, true)
|
|
|
.ConfigBuilder();
|
|
|
TapBootstrap.Init(config);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public static void OnEnterGame()
|
|
|
+ {
|
|
|
+ if(!PlatformManager.IsTaptap)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
|
+ var accountInfoComponent = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>();
|
|
|
+ var roleInfosComponent = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>();
|
|
|
+ var currentRole = roleInfosComponent.GetCurrentRole();
|
|
|
+ TapDB.SetUser(accountInfoComponent.Account);
|
|
|
+ TapDB.SetName(currentRole.Name);
|
|
|
+ TapDB.SetLevel(RoleDataManager.lvl);
|
|
|
+ TapDB.SetServer(serverInfosComponent.GetCurrentServerInfo().ServerName);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void OnQuitGame()
|
|
|
+ {
|
|
|
+ if (!PlatformManager.IsTaptap)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ TapDB.ClearUser();
|
|
|
+ }
|
|
|
}
|
|
|
}
|