From bc6f633a2f3cfc01122d8fd4452f69313ddcb32b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 28 二月 2026 20:44:47 +0800
Subject: [PATCH] 519 子 硬核渠道对接 / 硬核渠道对接

---
 Main/SDK/SDKUtils.cs |  320 ++++++++++++++++++++++-------------------------------
 1 files changed, 132 insertions(+), 188 deletions(-)

diff --git a/Main/SDK/SDKUtils.cs b/Main/SDK/SDKUtils.cs
index 8ba419a..25404d2 100644
--- a/Main/SDK/SDKUtils.cs
+++ b/Main/SDK/SDKUtils.cs
@@ -21,6 +21,7 @@
         Free = 1,// 榛樿
         Quick = 10, //quick
         Hy = 15, //娆㈡父
+        Gaore = 20, // 20-楂樼儹 - 纭牳娓犻亾
     }
 
     //鏉冮檺鐢宠鍥炶皟
@@ -483,6 +484,10 @@
                         {
                             ChannelPlatform = E_ChannelPlatform.Quick;
                         }
+                        else if (_channelPlatform.Equals("gaore"))
+                        {
+                            ChannelPlatform = E_ChannelPlatform.Gaore;
+                        }
   
                     }
                 }
@@ -615,6 +620,16 @@
                     Application.Quit();
                 }
                 break;
+            case CodeA2U.GetAdAward:
+                if (AdsManager.Instance.waitAdID > 0)
+                {
+                    AdsManager.Instance.GetAdsAward(AdsManager.Instance.waitAdID);
+                    AdsManager.Instance.waitAdID = 0;
+                }
+                break;
+            case CodeA2U.AdLoadFail:
+                AdsManager.Instance.lastLoadErrorTime = Time.time;
+                break;
         }
         onSdkMsg?.Invoke(_code, _json);
     }
@@ -696,6 +711,8 @@
         public const int PingfenCallBack = 113;  //璇勫垎鍥炶皟 鍜� GotoShopOK 涓嶄竴鏍� 鍏蜂綋鐪嬩娇鐢ㄥ尯鍒�
         public const int GotoShopOK = 115;  //鍓嶅線鍟嗗簵鎴愬姛
         public const int GotoFBOK = 116;
+        public const int GetAdAward = 117;   //骞垮憡鎾斁鎴愬姛鍙戞斁濂栧姳
+        public const int AdLoadFail = 118;   //骞垮憡鍔犺浇澶辫触
         #endregion
     }
 
@@ -780,11 +797,7 @@
         public const int FansHouse = 120; //绮変笣灞� 璁哄潧绛�
         public const int GotoShop = 121; //鍓嶅線鍟嗗簵
         public const int TrackEvent = 122; //鑷畾涔変簨浠�
-        /**
-         * 鏋佸厜鎺ㄩ��
-         * */
-        public const int JPushAddLocalMessage = 200;
-        public const int JPushRemoveLocalMessage = 201;
+        public const int PlayAds = 123; //鎾斁骞垮憡
         /**
          * IOS鐗规畩闇�姹�
          */
@@ -824,7 +837,7 @@
         public int totalMemory;
     }
 
-    #region 鑷敱sdk鐩稿叧
+    #region sdk鐩稿叧
 
     public UnityAction onFreePlatformInitOk;
     public UnityAction onFreePlatformInitFail;
@@ -881,17 +894,9 @@
 #endif
     }
 
-    public void FreePlatformBindPhone()
-    {
-#if UNITY_ANDROID
-        AndroidJavaClass _jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
-        AndroidJavaObject _jo = _jc.GetStatic<AndroidJavaObject>("currentActivity");
-        _jo.Call("BindPhone");
-#endif
-    }
 
     /// <summary>
-    /// 鑷敱SDK鐧婚檰
+    /// SDK鐧婚檰
     /// </summary>
     public void FreePlatformLogin()
     {
@@ -900,18 +905,6 @@
         SendMessageToSDK(m_Json);
     }
 
-    public void TencentLogin(string param)
-    {
-#if !UNITY_EDITOR
-        m_Json.Clear();
-        m_Json["code"] = CodeU2A.TencentLogin;
-        if (!string.IsNullOrEmpty(param))
-        {
-            m_Json["param"] = param;
-        }
-        SendMessageToSDK(m_Json);
-#endif
-    }
 
     /// <summary>
     /// 鑷敱SDK鐧诲嚭
@@ -925,28 +918,7 @@
         // FreePlatformLogin();
 #endif
     }
-    public void ShowAccountView()
-    {
-#if !UNITY_EDITOR
-        m_Json.Clear();
-        m_Json["code"] = CodeU2A.ShowAccountView;
-        SendMessageToSDK(m_Json);
 
-        // FreePlatformLogin();
-        
-#endif
-    }
-    public void FreePlatformSwitchAccount()
-    {
-#if UNITY_ANDROID
-        AndroidJavaClass _jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
-        AndroidJavaObject _jo = _jc.GetStatic<AndroidJavaObject>("currentActivity");
-        _jo.Call("SwitchAccount");
-#endif
-    }
-
-    private Dictionary<string, string> m_PaymentTable = new Dictionary<string, string>();
-    private string m_EncodeKey = "03sujm7gerywdvyd5vkkk772rs4by230";
 
 
     
@@ -1058,6 +1030,7 @@
         m_Json["createTime"] = TimeUtility.CreateSeconds.ToString();
         m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString();
         m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString();
+        m_Json["num"] = 1;
 
 #if UNITY_IOS
         m_Json["identifier"] = VersionConfig.Get().bundleIdentifier;
@@ -1066,54 +1039,6 @@
     }
 
 
-    /// <summary>
-    ///  鍒嗕韩鍒癴acebook
-    /// /// </summary>
-    public void ShareToFaceBook(int type)
-    {
-        // Debug.Log("瓒婂崡鍒嗕韩");
-        // m_Json.Clear();
-        // m_Json["code"] = CodeU2A.ShareToFaceBook;
-        // m_Json["type"] = type;
-        // SendMessageToSDK(m_Json);
-    }
-
-    /// <summary>
-    /// 鍘诲晢搴楄瘎璁�
-    /// </summary>
-    public void GoToPingfen()
-    {
-        // Debug.Log("瓒婂崡璇勫垎");
-        // m_Json.Clear();
-        // m_Json["code"] = CodeU2A.GoToPingfen;
-        // SendMessageToSDK(m_Json);
-    }
-
-    //鍓嶅線鍟嗗簵
-    public void GoToShop()
-    {
-        // m_Json.Clear();
-        // m_Json["code"] = CodeU2A.GotoShop;
-        // SendMessageToSDK(m_Json);
-    }
-
-
-    /**
-     * @param context
-     * @param event 浜嬩欢鍚�
-     * @param value 浜嬩欢鍊硷紝濡傛灉娌℃湁鍙互浼�""
-     * @param isRepeatReport 鏄惁閲嶅涓婃姤銆傛牴鎹繍钀ラ渶姹傛槸鍚︽帓閲嶄笂鎶ワ紝true鍙互閲嶅涓婃姤锛宖alse浠呬笂鎶ヤ竴娆�
-     */
-    public void TraceEvent(string eventName, string value, bool isRepeatReport)
-    {
-        // Debug.Log("瓒婂崡浜嬩欢姹囨姤 锛�" + eventName);
-        // m_Json.Clear();
-        // m_Json["code"] = CodeU2A.TrackEvent;
-        // m_Json["eventName"] = eventName;
-        // m_Json["value"] = value;
-        // m_Json["isRepeatReport"] = isRepeatReport;
-        // SendMessageToSDK(m_Json);
-    }
 
     private void BuildFreePlatformInfo(JsonData json)
     {
@@ -1167,10 +1092,6 @@
         FreePlatformInfo.phone = 0;
     }
 
-    private void HandleFreePlatformRegisteOk(JsonData json)
-    {
-        // BuildFreePlatformInfo(json);
-    }
 
     private void HandleFreePlatformLoginOk(JsonData data)
     {
@@ -1183,46 +1104,6 @@
         }
     }
 
-
-    // public void OnServerChargeOk(HA106_tagMCCoinToGoldReport pack)
-    // {
-    //     string orderID = pack.OrderID;
-    //     uint coin = pack.Coin;
-    //     OperationLogCollect.Instance.RecordEvent(9, coin);
-
-    //     if (onFreePlatformPayOk != null)
-    //     {
-    //         onFreePlatformPayOk();
-    //     }
-
-    //     m_Json.Clear();
-    //     m_Json["code"] = CodeU2A.PayFinished;
-    //     m_Json["orderID"] = orderID;
-    //     m_Json["payType"] = "_default_";
-    //     m_Json["moneyType"] = "CNY";
-    //     m_Json["money"] = (float)coin / 100;
-    //     SendMessageToSDK(m_Json);
-    // }
-
-    public void SendRegistEvent(bool _ok, string _result)
-    {
-        if (_ok)
-        {
-            if (!_result.Equals("0"))
-            {
-                m_Json.Clear();
-                m_Json["code"] = CodeU2A.SendRegistEvent;
-                SendMessageToSDK(m_Json);
-            }
-        }
-    }
-
-    public void SendLoginEvent()
-    {
-        m_Json.Clear();
-        m_Json["code"] = CodeU2A.SendLoginEvent;
-        SendMessageToSDK(m_Json);
-    }
 
     public void SendHideFloatWin()
     {
@@ -1240,6 +1121,12 @@
 
     public void CreateRoleOk(string roleID, string roleName, string time)
     {
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            SendGaoreEvent(2);
+            return;
+        }
+
         m_Json.Clear();
         m_Json["code"] = CodeU2A.CreateRole;
 
@@ -1277,6 +1164,11 @@
 
     public void RoleLogin()
     {
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            SendGaoreEvent(3);
+            return;
+        }
         m_Json.Clear();
         m_Json["code"] = CodeU2A.RoleLogin;
 
@@ -1296,8 +1188,84 @@
         SendMessageToSDK(m_Json);
     }
 
+
+    void SendGaoreEvent(int dataType, string pageType = "鏃�", string pageName = "鏃�", string pageItemId = "鏃�",
+        int money = 0, string orderID = "")
+    {
+        m_Json.Clear();
+        m_Json["code"] = CodeU2A.TrackEvent;
+        m_Json["dataType"] = dataType;
+        m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag;
+        m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
+        m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
+        m_Json["level"] = PlayerDatas.Instance.baseData.LV;
+        m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID;
+        m_Json["orderId"] = orderID;
+        m_Json["mount"] = money;    //鍏呭�煎垎
+        m_Json["money"] = PlayerDatas.Instance.baseData.diamond;
+        m_Json["createTime"] = TimeUtility.CreateSeconds < 0 ? 0 : TimeUtility.CreateSeconds;
+        m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId;
+        m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
+        m_Json["familyLV"] = PlayerDatas.Instance.fairyData.fairy != null ? PlayerDatas.Instance.fairyData.fairy.FamilyLV.ToString() : "0";
+        m_Json["familyLeaderName"] = PlayerDatas.Instance.fairyData.fairy != null ? PlayerDatas.Instance.fairyData.fairy.LeaderName : "";
+        m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower;
+        m_Json["job"] = 0;
+        m_Json["jobName"] = "鏃�";
+        m_Json["sex"] = "鏃�";
+        m_Json["jobID"] = 0;
+        m_Json["jobIDName"] = "鏃�";
+        m_Json["vipLevel"] = 0;
+        if (PlayerDatas.Instance.fairyData.mine != null && PlayerDatas.Instance.fairyData.mine.FmLV > 0)
+        {
+            if (PlayerDatas.Instance.fairyData.mine.FmLV == 3)
+            {
+                m_Json["faimilyRoleID"] = 1;
+            }
+            else if (PlayerDatas.Instance.fairyData.mine.FmLV == 2)
+            {
+                m_Json["faimilyRoleID"] = 2;
+            }
+            else
+            {
+                m_Json["faimilyRoleID"] = 3;
+            }
+
+            m_Json["faimilyRoleName"] = RichTextMsgReplaceConfig.GetRichReplace("FAMILY", PlayerDatas.Instance.fairyData.mine.FmLV);
+        }
+        else
+        {
+            m_Json["faimilyRoleID"] = 0;
+            m_Json["faimilyRoleName"] = "鏃�";
+        }
+        m_Json["opentime"] = 0;
+        m_Json["pageType"] = pageType;
+        m_Json["pageName"] = pageName;
+        m_Json["pageItemId"] = pageItemId;
+
+        SendMessageToSDK(m_Json);
+
+    }
+
+    //浜嬩欢璁板綍
+    public void SendTraceEvent(int dataType, string pageType = "鏃�", string pageName = "鏃�", string pageItemId = "鏃�",
+        int money = 0, string orderID = "")
+    {
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            SendGaoreEvent(dataType, pageType, pageName, pageItemId, money, orderID);
+            return;
+        }
+    }
+
     public void RoleLevelUp()
     {
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            SendGaoreEvent(4);
+            return;
+        }
+
+
         m_Json.Clear();
         m_Json["code"] = CodeU2A.RoleLevelUp;
 
@@ -1323,9 +1291,15 @@
     {
         if (PlayerDatas.Instance.PlayerId == 0)
             return;
-        
-        if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin) 
+
+        if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
             return;
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            SendGaoreEvent(5);
+            return;
+        }
+
 
         m_Json.Clear();
         m_Json["code"] = CodeU2A.RoleLoginOut;
@@ -1347,60 +1321,30 @@
         SendMessageToSDK(m_Json);
     }
 
-    public void GotoFansHouse()
-    {
-        Debug.Log("瓒婂崡鐐硅禐");
-        m_Json.Clear();
-        m_Json["code"] = CodeU2A.FansHouse;
 
-        SendMessageToSDK(m_Json);
-    }
-
-#endregion
-
-    #region 鎻掍欢鐩稿叧
 
     #endregion
 
-    #region 鏋佸厜鎺ㄩ�佺浉鍏�
-    public void GeTui_SendLocalMessage(JsonData jsonData)
+    #region 骞垮憡
+    //type涓�0绔嬪嵆鎾斁瑙嗛锛�1涓洪鍔犺浇
+    public void PlayAds(string adid)
     {
-        return;
-        Debug.Log("GeTui_SendLocalMessage:" + jsonData["id"]);
-        //      ------ 涓句緥 ------
-        //		JsonData _params = new JsonData ();
-        //		_params ["code"] = 2005;
-        //		_params ["id"] = 5;// id 閲嶈, 鏍囩ず姣忎釜閫氱煡鐨勬洿鏂版垨鑰呯Щ闄�
-        //		_params ["title"] = "the title";// 鎺ㄩ�佹爣棰�
-        //		_params ["subtitle"] = "the subtitle";// 鍓爣棰�
-        //		_params ["content"] = "the content";// 鍏蜂綋鍐呭
-        //		_params ["badge"] = -1;// 瑙掓爣
-        //
-        //		// 浠ヤ笅涓哄喅瀹氬簲璇ュ涔呭悗寮瑰嚭姝ら�氱煡
-        //		System.TimeSpan ts = System.DateTime.UtcNow - new System.DateTime (1970, 1, 1, 0, 0, 0, 0);
-        //		long ret = System.Convert.ToInt64 (ts.TotalSeconds) + 3;// 琛ㄧず3绉掑悗
-        //		_params ["fireTime"] = ret;
-#if !UNITY_EDITOR
-        jsonData["code"] = CodeU2A.JPushAddLocalMessage;
-#if UNITY_ANDROID
-        jsonData["fireTime"] = (long)jsonData["fireTime"] * 1000;
-#endif
-        SendMessageToSDK(jsonData);
-#endif
-    }
-
-    public void GeTui_RemoveLocalMessage(string id)
-    {
-        return;
-        Debug.Log("GeTui_RemoveLocalMessage:" + id);
-#if !UNITY_EDITOR
         m_Json.Clear();
-        m_Json["code"] = CodeU2A.JPushRemoveLocalMessage;
-        m_Json["id"] = id;// id 閲嶈, 鏍囩ず姣忎釜閫氱煡鐨勬洿鏂版垨鑰呯Щ闄�
-
+        m_Json["code"] = CodeU2A.PlayAds;
+        m_Json["adid"] = adid;  
+        m_Json["type"] = 0;  
         SendMessageToSDK(m_Json);
-#endif
     }
 
+    //鎵撳紑甯﹀箍鍛婄殑鐣岄潰 鎻愬墠鍔犺浇
+    public void LoadAds(string adid)
+    {
+        m_Json.Clear();
+        m_Json["code"] = CodeU2A.PlayAds;
+        m_Json["adid"] = adid;
+        m_Json["type"] = 1;
+        SendMessageToSDK(m_Json);
+    }
     #endregion
+
 }

--
Gitblit v1.8.0