guodong 3 vuotta sitten
vanhempi
commit
1a5829f584

+ 1 - 1
FGUIProject/assets/Login/LoginUI.xml

@@ -28,6 +28,6 @@
     <component id="n13_es2q" name="btnAge" src="es2q5i" fileName="components/Button5.xml" xy="924,1740">
       <relation target="" sidePair="right-right,bottom-bottom"/>
     </component>
-    <component id="n15_pwpm" name="btnTapLogin" src="pwpm5k" fileName="components/ButtonTapLogin.xml" xy="333,1548"/>
+    <component id="n15_pwpm" name="btnTapLogin" src="pwpm5k" fileName="components/ButtonTapLogin.xml" xy="333,1837"/>
   </displayList>
 </component>

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -94,6 +94,7 @@ namespace GFGGame
 
         public static async ETTask PreEnterGameAsync()
         {
+            PlatformTapManager.OnEnterGame();
             RoleDataHandler.StartUpdate();
 
             GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("CommonGame"));
@@ -131,6 +132,7 @@ namespace GFGGame
 
         public static void QuitToLoginView(bool logout)
         {
+            PlatformTapManager.OnQuitGame();
             GameGlobal.isVisitor = false;
             GameGlobal.antiAddiction = true;
             GameGlobal.userId = 0;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs

@@ -308,7 +308,7 @@ namespace ET
                 return r2C_LoginRealm.Error;
             }
 
-            Log.Warning($"GateAddress : {r2C_LoginRealm.GateAddress}");
+            Log.Debug($"GateAddress : {r2C_LoginRealm.GateAddress}");
             Session gateSession = zoneScene.GetComponent<NetKcpComponent>().Create(NetworkHelper.ToIPEndPoint(r2C_LoginRealm.GateAddress));
             gateSession.AddComponent<PingComponent>();
             gateSession.AddComponent<DisConnectedCompnent>();

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Role/RoleInfosComponentSystem.cs

@@ -26,5 +26,16 @@
             }
             return "";
         }
+        public static RoleInfo GetCurrentRole(this RoleInfosComponent self)
+        {
+            foreach (var i in self.RoleInfos)
+            {
+                if (i.Id == self.CurrentRoleId)
+                {
+                    return i;
+                }
+            }
+            return null;
+        }
     }
 }

+ 10 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/ServerInfo/ServerInfosComponentSystem.cs

@@ -1,4 +1,6 @@
-namespace ET
+using static Codice.Client.Common.Servers.RecentlyUsedServers;
+
+namespace ET
 {
     public class ServerInfosComponentDestroySystem : DestroySystem<ServerInfosComponent>
     {
@@ -19,10 +21,17 @@
             self.ServerInfoList.Add(serverInfo.Id, serverInfo);
 
         }
+
         public static void SetRecentlyServerInfo(this ServerInfosComponent self, long recentId)
         {
             self.recentlyServerInfo = self.ServerInfoList[recentId];
             self.CurrentServerId = (int)recentId;
         }
+
+        public static ServerInfo GetCurrentServerInfo(this ServerInfosComponent self)
+        {
+            return self.ServerInfoList[self.CurrentServerId];
+        }
+
     }
 }

+ 0 - 7
GameClient/Assets/Game/HotUpdate/Platform/PlatformName.cs

@@ -1,7 +0,0 @@
-namespace GFGGame
-{
-    public class PlatformName
-    {
-        public const string TapTap = "taptap";
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/Platform/PlatformName.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: cb4996753c75d2e43a4bdc807fbdbb47
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 33 - 1
GameClient/Assets/Game/HotUpdate/Platform/PlatformTapManager.cs

@@ -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();
+        }
     }
 }

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -94,8 +94,8 @@ namespace GFGGame
                     LoginController.LoginTest(currentUser.ObjectId).Coroutine();
                 }
             }
-            else//自有登录
-            {
+            //else//自有登录
+            //{
                 _ui.m_btnStart.visible = true;
                 //尝试自动登录
                 if (serverInfosComponent.ServerInfoList.Count <= 0)
@@ -107,7 +107,7 @@ namespace GFGGame
                 {
                     ViewManager.Show<LoginInputView>();
                 }
-            }
+            //}
         }
 
         private void OnClickBtnTabLogin()

BIN
GameClient/Assets/ResIn/UI/Login/Login_fui.bytes