Selaa lähdekoodia

Merge remote-tracking branch 'remotes/org/douyou'

hexiaojie 1 vuosi sitten
vanhempi
commit
bde863d2b5

+ 1 - 0
.gitignore

@@ -45,6 +45,7 @@
 /GameClient/Assets/StreamingAssets/Bundles.meta
 /GameClient/Assets/StreamingAssets
 /StaticRes
+/GameClient/.idea/.idea.GameClient/.idea/indexLayout.xml
 /GameClient/Assets/Plugins/Android/libs/douyou-release.aar
 /GameClient/Assets/Plugins/Android/libs/douyou-release.aar.meta
 /GameClient/Assets/Plugins/Android/libs/douyouTT-release.aar

+ 7 - 26
GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManager.cs

@@ -32,14 +32,7 @@ namespace GFGGame
 
         public void OnCreateRole()
         {
-            var zoneScene = GameGlobal.zoneScene;
-            var roleInfo = zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole();
-            
-            string serverName = zoneScene.GetComponent<ServerInfosComponent>().recentlyServerInfo.ServerName;
-
-            QDDouYouManagerInit.Instance.ReportRole((int)DouYouRoleLogReportType.CreateRole,
-                roleInfo.Id.ToString(), 1.ToString(), roleInfo.Name, roleInfo.ServerId.ToString(),
-                serverName);
+            QDManager.PushRoleAction(DouYouRoleLogReportType.CreateRole);
         }
 
         public void OnEnterGame()
@@ -52,8 +45,7 @@ namespace GFGGame
 
             QDDouYouManagerInit.Instance.ReportRoleLogin(roleInfo.Id.ToString(), lvl.ToString(), roleInfo.Name,
                 roleInfo.ServerId.ToString(), serverName);
-            QDDouYouManagerInit.Instance.ReportRole((int)DouYouRoleLogReportType.EnterGame,
-                roleInfo.Id.ToString(), lvl.ToString(), roleInfo.Name, roleInfo.ServerId.ToString(), serverName);
+            QDManager.PushRoleAction(DouYouRoleLogReportType.EnterGame);
         }
 
         public void OnQuitToLoginView()
@@ -69,14 +61,7 @@ namespace GFGGame
 
         public void LoginOutBefore()
         {
-            var zoneScene = GameGlobal.zoneScene;
-            var roleInfo = zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole();
-            int lvl = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
-            string serverName = zoneScene.GetComponent<ServerInfosComponent>().recentlyServerInfo.ServerName;
-
-            QDDouYouManagerInit.Instance.ReportRole((int)DouYouRoleLogReportType.ExitGame,
-                roleInfo.Id.ToString(), lvl.ToString(), roleInfo.Name, roleInfo.ServerId.ToString(),
-                serverName);
+            QDManager.PushRoleAction(DouYouRoleLogReportType.ExitGame);
         }
 
         public void Pay(int buyID, int count, string orderID, long price)
@@ -109,18 +94,14 @@ namespace GFGGame
 
         public void Exit()
         {
-            var zoneScene = GameGlobal.zoneScene;
-            var roleInfo = zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole();
-            int lvl = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
-            string serverName = zoneScene.GetComponent<ServerInfosComponent>().recentlyServerInfo.ServerName;
-
-            QDDouYouManagerInit.Instance.ReportRole((int)DouYouRoleLogReportType.ExitGame,
-                roleInfo.Id.ToString(), lvl.ToString(), roleInfo.Name, roleInfo.ServerId.ToString(),
-                serverName);
+            QDManager.PushRoleAction(DouYouRoleLogReportType.ExitGame);
             QDDouYouManagerInit.Instance.ExitApp();
         }
     }
 
+    /// <summary>
+    /// SDK回调
+    /// </summary>
     public class DouYouSDKListener : IDouYouSDKListener
     {
         // /// <summary>

+ 8 - 1
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -41,6 +41,8 @@ namespace GFGGame
         public static string updateResPrompt;
         public static int promptSizeMB;
         public static string updateUrl;
+        //新发行给的adId
+        public static string douYouAdId;
 
         public static void InitScriptCompilation()
         {
@@ -91,6 +93,11 @@ namespace GFGGame
             {
                 LauncherConfig.onDebug = int.Parse(result.onDebug);
             }
+
+            if (!string.IsNullOrEmpty(result.douYouAdId))
+            {
+                LauncherConfig.douYouAdId = result.douYouAdId;
+            }
             LauncherConfig.manifest_v = result.manifest_v;
             LauncherConfig.privacy_v = result.privacy_v;
             LauncherConfig.statusPrompt = result.statusPrompt;
@@ -117,7 +124,7 @@ namespace GFGGame
             public string updateResPrompt;
             public string promptSizeMB;
             public string updateUrl;
+            public string douYouAdId;
         }
-
     }
 }

+ 1 - 7
GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInit.cs

@@ -40,13 +40,7 @@ namespace GFGGame.Launcher
         {
             _douYouMainActivity.Call(functionName, args);
         }
-
-        //临时获取adId,之后需要配置到配置文件里面,已达到热更
-        public string GetAdId()
-        {
-            return "123";
-        }
-
+        
         /// <summary>
         /// 显示登录界面
         /// </summary>