Jelajahi Sumber

douyou sdk 接入基本完成

hexiaojie 1 tahun lalu
induk
melakukan
0a4a10892b
25 mengubah file dengan 900 tambahan dan 387 penghapusan
  1. 1 0
      GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs
  2. 1 0
      GameClient/Assets/Game/HotUpdate/Controller/GameController.cs
  3. 3 2
      GameClient/Assets/Game/HotUpdate/HotUpdateDriver.cs
  4. 261 0
      GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManager.cs
  5. 0 0
      GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManager.cs.meta
  6. 29 8
      GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs
  7. 0 66
      GameClient/Assets/Game/HotUpdate/Platform/QDQuickManager.cs
  8. 9 9
      GameClient/Assets/Game/HotUpdate/Utils/LogUtil.cs
  9. 8 0
      GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs
  10. 3 1
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs
  11. 2 2
      GameClient/Assets/Game/Launcher/LauncherConfig.cs
  12. 0 4
      GameClient/Assets/Game/Launcher/LauncherController.cs
  13. 0 130
      GameClient/Assets/Game/Launcher/Platform/DouYouSDK.cs
  14. 0 3
      GameClient/Assets/Game/Launcher/Platform/DouYouSDK.cs.meta
  15. 0 132
      GameClient/Assets/Game/Launcher/Platform/DouYouSDKHandler.cs
  16. 0 3
      GameClient/Assets/Game/Launcher/Platform/DouYouSDKHandler.cs.meta
  17. 43 0
      GameClient/Assets/Game/Launcher/Platform/IDouYouSDKListener.cs
  18. 3 0
      GameClient/Assets/Game/Launcher/Platform/IDouYouSDKListener.cs.meta
  19. 302 0
      GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInit.cs
  20. 3 0
      GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInit.cs.meta
  21. 9 15
      GameClient/Assets/Game/Launcher/Platform/QDManagerInit.cs
  22. 30 12
      GameClient/Assets/Plugins/com/easy/bridge/DouYouMainActivity.java
  23. 3 0
      GameClient/Assets/ThirdParty/DouYou.meta
  24. 187 0
      GameClient/Assets/ThirdParty/DouYou/AbDouYouSDKHandler.cs
  25. 3 0
      GameClient/Assets/ThirdParty/DouYou/AbDouYouSDKHandler.cs.meta

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -71,6 +71,7 @@ namespace GFGGame
         public const string LOGIN_SUCCESS = "LOGIN_SUCCESS"; //登录成功
         public const string LOGIN_FAIL = "LOGIN_FAIL"; //登录失败
         public const string SERVER_CHANGE = "SERVER_CHANGE"; //更换区服
+        public const string OUT_LOGIN = "OUT_LOGIN"; //退出登录
 
         public const string FIELD_RESULT = "FIELD_RESULT"; //田野结算
         public const string FIELD_TASK = "FIELD_TASK"; //田野任务

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

@@ -286,6 +286,7 @@ namespace GFGGame
 
         public static void QuitToLoginView(bool logout, bool fromSdkLogoutCallback = false)
         {
+            QDDouYouManager.Instance.LoginOutBefore();
             FieldDataManager.Instance.waitToShowFieldFightEndView = false;
             GameGlobal.AutoSevenDayLoginView = true;
             GameGlobal.AutoDailySignView = true;

+ 3 - 2
GameClient/Assets/Game/HotUpdate/HotUpdateDriver.cs

@@ -22,9 +22,10 @@ namespace GFGGame
             OperationSystem.Initialize();
             GameController.Start();
             Reporter reporter = GameObject.Find("Reporter").GetComponent<Reporter>();
-            if(LauncherConfig.ChannelId != (int)ChannelID.Test && reporter != null)
+            if ((LauncherConfig.ChannelId != (int)ChannelID.Test &&
+                 LauncherConfig.ChannelId != (int)ChannelID.DouYouTest) && reporter != null)
             {
-                reporter.numOfCircleToShow = 50;
+                reporter.numOfCircleToShow = 5;
             }
         }
 

+ 261 - 0
GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManager.cs

@@ -0,0 +1,261 @@
+using System;
+using ET;
+using UnityEngine;
+using GFGGame.Launcher;
+
+namespace GFGGame
+{
+    public class QDDouYouManager : SingletonBase<QDDouYouManager>
+    {
+        public bool isLogining;
+        public string uid;
+        public string token;
+
+        public void Init()
+        {
+            Debug.Log("实例化DouYouSDKListener");
+            QDDouYouManagerInit.Instance.douYouSDKListener = new DouYouSDKListener();
+        }
+
+        public void Login()
+        {
+            // if (!string.IsNullOrEmpty(uid))
+            // {
+            //     EventAgent.DispatchEvent(ConstMessage.ON_PLATFORM_SDK_LOGINED, uid);
+            //     return;
+            // }
+            // if (isLogining) return;
+            // Debug.Log($"quick Login");
+            // isLogining = true;
+            QDDouYouManagerInit.Instance.ShowLogin();
+        }
+
+        public void OnCreateRole()
+        {
+            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.CreateRole,
+                roleInfo.Id.ToString(), lvl.ToString(), roleInfo.Name, roleInfo.ServerId.ToString(),
+                serverName);
+        }
+
+        public void OnEnterGame()
+        {
+            Debug.Log($"DouYou OnEnterGame");
+            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.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);
+        }
+
+        public void OnQuitToLoginView()
+        {
+            Debug.Log($"DouYou OnQuitToLoginView");
+        }
+
+        public void Logout()
+        {
+            Debug.Log($"Game.HotUpdate DouYou Logout");
+            QDDouYouManagerInit.Instance.ShowLogout();
+        }
+
+        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);
+        }
+
+        public void Pay(int buyID, int count, string orderID, long price)
+        {
+            ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(buyID);
+            if (shopCfg == null)
+            {
+                Log.Error($"recharge {buyID} config not found!");
+                return;
+            }
+
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
+            if (itemCfg == null)
+            {
+                Log.Error($"recharge {buyID} itemCfgId:{shopCfg.itemId} config not found!");
+                return;
+            }
+
+            var zoneScene = GameGlobal.zoneScene;
+            int lvl = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
+            var roleInfo = zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole();
+            string serverName = zoneScene.GetComponent<ServerInfosComponent>().recentlyServerInfo.ServerName;
+
+            QDDouYouManagerInit.Instance.ShowSwitchPayment(orderID, price.ToString(), buyID.ToString(),
+                shopCfg.productName, itemCfg.desc,
+                roleInfo.ServerId.ToString(), serverName, roleInfo.Id.ToString(), roleInfo.Name, lvl.ToString(),
+                "Other");
+        }
+
+        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);
+            QDDouYouManagerInit.Instance.ExitApp();
+        }
+    }
+
+    public class DouYouSDKListener : IDouYouSDKListener
+    {
+        // /// <summary>
+        // /// 测试消息
+        // /// </summary>
+        // /// <param name="message"></param>
+        // public void ReceiveMessageAb(string message)
+        // {
+        //     Debug.Log($"Game.HotUpdate ReceiveMessageAb:{message}");
+        // }
+
+        // /// <summary>
+        // /// SDK实例化成功
+        // /// </summary>
+        // /// <param name="message">SDK 实例化成功</param>
+        // public void InitSuccessAb(string message)
+        // {
+        //     Debug.Log("Game.HotUpdate InitSuccessAb: " + message);
+        //     //UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true });
+        // }
+
+        /// <summary>
+        /// 登录成功 
+        /// </summary>
+        /// <param name="message">resUid + "|gfg|" + token</param>
+        public void LoginSuccessAb(string message)
+        {
+            Debug.Log("Game.HotUpdate LoginSuccessAb: " + message);
+            string[] result = message.Split(new string[] { "|gfg|" }, StringSplitOptions.None);
+
+            QDDouYouManager.Instance.isLogining = false;
+            QDDouYouManager.Instance.uid = result[0];
+            QDDouYouManager.Instance.token = result[1];
+            //登录成功的回调
+            EventAgent.DispatchEvent(ConstMessage.ON_PLATFORM_SDK_LOGINED, result[0]);
+        }
+
+        /// <summary>
+        /// 切换账号或退出登录后
+        /// </summary>
+        /// <param name="message">退出登录成功!</param>
+        public void OutLoginSuccessAb(string message)
+        {
+            Debug.Log("Game.HotUpdate OutLoginSuccessAb: " + message);
+            GameController.QuitToLoginView(true);
+            EventAgent.DispatchEvent(ConstMessage.OUT_LOGIN);
+        }
+
+        /// <summary>
+        /// 支付失败
+        /// </summary>
+        /// <param name="message">code + "|gfg|" + params.toString()</param>
+        public void PayFailAb(string message)
+        {
+            Debug.Log("Game.HotUpdate PayFailAb: " + message);
+            //改变临时订单状态为失败
+        }
+
+        /// <summary>
+        /// 支付成功
+        /// </summary>
+        /// <param name="message">code + "|gfg|" + params.toString()</param>
+        public void PaySuccessAb(string message)
+        {
+            Debug.Log("Game.HotUpdate PaySuccessAb" + message);
+            //改变临时订单状态为支付成功
+        }
+
+        #region SDK 生命周期函数
+
+        public void SdkOnStartAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnStartAb:{message}");
+        }
+
+        // public void SdkOnPauseAb(string message)
+        // {
+        //     Debug.Log($"Game.HotUpdate SdkOnPauseAb:{message}");
+        // }
+
+        // public void SdkOnResumeAb(string message)
+        // {
+        //     Debug.Log($"Game.HotUpdate SdkOnResumeAb:{message}");
+        // }
+
+        public void SdkOnStopAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnStopAb:{message}");
+        }
+
+        public void SdkOnDestroyAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnDestroyAb:{message}");
+        }
+
+        public void SdkOnRestartAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnRestartAb:{message}");
+        }
+
+        public void SdkOnBackPressedAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnBackPressedAb:{message}");
+        }
+
+        public void SdkOnNewIntentAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnNewIntentAb:{message}");
+        }
+
+        public void SdkOnConfigurationChangedAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnConfigurationChangedAb:{message}");
+        }
+
+        public void SdkOnSaveInstanceStateAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnSaveInstanceStateAb:{message}");
+        }
+
+        public void SdkOnActivityResultAb(string message)
+        {
+            Debug.Log($"Game.HotUpdate SdkOnActivityResultAb:{message}");
+        }
+
+        // public void SdkOnRequestPermissionResultAb(string message)
+        // {
+        //     Debug.Log($"Game.HotUpdate SdkOnRequestPermissionResultAb:{message}");
+        // }
+
+        // public void SdkOnWindowFocusChangedAb(string message)
+        // {
+        //     Debug.Log($"Game.HotUpdate SdkOnWindowFocusChangedAb:{message}");
+        // }
+
+        #endregion
+    }
+}

+ 0 - 0
GameClient/Assets/Game/HotUpdate/Platform/QDQuickManager.cs.meta → GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManager.cs.meta


+ 29 - 8
GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs

@@ -6,12 +6,15 @@ namespace GFGGame
 
     public class QDManager
     {
+        public bool isLogining;
+        public string uid;
+        
         public static void Init()
         {
             switch(LauncherConfig.ChannelId)
             {
                 default:
-                    QDQuickManager.Instance.Init();
+                    QDDouYouManager.Instance.Init();
                     break;
             }
         }
@@ -32,8 +35,11 @@ namespace GFGGame
                         ViewManager.Show<LoginInputView>();
                     }
                     break;
+                case (int)ChannelID.DouYouTest:
+                    QDDouYouManager.Instance.Login();
+                    break;
                 default:
-                    QDQuickManager.Instance.Login();
+                    QDDouYouManager.Instance.Login();
                     break;
             }
         }
@@ -48,8 +54,11 @@ namespace GFGGame
                 case (int)ChannelID.Test:
 
                     break;
+                case (int)ChannelID.DouYouTest:
+                    QDDouYouManager.Instance.OnCreateRole();
+                    break;
                 default:
-                    QDQuickManager.Instance.OnCreateRole();
+                    //QDDouYouManager.Instance.OnCreateRole();
                     break;
             }
         }
@@ -64,8 +73,11 @@ namespace GFGGame
                 case (int)ChannelID.Test:
 
                     break;
+                case (int)ChannelID.DouYouTest:
+                    QDDouYouManager.Instance.OnEnterGame();
+                    break;
                 default:
-                    QDQuickManager.Instance.OnEnterGame();
+                    //QDDouYouManager.Instance.OnEnterGame();
                     break;
             }
         }
@@ -81,8 +93,11 @@ namespace GFGGame
                 case (int)ChannelID.Test:
 
                     break;
+                case (int)ChannelID.DouYouTest:
+                    QDDouYouManager.Instance.OnQuitToLoginView();
+                    break;
                 default:
-                    QDQuickManager.Instance.OnQuitToLoginView();
+                    //QDDouYouManager.Instance.OnQuitToLoginView();
                     break;
             }
         }
@@ -97,8 +112,11 @@ namespace GFGGame
                 case (int)ChannelID.Test:
 
                     break;
+                case (int)ChannelID.DouYouTest:
+                    QDDouYouManager.Instance.Pay(buyID, count, orderID, price);
+                    break;
                 default:
-                    QDQuickManager.Instance.Pay(buyID, count, orderID, price);
+                    //QDDouYouManager.Instance.Pay(buyID, count, orderID, price);
                     break;
             }
         }
@@ -117,7 +135,7 @@ namespace GFGGame
                 default:
                     if(!fromSdkLogoutCallback)
                     {
-                        QDQuickManager.Instance.Logout();
+                        QDDouYouManager.Instance.Logout();
                     }
                     break;
             }
@@ -130,8 +148,11 @@ namespace GFGGame
                 case (int)ChannelID.Test:
                     GameController.ShowExitAlert();
                     break;
+                case (int)ChannelID.DouYouTest:
+                    QDDouYouManager.Instance.Exit();
+                    break;
                 default:
-                    QDQuickManager.Instance.Exit();
+                    //QDDouYouManager.Instance.Exit();
                     break;
             }
         }

+ 0 - 66
GameClient/Assets/Game/HotUpdate/Platform/QDQuickManager.cs

@@ -1,66 +0,0 @@
-using ET;
-using UnityEngine;
-
-namespace GFGGame
-{
-    public class QDQuickManager : SingletonBase<QDQuickManager>
-    {
-        public bool isLogining;
-        public string uid;
-        public void Init()
-        {
-          
-        }
-
-        public void Login()
-        {
-            // if (!string.IsNullOrEmpty(uid))
-            // {
-            //     EventAgent.DispatchEvent(ConstMessage.ON_PLATFORM_SDK_LOGINED, uid);
-            //     return;
-            // }
-            // if (isLogining) return;
-            // Debug.Log($"quick Login");
-            // isLogining = true;
-            DouYouSDK.Instance().ShowLogin();
-        }
-
-        public void OnCreateRole()
-        {
-            var zoneScene = GameGlobal.zoneScene;
-            var roleInfo = zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole();
-        }
-
-        public void OnEnterGame()
-        {
-            Debug.Log($"quick OnEnterGame");
-            var zoneScene = GameGlobal.zoneScene;
-            var roleInfo = zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole();
-        }
-
-        public void OnQuitToLoginView()
-        {
-            Debug.Log($"quick OnQuitToLoginView");
-
-        }
-
-        public void Logout()
-        {
-            Debug.Log($"quick Logout");
-        }
-
-        public void Pay(int buyID, int count, string orderID, long price)
-        {
-            ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(buyID);
-            if(shopCfg == null)
-            {
-                Log.Error($"recharge {buyID} config not found!");
-                return;
-            }
-        }
-
-        public void Exit()
-        {
-        }
-    }
-}

+ 9 - 9
GameClient/Assets/Game/HotUpdate/Utils/LogUtil.cs

@@ -34,25 +34,26 @@ namespace GFGGame
 
         public static void LogDev(string content)
         {
-            if(LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
+            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
+                LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
             {
                 Debug.Log($"dev log : {content}");
             }
-
         }
 
         public static void LogFormatDev(string content, params object[] args)
         {
-            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
+            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
+                LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
             {
                 Debug.LogFormat($"dev log : {content}", args);
             }
-
         }
 
         public static void LogWarningDev(string content)
         {
-            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
+            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
+                LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
             {
                 Debug.LogWarning($"dev warning {content}");
             }
@@ -60,12 +61,11 @@ namespace GFGGame
 
         public static void LogWarningFormatDev(string content, params object[] args)
         {
-            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
+            if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
+                LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
             {
                 Debug.LogWarningFormat($"dev warning {content}", args);
             }
         }
-        
     }
-}
-
+}

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

@@ -65,6 +65,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
             EventAgent.AddEventListener(ConstMessage.LOGIN_SUCCESS, OnLoginSuccess);
             EventAgent.AddEventListener(ConstMessage.ON_PLATFORM_SDK_LOGINED, OnPlatformLogined);
+            EventAgent.AddEventListener(ConstMessage.OUT_LOGIN, OnOutLoginSuccess);
         }
         protected override void OnShown()
         {
@@ -120,6 +121,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
             EventAgent.RemoveEventListener(ConstMessage.LOGIN_SUCCESS, OnLoginSuccess);
             EventAgent.RemoveEventListener(ConstMessage.ON_PLATFORM_SDK_LOGINED, OnPlatformLogined);
+            EventAgent.RemoveEventListener(ConstMessage.OUT_LOGIN, OnOutLoginSuccess);
         }
 
         private void UpdateServer(ServerInfo info)
@@ -186,6 +188,7 @@ namespace GFGGame
         private void OnClickBtnLogout()
         {
             ResetLoginButton();
+            QDDouYouManager.Instance.LoginOutBefore();
             QDManager.Logout(false);
         }
         private void OnClickBtnAge()
@@ -232,6 +235,11 @@ namespace GFGGame
 
         }
 
+        private void OnOutLoginSuccess(EventContext context)
+        {
+            ResetLoginButton();
+        }
+
         private void ResetLoginButton()
         {
             _ui.m_btnLogout.visible = false;

+ 3 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -146,7 +146,9 @@ namespace GFGGame
             IsTeaParty = (bool)datas[4];
             _autoPlay = _lastStartAutoPlay;
 
-            if (LauncherConfig.ChannelId != (int)ChannelID.Test && !InstanceZonesDataManager.CheckLevelPass(MainStoryDataManager.currentLevelCfgId))
+            if ((LauncherConfig.ChannelId != (int)ChannelID.Test &&
+                 LauncherConfig.ChannelId != (int)ChannelID.DouYouTest) &&
+                !InstanceZonesDataManager.CheckLevelPass(MainStoryDataManager.currentLevelCfgId))
             {
                 // 临时设置都可以跳过对话
                 skipable = false;

+ 2 - 2
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -24,7 +24,7 @@ namespace GFGGame
         //平台id
         public static int platformId = 1;
         //渠道id
-        public static int ChannelId = 2;
+        public static int ChannelId = 101;
         public static string logApiRootUrl;//上报普通日志接口
         public static string logApiReportLauncherUrl;//上报节点日志接口
         public static string apkVersion;
@@ -56,7 +56,7 @@ namespace GFGGame
 #elif PT_DOUYOU
             netType = EnumNetType.LOCAL;
             cfgName = "cfg_douYou";
-            ChannelId = 2;
+            ChannelId = 22;
 #elif PT_IOS
             netType = EnumNetType.PUBLIC;
             cfgName = "cfg_ios";

+ 0 - 4
GameClient/Assets/Game/Launcher/LauncherController.cs

@@ -69,23 +69,19 @@ namespace GFGGame
 
         private static void OnInitPlatform(IEventMessage obj)
         {
-            Debug.Log("init SDK 6");
             LauncherEvent.InitPlatformResult initPlatformResult = obj as LauncherEvent.InitPlatformResult;
             OnInitSDKSuccess();
             if (initPlatformResult != null)
             {
                 if(initPlatformResult.success)
                 {
-                    Debug.Log("init SDK 3");
                     OnInitSDKSuccess();
                 }
                 else
                 {
-                    Debug.Log("init SDK 4");
                     OnInitSDKFail();
                 }
             }
-            Debug.Log("init SDK 5");
         }
 
         private static void OnInitSDKFail()

+ 0 - 130
GameClient/Assets/Game/Launcher/Platform/DouYouSDK.cs

@@ -1,130 +0,0 @@
-using UnityEngine;
-
-namespace GFGGame
-{
-    public class DouYouSDK
-    {
-        private static AndroidJavaClass _unityPlayerClass;
-
-        private static AndroidJavaObject _douYouMainActivity;
-
-        private static DouYouSDK _instance;
-
-        #region basic code
-
-        public static DouYouSDK Instance()
-        {
-            if (null == _instance)
-            {
-                _instance = new DouYouSDK();
-            }
-
-            return _instance;
-        }
-
-        //调用桥接的 DouYouMainActivity.java 对象的方法
-        private void CallDouYouMainActivity(string functionName, params object[] args)
-        {
-            _douYouMainActivity.Call(functionName, args);
-        }
-
-        //临时获取adId,之后需要配置到配置文件里面,已达到热更
-        public string GetAdId()
-        {
-            return "123";
-        }
-
-        #endregion
-
-        /// <summary>
-        /// douYou sdk init
-        /// </summary>
-        /// <param name="adId"></param>
-        public void InitDouYouSdk(string adId)
-        {
-            if (_unityPlayerClass == null)
-            {
-                _unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
-            }
-            
-            if (_douYouMainActivity == null)
-            {
-                _douYouMainActivity = _unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
-            }
-            
-            DouYouSDKHandler eventHandler = GameObject.Find("DouYouSDKGameObject")?.GetComponent<DouYouSDKHandler>();
-            if (eventHandler == null)
-            {
-                GameObject gameObject = new GameObject("DouYouSDKGameObject");
-                gameObject.AddComponent<DouYouSDKHandler>();
-                GameObject.DontDestroyOnLoad(gameObject);
-            }
-            
-            Instance().CallDouYouMainActivity("initDouYou", adId);
-        }
-
-        /// <summary>
-        /// 显示登录界面
-        /// </summary>
-        public void ShowLogin()
-        {
-            Instance().CallDouYouMainActivity("extShowLogin");
-        }
-
-        /// <summary>
-        /// 角色登录数据上报
-        /// </summary>
-        /// <param name="id"></param>
-        /// <param name="level"></param>
-        /// <param name="nickname"></param>
-        /// <param name="sid"></param>
-        public void ReportRoleLogin(string id, string level, string nickname, string sid)
-        {
-            Instance().CallDouYouMainActivity("extReportRoleLogin", id, level, nickname, sid);
-        }
-
-        /// <summary>
-        /// 角色数据上报
-        /// </summary>
-        /// <param name="id"></param>
-        /// <param name="level"></param>
-        /// <param name="nickname"></param>
-        /// <param name="sid"></param>
-        public void ReportRole(string id, string level, string nickname, string sid)
-        {
-            Instance().CallDouYouMainActivity("extReportRole", id, level, nickname, sid);
-        }
-
-        /// <summary>
-        /// 退出登录
-        /// </summary>
-        public void ShowLogout()
-        {
-            Instance().CallDouYouMainActivity("extShowLogout");
-        }
-
-        /// <summary>
-        /// 退出app
-        /// </summary>
-        public void ExitApp()
-        {
-            Instance().CallDouYouMainActivity("extExitApp");
-        }
-
-        /// <summary>
-        /// 调起支付
-        /// </summary>
-        public void ShowSwitchPayment()
-        {
-            Instance().CallDouYouMainActivity("extShowSwitchPayment");
-        }
-
-        /// <summary>
-        /// cp激励广告订单id  登录后用户uid  角色id
-        /// </summary>
-        public void OpenGroMoreAD()
-        {
-            Instance().CallDouYouMainActivity("extOpenGroMoreAD");
-        }
-    }
-}

+ 0 - 3
GameClient/Assets/Game/Launcher/Platform/DouYouSDK.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 10baa181105045be95931d1e13c67422
-timeCreated: 1716439909

+ 0 - 132
GameClient/Assets/Game/Launcher/Platform/DouYouSDKHandler.cs

@@ -1,132 +0,0 @@
-using UniFramework.Event;
-using UnityEngine;
-
-namespace GFGGame
-{
-    public class DouYouSDKHandler : MonoBehaviour
-    {
-        /// <summary>
-        /// 测试消息
-        /// </summary>
-        /// <param name="message"></param>
-        public void ReceiveMessage(string message)
-        {
-            Debug.Log(message);
-        }
-
-        /// <summary>
-        /// SDK实例化成功
-        /// </summary>
-        /// <param name="message">SDK 实例化成功</param>
-        public void InitSuccess(string message)
-        {
-            Debug.Log("InitSuccess: " + message);
-            UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true });
-        }
-
-        /// <summary>
-        /// 登录成功 
-        /// </summary>
-        /// <param name="message">resUid + "|gfg|" + token</param>
-        public void LoginSuccess(string message)
-        {
-            Debug.Log("LoginSuccess: " + message);
-        }
-
-        /// <summary>
-        /// 切换账号或退出登录后
-        /// </summary>
-        /// <param name="message">退出登录成功!</param>
-        public void OutLoginSuccess(string message)
-        {
-            Debug.Log("OutLoginSuccess: " + message);
-        }
-
-        /// <summary>
-        /// 支付失败
-        /// </summary>
-        /// <param name="message">code + "|gfg|" + params.toString()</param>
-        public void PayFail(string message)
-        {
-            Debug.Log("PayFail: " + message);
-        }
-
-        /// <summary>
-        /// 支付成功
-        /// </summary>
-        /// <param name="message">code + "|gfg|" + params.toString()</param>
-        public void PaySuccess(string message)
-        {
-            Debug.Log("PaySuccess" + message);
-        }
-
-        #region SDK 生命周期函数
-
-        public void SdkOnStart(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnPause(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnResume(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnStop(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnDestroy(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnRestart(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnBackPressed(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnNewIntent(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnConfigurationChanged(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnSaveInstanceState(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnActivityResult(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnRequestPermissionResult(string message)
-        {
-            Debug.Log(message);
-        }
-
-        public void SdkOnWindowFocusChanged(string message)
-        {
-            Debug.Log(message);
-        }
-
-        #endregion
-    }
-}

+ 0 - 3
GameClient/Assets/Game/Launcher/Platform/DouYouSDKHandler.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 89ac2783d2654ff2b67dc864f26e7e6a
-timeCreated: 1716797814

+ 43 - 0
GameClient/Assets/Game/Launcher/Platform/IDouYouSDKListener.cs

@@ -0,0 +1,43 @@
+namespace GFGGame.Launcher
+{
+    public interface IDouYouSDKListener
+    {
+        //public void ReceiveMessageAb(string message);
+
+        //public void InitSuccessAb(string message);
+
+        public void LoginSuccessAb(string message);
+
+        public void OutLoginSuccessAb(string message);
+
+        public void PayFailAb(string message);
+
+        public void PaySuccessAb(string message);
+
+        public void SdkOnStartAb(string message);
+
+        //public void SdkOnPauseAb(string message);
+
+        //public void SdkOnResumeAb(string message);
+
+        public void SdkOnStopAb(string message);
+
+        public void SdkOnDestroyAb(string message);
+
+        public void SdkOnRestartAb(string message);
+
+        public void SdkOnBackPressedAb(string message);
+
+        public void SdkOnNewIntentAb(string message);
+
+        public void SdkOnConfigurationChangedAb(string message);
+
+        public void SdkOnSaveInstanceStateAb(string message);
+
+        public void SdkOnActivityResultAb(string message);
+
+        //public void SdkOnRequestPermissionResultAb(string message);
+
+        //public void SdkOnWindowFocusChangedAb(string message);
+    }
+}

+ 3 - 0
GameClient/Assets/Game/Launcher/Platform/IDouYouSDKListener.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c168a0d8ddff434888ae2bc9459fb14d
+timeCreated: 1716878448

+ 302 - 0
GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInit.cs

@@ -0,0 +1,302 @@
+using DouYouSdk;
+using UniFramework.Event;
+using UnityEngine;
+
+namespace GFGGame.Launcher
+{
+    public class QDDouYouManagerInit : SingletonBase<QDDouYouManagerInit>
+    {
+        public IDouYouSDKListener douYouSDKListener;
+
+        private static AndroidJavaClass _unityPlayerClass;
+
+        private static AndroidJavaObject _douYouMainActivity;
+
+        public void InitSDK(string adId)
+        {
+            if (_unityPlayerClass == null)
+            {
+                _unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
+            }
+
+            if (_douYouMainActivity == null)
+            {
+                _douYouMainActivity = _unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
+            }
+
+            DouYouSDKHandler eventHandler = GameObject.Find("DouYouSDKGameObject")?.GetComponent<DouYouSDKHandler>();
+            if (eventHandler == null)
+            {
+                GameObject gameObject = new GameObject("DouYouSDKGameObject");
+                gameObject.AddComponent<DouYouSDKHandler>();
+                GameObject.DontDestroyOnLoad(gameObject);
+            }
+
+            Instance.CallDouYouMainActivity("initDouYou", adId);
+        }
+
+        //调用桥接的 DouYouMainActivity.java 对象的方法
+        private void CallDouYouMainActivity(string functionName, params object[] args)
+        {
+            _douYouMainActivity.Call(functionName, args);
+        }
+
+        //临时获取adId,之后需要配置到配置文件里面,已达到热更
+        public string GetAdId()
+        {
+            return "123";
+        }
+
+        /// <summary>
+        /// 显示登录界面
+        /// </summary>
+        public void ShowLogin()
+        {
+            Instance.CallDouYouMainActivity("extShowLogin");
+        }
+
+        /// <summary>
+        /// 角色登录数据上报
+        /// </summary>
+        /// <param name="id">角色ID</param>
+        /// <param name="level">角色等级</param>
+        /// <param name="nickname">角色名称</param>
+        /// <param name="sid">区服ID</param>
+        /// <param name="serverName">区服名称</param>
+        public void ReportRoleLogin(string id, string level, string nickname, string sid, string serverName)
+        {
+            Instance.CallDouYouMainActivity("extReportRoleLogin", id, level, nickname, sid, serverName);
+        }
+
+        /// <summary>
+        /// 角色数据上报
+        /// </summary>
+        /// <param name="logType">场景(1 - 进入游戏、2 - 创建角色、3 - 角色升级、4 - 退出、5 - 充值)</param>
+        /// <param name="id">角色ID</param>
+        /// <param name="level">角色等级</param>
+        /// <param name="nickname">角色名称</param>
+        /// <param name="sid">区服ID</param>
+        /// <param name="serverName">区服名称</param>
+        public void ReportRole(int logType, string id, string level, string nickname, string sid, string serverName)
+        {
+            Instance.CallDouYouMainActivity("extReportRole", logType, id, level, nickname, sid, serverName);
+        }
+
+        /// <summary>
+        /// 退出登录
+        /// </summary>
+        public void ShowLogout()
+        {
+            Instance.CallDouYouMainActivity("extShowLogout");
+        }
+
+        /// <summary>
+        /// 退出app
+        /// </summary>
+        public void ExitApp()
+        {
+            Instance.CallDouYouMainActivity("extExitApp");
+        }
+
+        /// <summary>
+        /// 调起支付
+        /// </summary>
+        /// <param name="orderId">订单号</param>
+        /// <param name="orderMoney">订单金额(元)</param>
+        /// <param name="productId">产品ID</param>
+        /// <param name="productName">产品名称</param>
+        /// <param name="productDesc">产品描述</param>
+        /// <param name="roleServiceId">区服ID</param>
+        /// <param name="serviceName">区服名称</param>
+        /// <param name="roleId">角色ID</param>
+        /// <param name="roleName">角色名称</param>
+        /// <param name="roleLevel">角色等级</param>
+        /// <param name="other">透传参数</param>
+        public void ShowSwitchPayment(string orderId, string orderMoney, string productId, string productName,
+            string productDesc, string roleServiceId, string serviceName, string roleId, string roleName,
+            string roleLevel, string other)
+        {
+            Instance.CallDouYouMainActivity("extShowSwitchPayment", orderId, orderMoney, productId, productName,
+                productDesc, roleServiceId, serviceName, roleId, roleName, roleLevel, other);
+        }
+
+        /// <summary>
+        /// cp激励广告订单id  登录后用户uid  角色id
+        /// </summary>
+        public void OpenGroMoreAD()
+        {
+            Instance.CallDouYouMainActivity("extOpenGroMoreAD");
+        }
+
+        public class DouYouSDKHandler : AbDouYouSDKHandler
+        {
+            /// <summary>
+            /// 测试消息
+            /// </summary>
+            /// <param name="message"></param>
+            public override void ReceiveMessageAb(string message)
+            {
+                Debug.Log($"ReceiveMessageAb:{message}");
+            }
+
+            /// <summary>
+            /// SDK实例化成功
+            /// </summary>
+            /// <param name="message">SDK 实例化成功</param>
+            public override void InitSuccessAb(string message)
+            {
+                Debug.Log("InitSuccessAb: " + message);
+                UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true });
+            }
+
+            /// <summary>
+            /// 登录成功 
+            /// </summary>
+            /// <param name="message">resUid + "|gfg|" + token</param>
+            public override void LoginSuccessAb(string message)
+            {
+                Debug.Log("LoginSuccessAb: " + message);
+                QDDouYouManagerInit.Instance.douYouSDKListener.LoginSuccessAb(message);
+            }
+
+            /// <summary>
+            /// 切换账号或退出登录后
+            /// </summary>
+            /// <param name="message">退出登录成功!</param>
+            public override void OutLoginSuccessAb(string message)
+            {
+                Debug.Log("OutLoginSuccessAb: " + message);
+                QDDouYouManagerInit.Instance.douYouSDKListener.OutLoginSuccessAb(message);
+            }
+
+            /// <summary>
+            /// 支付失败
+            /// </summary>
+            /// <param name="message">code + "|gfg|" + params.toString()</param>
+            public override void PayFailAb(string message)
+            {
+                Debug.Log("PayFailAb: " + message);
+                QDDouYouManagerInit.Instance.douYouSDKListener.PayFailAb(message);
+            }
+
+            /// <summary>
+            /// 支付成功
+            /// </summary>
+            /// <param name="message">code + "|gfg|" + params.toString()</param>
+            public override void PaySuccessAb(string message)
+            {
+                Debug.Log("PaySuccessAb" + message);
+                QDDouYouManagerInit.Instance.douYouSDKListener.PaySuccessAb(message);
+            }
+
+            #region SDK 生命周期函数
+
+            public override void SdkOnStartAb(string message)
+            {
+                Debug.Log($"SdkOnStartAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnStartAb(message);
+            }
+
+            public override void SdkOnPauseAb(string message)
+            {
+                Debug.Log($"SdkOnPauseAb:{message}");
+            }
+
+            public override void SdkOnResumeAb(string message)
+            {
+                Debug.Log($"SdkOnResumeAb:{message}");
+            }
+
+            public override void SdkOnStopAb(string message)
+            {
+                Debug.Log($"SdkOnStopAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnStopAb(message);
+            }
+
+            public override void SdkOnDestroyAb(string message)
+            {
+                Debug.Log($"SdkOnDestroyAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnDestroyAb(message);
+            }
+
+            public override void SdkOnRestartAb(string message)
+            {
+                Debug.Log($"SdkOnRestartAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnRestartAb(message);
+            }
+
+            public override void SdkOnBackPressedAb(string message)
+            {
+                Debug.Log($"SdkOnBackPressedAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnBackPressedAb(message);
+            }
+
+            public override void SdkOnNewIntentAb(string message)
+            {
+                Debug.Log($"SdkOnNewIntentAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnNewIntentAb(message);
+            }
+
+            public override void SdkOnConfigurationChangedAb(string message)
+            {
+                Debug.Log($"SdkOnConfigurationChangedAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnConfigurationChangedAb(message);
+            }
+
+            public override void SdkOnSaveInstanceStateAb(string message)
+            {
+                Debug.Log($"SdkOnSaveInstanceStateAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnSaveInstanceStateAb(message);
+            }
+
+            public override void SdkOnActivityResultAb(string message)
+            {
+                Debug.Log($"SdkOnActivityResultAb:{message}");
+                QDDouYouManagerInit.Instance.douYouSDKListener.SdkOnActivityResultAb(message);
+            }
+
+            public override void SdkOnRequestPermissionResultAb(string message)
+            {
+                Debug.Log($"SdkOnRequestPermissionResultAb:{message}");
+            }
+
+            public override void SdkOnWindowFocusChangedAb(string message)
+            {
+                Debug.Log($"SdkOnWindowFocusChangedAb:{message}");
+            }
+
+            #endregion
+        }
+    }
+
+    /// <summary>
+    /// 场景(1 - 进入游戏、2 - 创建角色、3 - 角色升级、4 - 退出、5 - 充值)
+    /// </summary>
+    public enum DouYouRoleLogReportType
+    {
+        /// <summary>
+        /// 进入游戏
+        /// </summary>
+        EnterGame = 1,
+
+        /// <summary>
+        /// 创建角色
+        /// </summary>
+        CreateRole = 2,
+
+        /// <summary>
+        /// 角色升级
+        /// </summary>
+        LevelUp = 3,
+
+        /// <summary>
+        /// 退出
+        /// </summary>
+        ExitGame = 4,
+
+        /// <summary>
+        /// 充值
+        /// </summary>
+        Pay = 5
+    }
+}

+ 3 - 0
GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInit.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c49de97f35e74642aaad2761b96369e4
+timeCreated: 1716879846

+ 9 - 15
GameClient/Assets/Game/Launcher/Platform/QDManagerInit.cs

@@ -9,27 +9,25 @@ namespace GFGGame.Launcher
             switch (LauncherConfig.ChannelId)
             {
                 default:
-                    DouYouSDK.Instance().InitDouYouSdk(DouYouSDK.Instance().GetAdId());
+                    QDDouYouManagerInit.Instance.InitSDK(QDDouYouManagerInit.Instance.GetAdId());
                     break;
             }
         }
 
         public static void UpdateApp()
         {
-            switch(LauncherConfig.ChannelId)
+            switch (LauncherConfig.ChannelId)
             {
                 default:
-                    if(!string.IsNullOrEmpty(LauncherConfig.updateUrl))
+                    if (!string.IsNullOrEmpty(LauncherConfig.updateUrl))
                     {
                         if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
                         {
                             LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
                         }
+
                         Alert.Show(LauncherConfig.updateAppPrompt)
-                                .SetLeftButton(true, "前往更新", (data) =>
-                                {
-                                    Application.OpenURL(LauncherConfig.updateUrl);
-                                });
+                            .SetLeftButton(true, "前往更新", (data) => { Application.OpenURL(LauncherConfig.updateUrl); });
                     }
                     else
                     {
@@ -37,17 +35,13 @@ namespace GFGGame.Launcher
                         {
                             LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
                         }
-                        Alert.Show(LauncherConfig.updateAppPrompt)
-                                .SetLeftButton(true, "知道了", (data) =>
-                                {
 
-                                    Application.Quit();
-                                });
+                        Alert.Show(LauncherConfig.updateAppPrompt)
+                            .SetLeftButton(true, "知道了", (data) => { Application.Quit(); });
                     }
+
                     break;
             }
         }
-
     }
-}
-
+}

+ 30 - 12
GameClient/Assets/Plugins/com/easy/bridge/DouYouMainActivity.java

@@ -88,24 +88,39 @@ public class DouYouMainActivity extends UnityPlayerActivity
     }
 
     //角色登录数据上报
-    public void extReportRoleLogin(String id, String level, String nickname, String sid){
+    public void extReportRoleLogin(String id, String level, String nickname, String sid, String serverName){
         RoleInfoBean roleInfo = new RoleInfoBean();
         roleInfo.setType(RoleInfoBean.TYPE_ENTER_GAME);
+        roleInfo.setSid(sid);
+        roleInfo.setServerName(serverName);
         roleInfo.setId(id);
-        roleInfo.setLevel(level);
         roleInfo.setNickname(nickname);
-        roleInfo.setSid(sid);
+        roleInfo.setLevel(level);
+       
         DouYou.getInstance().reportRoleLogin(DouYouMainActivity.this, roleInfo);
     }
 
     //角色数据上报
-    public void extReportRole(String id, String level, String nickname, String sid){
+    public void extReportRole(int logType, String id, String level, String nickname, String sid, String serverName){
         RoleInfoBean roleInfo = new RoleInfoBean();
-        roleInfo.setType(RoleInfoBean.TYPE_CREATE_ROLE);
+        roleInfo.setType(logType);
+        roleInfo.setSid(sid);
+        roleInfo.setServerName(serverName);
         roleInfo.setId(id);
-        roleInfo.setLevel(level);
         roleInfo.setNickname(nickname);
-        roleInfo.setSid(sid);;
+        roleInfo.setLevel(level);
+
+        // 获取当前时间的毫秒级时间戳
+        long currentTimeMillis = System.currentTimeMillis();
+        // 将毫秒级时间戳转换为秒级时间戳
+        long currentTimeSeconds = currentTimeMillis / 1000;
+        if(logType == RoleInfoBean.TYPE_CREATE_ROLE){
+            roleInfo.setRoleCreateTime(currentTimeSeconds + "");
+        }
+        else if(logType == RoleInfoBean.TYPE_LEVEL_UP){
+            roleInfo.setRoleLevelUpTime(currentTimeSeconds + "");
+        }
+
         DouYou.getInstance().reportRole(DouYouMainActivity.this, roleInfo);
     }
 
@@ -125,17 +140,20 @@ public class DouYouMainActivity extends UnityPlayerActivity
     }
 
     //调起支付
-    public void extShowSwitchPayment(String orderId, String productDesc, String orderMoney, String other, String productName, String roleId, String roleLevel, String roleName, String roleServiceId){
+    public void extShowSwitchPayment(String orderId, String orderMoney, String productId, String productName, String productDesc, String roleServiceId, String serviceName, String roleId, String roleName, String roleLevel, String other){
         OrderInfoBean orderInfoBean = new OrderInfoBean();
         orderInfoBean.setOrderID(orderId);
-        orderInfoBean.setProductDesc(productDesc);
         orderInfoBean.setCpOrderMoney(orderMoney);
-        orderInfoBean.setOther(other);
+        orderInfoBean.setProductId(productId);
         orderInfoBean.setProductName(productName);
+        orderInfoBean.setProductDesc(productDesc);
+        orderInfoBean.setRoleServiceId(roleServiceId);
+        orderInfoBean.setRoleServiceName(serviceName);
         orderInfoBean.setRoleId(roleId);
-        orderInfoBean.setRoleLevel(roleLevel);
         orderInfoBean.setRoleName(roleName);
-        orderInfoBean.setRoleServiceId(roleServiceId);
+        orderInfoBean.setRoleLevel(roleLevel);
+        orderInfoBean.setOther(other);
+        
         DouYou.getInstance().showSwitchPayment(DouYouMainActivity.this, orderInfoBean);
     }
 

+ 3 - 0
GameClient/Assets/ThirdParty/DouYou.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 0caa5567c85d4ff0be643b7a4b605c74
+timeCreated: 1716878286

+ 187 - 0
GameClient/Assets/ThirdParty/DouYou/AbDouYouSDKHandler.cs

@@ -0,0 +1,187 @@
+using UnityEngine;
+
+namespace DouYouSdk
+{
+    public abstract class AbDouYouSDKHandler : MonoBehaviour
+    {
+        public abstract void ReceiveMessageAb(string message);
+
+        public abstract void InitSuccessAb(string message);
+
+        public abstract void LoginSuccessAb(string message);
+
+        public abstract void OutLoginSuccessAb(string message);
+
+        public abstract void PayFailAb(string message);
+
+        public abstract void PaySuccessAb(string message);
+
+        public abstract void SdkOnStartAb(string message);
+
+        public abstract void SdkOnPauseAb(string message);
+
+        public abstract void SdkOnResumeAb(string message);
+
+        public abstract void SdkOnStopAb(string message);
+
+        public abstract void SdkOnDestroyAb(string message);
+
+        public abstract void SdkOnRestartAb(string message);
+
+        public abstract void SdkOnBackPressedAb(string message);
+
+        public abstract void SdkOnNewIntentAb(string message);
+
+        public abstract void SdkOnConfigurationChangedAb(string message);
+
+        public abstract void SdkOnSaveInstanceStateAb(string message);
+
+        public abstract void SdkOnActivityResultAb(string message);
+
+        public abstract void SdkOnRequestPermissionResultAb(string message);
+
+        public abstract void SdkOnWindowFocusChangedAb(string message);
+
+        /// <summary>
+        /// 测试消息
+        /// </summary>
+        /// <param name="message"></param>
+        public void ReceiveMessage(string message)
+        {
+            Debug.Log($"ReceiveMessage:{message}");
+            ReceiveMessageAb(message);
+        }
+
+        /// <summary>
+        /// SDK实例化成功
+        /// </summary>
+        /// <param name="message">SDK 实例化成功</param>
+        public void InitSuccess(string message)
+        {
+            Debug.Log($"InitSuccess:{message}");
+            InitSuccessAb(message);
+        }
+
+        /// <summary>
+        /// 登录成功 
+        /// </summary>
+        /// <param name="message">resUid + "|gfg|" + token</param>
+        public void LoginSuccess(string message)
+        {
+            Debug.Log($"LoginSuccess:{message}");
+            LoginSuccessAb(message);
+        }
+
+        /// <summary>
+        /// 切换账号或退出登录后
+        /// </summary>
+        /// <param name="message">退出登录成功!</param>
+        public void OutLoginSuccess(string message)
+        {
+            Debug.Log($"OutLoginSuccess:{message}");
+            OutLoginSuccessAb(message);
+        }
+
+        /// <summary>
+        /// 支付失败
+        /// </summary>
+        /// <param name="message">code + "|gfg|" + params.toString()</param>
+        public void PayFail(string message)
+        {
+            Debug.Log($"PayFail:{message}");
+            PayFailAb(message);
+        }
+
+        /// <summary>
+        /// 支付成功
+        /// </summary>
+        /// <param name="message">code + "|gfg|" + params.toString()</param>
+        public void PaySuccess(string message)
+        {
+            Debug.Log($"PaySuccess:{message}");
+            PaySuccessAb(message);
+        }
+
+        #region SDK 生命周期函数
+
+        public void SdkOnStart(string message)
+        {
+            Debug.Log($"SdkOnStart:{message}");
+            SdkOnStartAb(message);
+        }
+
+        public void SdkOnPause(string message)
+        {
+            Debug.Log($"SdkOnPause:{message}");
+            SdkOnPauseAb(message);
+        }
+
+        public void SdkOnResume(string message)
+        {
+            Debug.Log($"SdkOnResume:{message}");
+            SdkOnResumeAb(message);
+        }
+
+        public void SdkOnStop(string message)
+        {
+            Debug.Log($"SdkOnStop:{message}");
+            SdkOnStopAb(message);
+        }
+
+        public void SdkOnDestroy(string message)
+        {
+            Debug.Log($"SdkOnDestroy:{message}");
+            SdkOnDestroyAb(message);
+        }
+
+        public void SdkOnRestart(string message)
+        {
+            Debug.Log($"SdkOnRestart:{message}");
+            SdkOnRestartAb(message);
+        }
+
+        public void SdkOnBackPressed(string message)
+        {
+            Debug.Log($"SdkOnBackPressed:{message}");
+            SdkOnBackPressedAb(message);
+        }
+
+        public void SdkOnNewIntent(string message)
+        {
+            Debug.Log($"SdkOnNewIntent:{message}");
+            SdkOnNewIntentAb(message);
+        }
+
+        public void SdkOnConfigurationChanged(string message)
+        {
+            Debug.Log($"SdkOnConfigurationChanged:{message}");
+            SdkOnConfigurationChangedAb(message);
+        }
+
+        public void SdkOnSaveInstanceState(string message)
+        {
+            Debug.Log($"SdkOnSaveInstanceState:{message}");
+            SdkOnSaveInstanceStateAb(message);
+        }
+
+        public void SdkOnActivityResult(string message)
+        {
+            Debug.Log($"SdkOnActivityResult:{message}");
+            SdkOnActivityResultAb(message);
+        }
+
+        public void SdkOnRequestPermissionResult(string message)
+        {
+            Debug.Log($"SdkOnRequestPermissionResult:{message}");
+            SdkOnRequestPermissionResultAb(message);
+        }
+
+        public void SdkOnWindowFocusChanged(string message)
+        {
+            Debug.Log($"SdkOnWindowFocusChanged:{message}");
+            SdkOnWindowFocusChangedAb(message);
+        }
+
+        #endregion
+    }
+}

+ 3 - 0
GameClient/Assets/ThirdParty/DouYou/AbDouYouSDKHandler.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ed783d57964f41caa79087577300176d
+timeCreated: 1716876681