From f4a702e212d1853735f8dae399da69d23bfa510e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 18:16:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version

---
 Main/System/BoneField/AdsManager.cs |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/Main/System/BoneField/AdsManager.cs b/Main/System/BoneField/AdsManager.cs
index 25c3c99..c24235c 100644
--- a/Main/System/BoneField/AdsManager.cs
+++ b/Main/System/BoneField/AdsManager.cs
@@ -1,11 +1,17 @@
 using System;
 using System.Collections.Generic;
+using UnityEngine;
 public class AdsManager : GameSystemManager<AdsManager>
 {
     //<骞垮憡ID,浠婃棩宸查鍙栧箍鍛婂鍔辨鏁�>
     private Dictionary<int, int> adsInfoDict = new Dictionary<int, int>();
     public event Action<int, int, int> OnAdsInfoListUpdateEvent;//ADID type value
     public Dictionary<int, Redpoint> redPointDict = new Dictionary<int, Redpoint>();
+
+    public int waitAdID = 0;  //鍥炶皟鍚庡彂鏀惧鍔辩敤
+    int loadErrorCD = 10;   //绛夊緟10绉掑悗鎵嶈兘鍐嶈姹�
+    public float lastLoadErrorTime = 0;
+
     public override void Init()
     {
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEvent;
@@ -45,6 +51,7 @@
 
     public void OnBeforePlayerDataInitializeEvent()
     {
+        waitAdID = 0;
         adsInfoDict.Clear();
     }
 
@@ -66,9 +73,56 @@
         GameNetSystem.Instance.SendInfo(pack);
     }
 
-    //濡傛灉鏈夊箍鍛奡DK鎺ュ叆锛岃鍑芥暟鏀规垚鍥炶皟瑙﹀彂
+    //鍖哄垎涓嶅悓娓犻亾鏄惁鏈夊箍鍛奡DK
     public void PlayAds(int ADID)
     {
+        if (!InvestModel.Instance.IsInvested(InvestModel.monthCardType) &&
+        !InvestModel.Instance.IsInvested(InvestModel.foreverCardType))
+        {
+            //鏈夊箍鍛婄殑SDK
+            if (VersionConfig.Get().appId == "ryzj" && !GeneralDefine.noAdsChannels.Contains(SDKUtils.channelSign))
+            {
+                //瑙嗛鍔犺浇澶辫触闇�瑕佺瓑10绉掑悗鍐嶈皟鐢�
+                //濂栧姳闇�瑕佽缃爣璇嗗搴斿彂鏀�
+                if (WaitForLoadNewAd())
+                {
+                    SysNotifyMgr.Instance.ShowTip("AdLoadFail");
+                    return;
+                }
+                waitAdID = ADID;
+                SDKUtils.Instance.PlayAds("b69a2b68bb3d22");
+                return;
+            }
+        }
+
+        //娌″箍鍛婄殑SDK 鐩存帴缁欏鍔�
+        GetAdsAward(ADID);
+    }
+
+    public void LoadAds()
+    {
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            if (WaitForLoadNewAd())
+            {
+                return;
+            }
+            SDKUtils.Instance.LoadAds("b69a2b68bb3d22");
+        }
+    }
+
+    //涓婁竴娆″姞杞藉け璐ワ紝妫�鏌ユ槸鍚﹂渶瑕佺瓑寰�
+    public bool WaitForLoadNewAd()
+    {
+        if (Time.time - lastLoadErrorTime < loadErrorCD)
+        {
+            return true;
+        }
+        return false;
+    }
+
+    public void GetAdsAward(int ADID)
+    {
         switch (ADID)
         {
             case 1:

--
Gitblit v1.8.0