当前位置: 首页 > news >正文

[Unity] AppLovin Max接入Native 广告 Android篇

把下载下来的maxnativelibrary-release-文件放在Plugins/Android下
将这一行加入到mainTemplate.gradle文件中

 implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

添加下面的两个脚本

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class NativeSDKManager : MonoBehaviour
{public static NativeSDKManager Instance;#region IOSMethod#if UNITY_IOS[DllImport("__Internal")]internal extern static void IOSInitMax();[DllImport("__Internal")]internal extern static void IOSLoadNativeAd(string adId);[DllImport("__Internal")]internal extern static void IOSShowAd(string adId, int cd, bool hasRemoveAds);#endif#endregionAndroidJavaClass androidJava;AndroidJavaObject androidJavaObject;//public MaxPriceData NativePrice;//public MaxPriceData NativeNormalPrice;private MaxPriceData MaxInterPrice;private MaxPriceData MaxInterPrice2;private MaxPriceData MaxRewardPrice;private MaxPriceData NativePrice_1;private MaxPriceData NativePrice_2;private MaxPriceData NativePrice_3;private MaxPriceData NativePrice_4;private MaxPriceData NativePrice_5;private MaxPriceData NativePrice_6;private MaxPriceData NativePrice_7;private MaxPriceData NativePrice_8;private MaxPriceData NativePrice_9;private MaxPriceData NativePrice_10;#if UNITY_ANDROID//public const string adUnitId = "id";//public const string priceAdUnitId = "id";private const string priceADUnitId_1 = "id";private const string priceADUnitId_2 = "id";private const string priceADUnitId_3 = "id";private const string priceADUnitId_4 = "id";private const string priceADUnitId_5 = "id";private const string priceADUnitId_6 = "id";private const string priceADUnitId_7 = "id";private const string priceADUnitId_8 = "id";private const string priceADUnitId_9 = "id";private const string priceADUnitId_10 = "id";#elif UNITY_IOSpublic const string adUnitId = "id";public const string priceAdUnitId = "id";
#endifprivate bool m_useOnlyNative = false;void Awake(){DontDestroyOnLoad(gameObject);Instance = this;transform.name = "NativeSDK";
#if UNITY_ANDROIDandroidJava = new AndroidJavaClass("com.android.unityad.maxnativelibrary.AndroidUnityConnector");
#elif UNITY_IOS && !UNITY_EDITORIOSInitMax();
#endifMaxInterPrice = new MaxPriceData(AdMaxType.Interstitial_android, string.Empty, "Max插屏广告id");MaxInterPrice2 = new MaxPriceData(AdMaxType.Interstitial_android_new, string.Empty, "Max插屏广告2id");MaxRewardPrice = new MaxPriceData(AdMaxType.Reward_Android, string.Empty, "Max激励广告id");NativePrice_1 = new MaxPriceData(priceADUnitId_1, String.Empty, "原生比价id1", true);NativePrice_2 = new MaxPriceData(priceADUnitId_2, String.Empty, "原生比价id2", true);NativePrice_3 = new MaxPriceData(priceADUnitId_3, String.Empty, "原生比价id3", true);NativePrice_4 = new MaxPriceData(priceADUnitId_4, String.Empty, "原生比价id4", true);NativePrice_5 = new MaxPriceData(priceADUnitId_5, String.Empty, "原生比价id5", true);NativePrice_6 = new MaxPriceData(priceADUnitId_6, String.Empty, "原生比价id6", true);NativePrice_7 = new MaxPriceData(priceADUnitId_7, String.Empty, "原生比价id7", true);NativePrice_8 = new MaxPriceData(priceADUnitId_8, String.Empty, "原生比价id8", true);NativePrice_9 = new MaxPriceData(priceADUnitId_9, String.Empty, "原生比价id9", true);NativePrice_10 = new MaxPriceData(priceADUnitId_10, String.Empty, "原生比价id10", true);}void Start(){InitMax();}//ToAndroidpublic void InitMax(){
#if UNITY_ANDROIDDebug.Log(GlobalFunc.NativeFlag + "NativeSDKManager Call initNativeAd");androidJava.CallStatic("initMaxNativeAd");cacheNativeVideo();Debug.Log(GlobalFunc.NativeFlag + "NativeSDK Init Succeed");#endif}#region 请求广告public bool adRequest = false;public bool priceAdRequest = false;private void RequestPriceAd_1(){RequestPriceAd(priceADUnitId_1);}private void RequestPriceAd_2(){RequestPriceAd(priceADUnitId_2);}private void RequestPriceAd_3(){RequestPriceAd(priceADUnitId_3);}private void RequestPriceAd_4(){RequestPriceAd(priceADUnitId_4);}private void RequestPriceAd_5(){RequestPriceAd(priceADUnitId_5);}private void RequestPriceAd_6(){RequestPriceAd(priceADUnitId_6);}private void RequestPriceAd_7(){RequestPriceAd(priceADUnitId_7);}private void RequestPriceAd_8(){RequestPriceAd(priceADUnitId_8);}private void RequestPriceAd_9(){RequestPriceAd(priceADUnitId_9);}private void RequestPriceAd_10(){RequestPriceAd(priceADUnitId_10);}private void RequestPriceAd(string unitId){Debug.Log(GlobalFunc.NativeFlag + "RequestAdLoad Start" + unitId);AnalyticDataHelper.Track("native_request", new Dictionary<string, object>(){{"ad_unit_id", unitId},});
#if UNITY_ANDROIDandroidJava.CallStatic("loadNativeAd", unitId);
#elif UNITY_IOS && !UNITY_EDITORIOSLoadNativeAd(priceAdUnitId);
#endif}public void cacheNativeVideo(){BuryingPointMgr.Instance.SendShuShuAndFireBaseEvent(Event_DataType.ads_request,new Dictionary<string, object>(){{"ad_type","native"}});if (NativePrice_1.IsNullPrice()){RequestPriceAd_1();}if (NativePrice_2.IsNullPrice()){RequestPriceAd_2();}if (NativePrice_3.IsNullPrice()){RequestPriceAd_3();}if (NativePrice_4.IsNullPrice()){RequestPriceAd_4();}if (NativePrice_5.IsNullPrice()){RequestPriceAd_5();}if (NativePrice_6.IsNullPrice()){RequestPriceAd_6();}if (NativePrice_7.IsNullPrice()){RequestPriceAd_7();}if (NativePrice_8.IsNullPrice()){RequestPriceAd_8();}if (NativePrice_9.IsNullPrice()){RequestPriceAd_9();}if (NativePrice_10.IsNullPrice()){RequestPriceAd_10();}}#endregionenum AdLoadStatus{Idle,Loading,Done,}public enum AdType{Normal,Price,Price_1,Price_2,Price_3,Price_4,Price_5,Price_6,Price_7,Price_8,Price_9,Price_10,}private Action SuccCallback;private AdLoadStatus adLoadStatus = AdLoadStatus.Idle;public bool IsShow;public string NativeType = "native";/// <summary>/// 展示Native 唯一方法/// </summary>/// <param name="adUnitId"></param>/// <param name="nativeType"></param>/// <param name="failCallback"></param>/// <param name="succCallback"></param>public void ShowNativeAd(string adUnitId, string nativeType = "adi", Action failCallback = null,Action succCallback = null){GlobalFunc.SetOpenAdWaitTime(60);Debug.Log(GlobalFunc.NativeFlag + "RequestAdLoad Start is In" + adUnitId);if (IsShow) //如果正在展示还没关  就跳过{return;}adLoadStatus = AdLoadStatus.Loading;// if (adLoadStatus == AdLoadStatus.Loading)// {//     return;// }SuccCallback = succCallback;NativeType = nativeType;Debug.Log(GlobalFunc.NativeFlag + "ShowNativeAd Start");
#if UNITY_ANDROIDandroidJava.CallStatic("showAd", adUnitId, UIConstDataManger.Instance.NativeShowTime);
#elif UNITY_IOS && !UNITY_EDITORIOSShowAd(adUnitId,DataManager.NativeDisplayCD,false);
#endifDebug.Log(GlobalFunc.NativeFlag + "ShowNativeAd Succeed" + adUnitId);}#region 回调约定error string:  id*errorcode*error----------其他的:revenue*network*id------------------------------------------------------------------------------------public void AdRemoveCallBack(string str){Debug.Log(GlobalFunc.NativeFlag + "Receive Native AdRemoveCallBack" + str);string[] strs = str.Split('*');AnalyticDataHelper.Track("adremove_click", new Dictionary<string, object>(){{"page", "native"},});// UIRoot.Instance.RemoveAds();}public void AdClickedCallBack(string str){Debug.Log(GlobalFunc.NativeFlag + "Receive Native AdClickedCallBack" + str);string[] strs = str.Split('*');string ad_position = "";if (m_useOnlyNative){ad_position = "native";}else{if (m_useNativeInsteadAdv){ad_position = "adv";}else{ad_position = "adi";}}AnalyticDataHelper.Track("native_click", new Dictionary<string, object>(){{"page", WindowManager.ActiveWindow},{"event_situation", WindowManager.ActiveWindow},{"ad_position", ad_position},{"isNative", true},{"ad_unit_id", strs[2]},{"network", strs[1]}});}private int retryNative1Attempt = 0;private int retryNative2Attempt = 0;public void AdRequestErrorCallBack(string str){Debug.Log(GlobalFunc.NativeFlag + "Receive Native AdRequestErrorCallBack" + str);AdsManager.instance.mAdPlayState = AdPlayState.FAIL;string[] strs = str.Split('*');if (strs[0].Equals(priceADUnitId_1)){NativePrice_1.ResetPrice();}else if (strs[0].Equals(priceADUnitId_2)){NativePrice_2.ResetPrice();}else if (strs[0].Equals(priceADUnitId_3)){NativePrice_3.ResetPrice();}else if (strs[0].Equals(priceADUnitId_4)){NativePrice_4.ResetPrice();}else if (strs[0].Equals(priceADUnitId_5)){NativePrice_5.ResetPrice();}else if (strs[0].Equals(priceADUnitId_6)){NativePrice_6.ResetPrice();}else if (strs[0].Equals(priceADUnitId_7)){NativePrice_7.ResetPrice();}else if (strs[0].Equals(priceADUnitId_8)){NativePrice_8.ResetPrice();}else if (strs[0].Equals(priceADUnitId_9)){NativePrice_9.ResetPrice();}else if (strs[0].Equals(priceADUnitId_10)){NativePrice_10.ResetPrice();}else{//NativePrice.ResetPrice();double retryDelay = Mathf.Pow(2, retryNative2Attempt);retryNative2Attempt++;if (retryDelay > 64){retryDelay = 0;retryNative2Attempt = 0;}priceAdRequest = false;// Invoke("RequestPriceAdLoad", (float) retryDelay);}}//FromAndroidprivate int loadCount = 0;private int showCount = 0;private int requestCount = 0;public void AdRequestLoadedCallBack(string str){Debug.Log(GlobalFunc.NativeFlag + "Receive Native AdRequestLoadedCallBack CallBack" + str);string[] strs = str.Split('*');if (!string.IsNullOrEmpty(strs[0])){AdType adType = AdType.Normal;if (!string.IsNullOrEmpty(strs[2])){if (strs[2].Equals(priceADUnitId_1)){adType = AdType.Price_1;}else if (strs[2].Equals(priceADUnitId_2)){adType = AdType.Price_2;}else if (strs[2].Equals(priceADUnitId_3)){adType = AdType.Price_3;}else if (strs[2].Equals(priceADUnitId_4)){adType = AdType.Price_4;}else if (strs[2].Equals(priceADUnitId_5)){adType = AdType.Price_5;}else if (strs[2].Equals(priceADUnitId_6)){adType = AdType.Price_6;}else if (strs[2].Equals(priceADUnitId_7)){adType = AdType.Price_7;}else if (strs[2].Equals(priceADUnitId_8)){adType = AdType.Price_8;}else if (strs[2].Equals(priceADUnitId_9)){adType = AdType.Price_9;}else if (strs[2].Equals(priceADUnitId_10)){adType = AdType.Price_10;}}AnalyticDataHelper.Track("native_loaded", new Dictionary<string, object>(){{"ad_unit_id", strs[2]},});if (adType == AdType.Price_1){NativePrice_1.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_2){NativePrice_2.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_3){NativePrice_3.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_4){NativePrice_4.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_5){NativePrice_5.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_6){NativePrice_6.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_7){NativePrice_7.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_8){NativePrice_8.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_9){NativePrice_9.Price = strs[0];priceAdRequest = false;}else if (adType == AdType.Price_10){NativePrice_10.Price = strs[0];priceAdRequest = false;}BuryingPointMgr.Instance.SendShuShuAndFireBaseEvent(Event_DataType.ads_load_success,new Dictionary<string, object>(){{"ad_type","native"}});Debug.Log($"{GlobalFunc.NativeFlag} 拿到: {adType},价格:{strs[0]}");}}private System.DateTime mLastNativeTime;public void AdShowCallBack(string str){IsShow = true;
// #if UNITY_ANDROID//NativeSDK AdShowCallBack priceDebug.Log(GlobalFunc.NativeFlag + "Receive Native AdShowCallBack CallBack" + str);// (AdsManager.instance.mAdNetwork as AdMax).NativeDisplay();AdsManager.instance.mAdPlayState = AdPlayState.Load;string[] strs = str.Split('*');ADRevenue adRevenue = new ADRevenue{AdFormat = "native",Revenue = double.Parse(strs[0]),NetworkName = strs[1],AdUnitIdentifier = strs[2]};(AdsManager.instance.mAdNetwork as AdMax).OnNativeAdPaidEvent("", adRevenue);// AnalyticHelper.FireEvent(Event_Type.adi_show_success, new Dictionary<string, object>() {//         {"ad_position",WindowManager.ActiveWindow }//     });GlobalFunc.SetOpenAdWaitTime(60);string ad_position = "";if (m_useOnlyNative){ad_position = "native";}else{if (m_useNativeInsteadAdv){ad_position = "adv";}else{ad_position = "adi";}}BuryingPointMgr.Instance.SendShuShuAndFireBaseEvent(Event_DataType.ads_show_success,new Dictionary<string, object>(){{"ad_type","native"},{"source",AdsManager.instance.SourceType.ToString()},{"net_work",strs[1]},{"position", ad_position},{"isNative", true},{"ad_unit_id", strs[2]},{"type", NativeType}});AnalyticDataHelper.Track("native_show_success", new Dictionary<string, object>(){{"page", WindowManager.ActiveWindow},{"event_situation", WindowManager.ActiveWindow},{"ad_position", ad_position},{"position", ad_position},{"isNative", true},{"ad_unit_id", strs[2]},{"type", NativeType},{"network", strs[1]}});showCount++;Debug.Log(GlobalFunc.NativeFlag + "Times Show:" + showCount);
// #endif}public void AdCloseCallBack(string str){IsShow = false;
// #if UNITY_ANDROIDDebug.Log(GlobalFunc.NativeFlag + "Receive Native AdCloseCallBack" + str);adLoadStatus = AdLoadStatus.Done;AdsManager.instance.mAdPlayState = AdPlayState.CLOSE;if (NativeType.Equals("adi")){AdsManager.instance.m_LastIntersTime = System.DateTime.Now;}else if (NativeType.Equals("native")){mLastNativeTime = System.DateTime.Now;}SuccCallback?.Invoke();Debug.Log(GlobalFunc.NativeFlag + "mLastIntersTime=" + AdsManager.instance.m_LastIntersTime);GlobalFunc.SetOpenAdWaitTime(0);string[] strs = str.Split('*');Debug.Log(strs);if (strs[1].Equals(priceADUnitId_1)){NativePrice_1.ResetPrice();RequestPriceAd_1();}else if (strs[1].Equals(priceADUnitId_2)){NativePrice_2.ResetPrice();RequestPriceAd_2();}else if (strs[1].Equals(priceADUnitId_3)){NativePrice_3.ResetPrice();RequestPriceAd_3();}else if (strs[1].Equals(priceADUnitId_4)){NativePrice_4.ResetPrice();RequestPriceAd_4();}else if (strs[1].Equals(priceADUnitId_5)){NativePrice_5.ResetPrice();RequestPriceAd_5();}else if (strs[1].Equals(priceADUnitId_6)){NativePrice_6.ResetPrice();RequestPriceAd_6();}else if (strs[1].Equals(priceADUnitId_7)){NativePrice_7.ResetPrice();RequestPriceAd_7();}else if (strs[1].Equals(priceADUnitId_8)){NativePrice_8.ResetPrice();RequestPriceAd_8();}else if (strs[1].Equals(priceADUnitId_9)){NativePrice_9.ResetPrice();RequestPriceAd_9();}else if (strs[1].Equals(priceADUnitId_10)){NativePrice_10.ResetPrice();RequestPriceAd_10();}BuryingPointMgr.Instance.SendShuShuAndFireBaseEvent(Event_DataType.ads_request,new Dictionary<string, object>(){{"ad_type","native"}});Debug.LogError(GlobalFunc.NativeFlag + "广告关闭获取奖励" + m_useNativeInsteadAdv);if (m_useNativeInsteadAdv){// AdsManager.instance.RewardedVideoAdDidClose();// AdsManager.instance.RewardedVideoAdDidGiven(strs[1]);m_useNativeInsteadAdv = false;}else{// AdsManager.instance.InterstitialAdClosedEvent();}//GlobalFunc.OnNativeClose(strs[1]);}#endregionprivate List<MaxPriceData> ComparePrice = new List<MaxPriceData>(12);public MaxPriceDataNativeSDKPriceHigh(bool useInter = false, bool useReward = false) //useInter:插屏,useReward激励//都为False为native{m_useNativeInsteadAdv = useReward;ComparePrice.Clear();//bool isHigh = false;if (!useInter && !useReward){m_useOnlyNative = true;}else{m_useOnlyNative = false;}if (CheckRuByIp()) //‒ RU地区 adi双ID+Native10条ID 12个ID比价,展示最高价ID(这个ID是adi就播adi,是Naitve就播Naitve)‒ adv同理{if (useInter){if (!MaxInterPrice.IsNullPrice()){ComparePrice.Add(MaxInterPrice);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {MaxInterPrice.Flag},价格:{MaxInterPrice.Price}");}if (!MaxInterPrice2.IsNullPrice()){ComparePrice.Add(MaxInterPrice2);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {MaxInterPrice2.Flag},价格:{MaxInterPrice2.Price}");}}if (useReward){if (!MaxRewardPrice.IsNullPrice()){ComparePrice.Add(MaxRewardPrice);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {MaxRewardPrice.Flag},价格:{MaxRewardPrice.Price}");}}}if (!this.NativePrice_1.IsNullPrice()){ComparePrice.Add(this.NativePrice_1);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_1.Flag},价格:{NativePrice_1.Price}");}if (!this.NativePrice_2.IsNullPrice()){ComparePrice.Add(this.NativePrice_2);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_2.Flag},价格:{NativePrice_2.Price}");}if (!this.NativePrice_3.IsNullPrice()){ComparePrice.Add(this.NativePrice_3);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_3.Flag},价格:{NativePrice_3.Price}");}if (!this.NativePrice_4.IsNullPrice()){ComparePrice.Add(this.NativePrice_4);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_4.Flag},价格:{NativePrice_4.Price}");}if (!this.NativePrice_5.IsNullPrice()){ComparePrice.Add(this.NativePrice_5);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_5.Flag},价格:{NativePrice_5.Price}");}if (!this.NativePrice_6.IsNullPrice()){ComparePrice.Add(this.NativePrice_6);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_6.Flag},价格:{NativePrice_6.Price}");}if (!this.NativePrice_7.IsNullPrice()){ComparePrice.Add(this.NativePrice_7);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_7.Flag},价格:{NativePrice_7.Price}");}if (!this.NativePrice_8.IsNullPrice()){ComparePrice.Add(this.NativePrice_8);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_8.Flag},价格:{NativePrice_8.Price}");}if (!this.NativePrice_9.IsNullPrice()){ComparePrice.Add(this.NativePrice_9);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_9.Flag},价格:{NativePrice_9.Price}");}if (!this.NativePrice_10.IsNullPrice()){ComparePrice.Add(this.NativePrice_10);Debug.Log($"{GlobalFunc.NativeFlag} 添加比价: {NativePrice_10.Flag},价格:{NativePrice_10.Price}");}MaxPriceData data = null;if (ComparePrice.Count > 0){ComparePrice.Sort((x, y) => x.CompareTo(y));data = ComparePrice[0];}if (data != null){if (data.Native){string ad_position = "";if (m_useOnlyNative){ad_position = "native";}else{if (m_useNativeInsteadAdv){ad_position = "adv";}else{ad_position = "adi";}}AnalyticDataHelper.Track("native_shouldshow", new Dictionary<string, object>(){{"event_situation", WindowManager.ActiveWindow},{"ad_unit_id", data.adUnitId},{"type", NativeType},{"ad_position", ad_position}});}}else{if (!CheckRuByIp()){if (useInter){if (!MaxInterPrice.IsNullPrice()){data = MaxInterPrice;}else if (!MaxInterPrice2.IsNullPrice()){data = MaxInterPrice2;}}else if (useReward){if (!MaxRewardPrice.IsNullPrice()){data = MaxRewardPrice;}}}}Debug.Log($"  拿到最后比价获胜的是:{(data == null ? "无" : data.Flag)} {(data != null ? data.adUnitId : "kong")}");return data;}public bool CanShowNative(){return !NativePrice_1.IsNullPrice() ||!NativePrice_2.IsNullPrice() ||!NativePrice_3.IsNullPrice() ||!NativePrice_4.IsNullPrice() ||!NativePrice_5.IsNullPrice() ||!NativePrice_6.IsNullPrice() ||!NativePrice_7.IsNullPrice() ||!NativePrice_8.IsNullPrice() ||!NativePrice_9.IsNullPrice() ||!NativePrice_10.IsNullPrice();}public void SetMaxInterPrice(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxInterPrice.adUnitId)){MaxInterPrice.Price = adInfo.Revenue.ToString();}}public void SetMaxInterPrice2(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxInterPrice2.adUnitId)){MaxInterPrice2.Price = adInfo.Revenue.ToString();}}public void SetMaxRewardPrice(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxRewardPrice.adUnitId)){MaxRewardPrice.Price = adInfo.Revenue.ToString();}}private bool m_useNativeInsteadAdv = false;// public MaxPriceData MaxPrice2;public void SetMaxInterClosed(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxInterPrice.adUnitId)){MaxInterPrice.ResetPrice();}}public void SetMaxInter2Closed(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxInterPrice2.adUnitId)){MaxInterPrice2.ResetPrice();}}public void SetMaxRewardClosed(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxRewardPrice.adUnitId)){MaxRewardPrice.ResetPrice();}}public  bool ChechAdiTime(float interval=10){float time = GetShowIntersPastTime();Debug.Log(GlobalFunc.NativeFlag+"Nativeinterval="+time);return time >= interval|| time==0;}private float GetShowIntersPastTime(){return (float) (System.DateTime.Now - mLastNativeTime).TotalSeconds;}bool CheckRuByIp(){Debug.Log($"{GlobalFunc.NativeFlag}+IP:{DataManager.CountryCodeByIp}---NativePriority:{UIConstDataManger.Instance.NativePriority}");return DataManager.CountryCodeByIp.ToUpper().Equals("RU")||DataManager.CountryCodeByIp.ToUpper().Equals("IN") || UIConstDataManger.Instance.NativePriority == 0;}
}
using System;public class MaxPriceData:IComparable
{public string adUnitId;public string Price;public bool Native;public string Flag;public MaxPriceData(string adUnitId,string price,string flag,bool _native = false){this.adUnitId = adUnitId;this.Price = price;this.Native = _native;this.Flag = flag;}public bool IsNullPrice(){return string.IsNullOrEmpty(Price);}public void ResetPrice(){Price = string.Empty;}public void SetPrice(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxPrice1.adUnitId)){MaxPrice1.Price = adInfo.Revenue.ToString();}// if (adInfo.AdUnitIdentifier.Equals(MaxPrice2.adUnitId))// {//     MaxPrice2.Price = adInfo.Revenue.ToString();// }}public MaxPriceData MaxPrice1;// public MaxPriceData MaxPrice2;public void SetMaxClosed(MaxSdkBase.AdInfo adInfo){if (adInfo.AdUnitIdentifier.Equals(MaxPrice1.adUnitId)){MaxPrice1.ResetPrice();}// if (adInfo.AdUnitIdentifier.Equals(MaxPrice2.adUnitId))// {//     MaxPrice2.ResetPrice();// }}public int CompareTo(object obj){if (obj == null) return 1; // 当前对象总是比 null 大if (obj is not MaxPriceData other){return 1;}// Null 价格的处理:认为 Null 价格比非 Null 价格大if (this.IsNullPrice() && !other.IsNullPrice()){return 1; // 当前对象的 NullPrice 排在后面}if (!this.IsNullPrice() && other.IsNullPrice()){return -1; // 当前对象的非 NullPrice 排在前面}// 非 Null 价格比较if (!this.IsNullPrice() && !other.IsNullPrice()){// 使用 double.TryParse 保护解析if (double.TryParse(this.Price, out double thisPrice) && double.TryParse(other.Price, out double otherPrice)){// 降序比较:价格大的排前面return otherPrice.CompareTo(thisPrice);}else{// 如果解析失败,可根据需求定义逻辑,这里假设解析失败的价格最小if (!double.TryParse(this.Price, out _))return 1; // 当前对象解析失败,排后面if (!double.TryParse(other.Price, out _))return -1; // 对比对象解析失败,排后面}}// 如果两个价格都是 Null,则相等return 0;}}

展示最高价格的native

 public void ShowOnlyNative(string pos, System.Action succeessCallback = null,System.Action failCallback = null,int CD=-1){if (DataManager.hasRemoveAds || DataManager.IsVIP){failCallback?.Invoke();return;}if (CD>=0){if (!NativeSDKManager.Instance. ChechAdiTime(CD)){failCallback?.Invoke();return;}    }MaxPriceData maxPriceData;maxPriceData = NativeSDKManager.Instance.NativeSDKPriceHigh(false,false);if (maxPriceData!=null&&maxPriceData.Native){AnalyticDataHelper.Track("native_ready", new Dictionary<string, object>(){{"event_situation", pos},{"ad_unit_id", maxPriceData.adUnitId},});AnalyticDataHelper.Track("native_fill", new Dictionary<string, object>(){{"is_fill", 1},{"position", "native"}});AnalyticDataHelper.Track("should_show", new Dictionary<string, object>(){{"position", "native"},});NativeSDKManager.Instance.ShowNativeAd(maxPriceData.adUnitId,"native", failCallback,succeessCallback);return;}failCallback?.Invoke();AnalyticDataHelper.Track("native_fill", new Dictionary<string, object>(){{"is_fill", NativeSDKManager.Instance.CanShowNative()?1:0 },{"position", "native" },});AnalyticDataHelper.Track("should_show", new Dictionary<string, object>(){{"position", "native"},});}

加入adi adv native比价逻辑

在adi的OnAdLoadedEvent里设置adi的价格

if (adInfo.AdUnitIdentifier.Equals(AdMaxType.Interstitial_android_new)){NativeSDKManager.Instance.SetMaxInterPrice2(adInfo);Debug.Log(GlobalFunc.NativeFlag+"拿到MaxPrice2广告的价格" + adInfo.Revenue);//DataManager.networkNameAdi = adInfo.NetworkName;}else if (adInfo.AdUnitIdentifier.Equals(AdMaxType.Interstitial_android)){NativeSDKManager.Instance.SetMaxInterPrice(adInfo);Debug.Log(GlobalFunc.NativeFlag+"拿到MaxPrice广告的价格" +adInfo.Revenue);//DataManager.networkNameAdi = adinfo.NetworkName;}

在adi的OnAdHiddenEvent重置adi价格

if (adInfo.AdUnitIdentifier.Equals(AdMaxType.Interstitial_android_new)){NativeSDKManager.Instance.SetMaxInter2Closed(adInfo);}else{NativeSDKManager.Instance.SetMaxInterClosed(adInfo);}

在adv的OnAdLoadedEvent里设置adv的价格

NativeSDKManager.Instance.SetMaxRewardPrice(adInfo);

在adv的OnAdHiddenEvent重置adv价格

	NativeSDKManager.Instance.SetMaxRewardClosed(adInfo);

处理展示adi的方法

 maxPriceData = NativeSDKManager.Instance.NativeSDKPriceHigh(true,false);if (maxPriceData!=null&&maxPriceData.Native){AnalyticDataHelper.Track("native_fill", new Dictionary<string, object>(){{"is_fill", 1},{"position", "adi"}});AnalyticDataHelper.Track("should_show", new Dictionary<string, object>(){{"position", "adi"},});NativeSDKManager.Instance.ShowNativeAd(maxPriceData.adUnitId,"adi", failCallback,succeessCallback);return;}else if (maxPriceData!=null&&!maxPriceData.Native){//这里可以处理双adi}AnalyticDataHelper.Track("native_fill", new Dictionary<string, object>(){{"is_fill", NativeSDKManager.Instance.CanShowNative()?1:0 },{"position", "adi" },});AnalyticDataHelper.Track("should_show", new Dictionary<string, object>(){{"position", "adi"},});//走之前的adi逻辑

同理adv也是

 var data = NativeSDKManager.Instance.NativeSDKPriceHigh(false, true);if (data!=null && data.Native){AnalyticDataHelper.Track("native_fill", new Dictionary<string, object>(){{"is_fill", 1 },{"position", "adv"}});AnalyticDataHelper.Track("should_show", new Dictionary<string, object>(){{"position", "adv"},});NativeSDKManager.Instance.ShowNativeAd(data.adUnitId,"adv", () => { failCallback?.Invoke("");}, () =>{m_onRewardAdDidClose?.Invoke();});}else{AnalyticDataHelper.Track("native_fill", new Dictionary<string, object>(){{"is_fill", NativeSDKManager.Instance.CanShowNative()?1:0 },{"position", "adv"}});AnalyticDataHelper.Track("should_show", new Dictionary<string, object>(){{"position", "adv"},});//走之前的展示adv逻辑StartCoroutine(ShowADV(type, failCallback, source, wait));}

最后选择合适的时机加载Native 现在代码里只有初始化和关闭native才会加载

加入混淆

-keep class com.android.unityad.maxnativelibrary.** {*;}

相关文章:

[Unity] AppLovin Max接入Native 广告 Android篇

把下载下来的maxnativelibrary-release-文件放在Plugins/Android下 将这一行加入到mainTemplate.gradle文件中 implementation androidx.constraintlayout:constraintlayout:2.1.4添加下面的两个脚本 using System; using System.Collections; using System.Collections.Gener…...

青少年夏令营管理系统的设计与开发(社团)+开题报告(springboot+freemarker)

&#x1f497;博主介绍&#x1f497;&#xff1a;✌在职Java研发工程师、专注于程序设计、源码分享、技术交流、专注于Java技术领域和毕业设计✌ 温馨提示&#xff1a;文末有 CSDN 平台官方提供的老师 Wechat / QQ 名片 :) Java精品实战案例《700套》 2025最新毕业设计选题推荐…...

JSSIP的使用及问题(webRTC,WebSockets)

简介 项目中有一个需要拨打电话的功能&#xff0c;要求实时的进行音频接听&#xff0c;并且可以在电话接听或者挂断等情况下做出相应的操作。jssip作为一个强大的实现实时通信的javascript库&#xff0c;这不门当户对了嘛。 jssip&#xff08;官网&#xff1a; JsSIP - the J…...

13.继承和多态的实例 C#

这是一个动物园的动物发出不同的声音&#xff0c;使用了继承和多态 using System; using System.Collections.Generic;namespace InheritanceAndPolymorphismExample {//一个动物类&#xff0c;包含属性&#xff1a;名称。包含方法&#xff1a;发出叫声public class Animal{pub…...

Vue3之入门介绍

Vue 3是一种用于构建用户界面的渐进式JavaScript框架。它主要用于创建单页应用(SPA)&#xff0c;具备响应式数据绑定、组件化开发、虚拟DOM等核心特性&#xff0c;使得开发者能够高效地构建复杂的前端应用。Vue 3相比于之前的版本&#xff0c;进行了大量的性能优化和功能改进&a…...

Unity3D仿星露谷物语开发3之动画系统初探

1、目标 我们希望使用已有的资源建一个动画demo&#xff0c;以此熟悉基于已有Animator/Animation资源的使用方法。 以Tree的动画系统为例&#xff0c;资源位于&#xff1a; 2、创建流程 &#xff08;1&#xff09;创建tree空对象 上面两个都是空对象。 &#xff08;2&#…...

【研发经验】工作流和规则引擎的应用与场景

工作流引擎和规则引擎是两种常见的软件技术&#xff0c;可以被应用于各种场景中&#xff0c; 例如&#xff1a; 业务流程自动化&#xff1a;工作流引擎可以用于自动化和管理各种业务流程&#xff0c;例如审批流程&#xff0c;订单处理流程&#xff0c;客户服务流程等。它可以定…...

UDP对比TCP的网络编程接口

目录 一、UDP网络编程接口 1.创建套接字(客户端、服务端) 2.套接字绑定地址(客户端、服务端) 3.发送数据(客户端、服务端) 4.接收数据(客户端、服务端) 二、TCP网络编程接口 1.创建套接字&#xff08;客户端、服务端&#xff09; 2.套接字绑定地址&#xff08;客户端、服…...

C# 探险之旅:第二十七节 - 类型class(属性) —— 给你的类穿上“属性”的外衣

嘿&#xff0c;探险家们&#xff01;欢迎再次踏上我们的C#奇幻之旅。今天&#xff0c;我们要聊聊一个超级有趣的话题——类的“属性”。想象一下&#xff0c;如果我们要给类穿上一件酷炫的外衣&#xff0c;那属性就是这件外衣上的各种口袋和装饰&#xff0c;让类变得既实用又拉…...

《饕餮记》精彩片段(一)

也是无意中看到鲛人脍单元集片段&#xff0c;才去看了这个剧 整体略架空和部分逻辑不是很连贯和完美 精彩点不在于整体和走向和故事线 也不在于大牌明星撑场&#xff0c;因为全场只有安悦溪一个脸熟明星撑场子 而在于每个单元间离奇小故事 和华胥引差不多&#xff0c;属于逻…...

esxi8 虚拟机使用ubuntu22模板后 没有ip配置文件,只有ipv6链接正常使用

esxi8 虚拟机使用模板后 没有ip配置文件&#xff0c;只有ipv6链接正常使用&#xff0c;/etc/NetworkManager/system-connections配置下没有配置文件 只有/etc/netplan/有文件 sudo ip addr add 192.168.1.9/24 dev ens35 # 临时设置ip&#xff0c; 接口名ens35 sudo vi /et…...

C++内存管理

1、代码区 代码区的特点&#xff1a; 1.只读&#xff1a;防止程序运行时修改其执行代码&#xff0c;有助于程序稳定和安全性。 2.共享&#xff1a;多个程序运行可共享同一份代码区&#xff0c;以节省内存。 3.固定大小&#xff1a;代码区的大小在程序编译连接时就已经确定&a…...

分类算法评估标准综述

目录 ​编辑 混淆矩阵&#xff08;Confusion Matrix&#xff09; 准确率&#xff08;Accuracy&#xff09; 精确率&#xff08;Precision&#xff09; 召回率&#xff08;Recall&#xff09; F1分数&#xff08;F1 Score&#xff09; ROC曲线和AUC值 P-R曲线 马修斯相…...

基于windows环境使用nvm安装多版本nodejs

目录 前言 一、卸载node 二、nvm是什么&#xff1f; 三、nvm安装 1.官网下载 nvm 包 2. 安装nvm-setup.exe 3. 配置路径和下载镜像 4. 检查安装是否完成 四、 使用nvm安装node 五、修改npm默认镜像源为淘宝镜像 六、环境变量配置 1. 新建目录 2. 设置环境变量 七…...

【人工智能-中级】神经网络的调优与正则化策略

文章目录 神经网络的调优与正则化策略1. 神经网络调优策略学习率调整批量大小(Batch Size)优化算法2. 正则化策略L1与L2正则化Dropout数据增强3. 超参数优化4. 小结神经网络的调优与正则化策略 在深度学习中,训练一个高效且准确的神经网络模型不仅依赖于选择合适的架构,还…...

VBA 连续打印多个内容成PDF

VBA 连续打印多个内容成PDF Dim wb As Workbook Dim sht1 As Worksheet Set sht1 ActiveSheet PT ThisWorkbook.PathApplication.ScreenUpdating FalseApplication.DisplayAlerts FalseApplication.Calculation xlCalculationManual For i [aa2] To [ab2][ad2] iSet wb …...

【Linux网络编程】第十弹---打造初级网络计算器:从协议设计到服务实现

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】【C详解】【Linux系统编程】【Linux网络编程】 目录 1、Protocol.hpp 1.1、Request类 1.1.1、基本结构 1.1.2、构造析构函数 1.1.3、序列化函数 1.1.4、反…...

嵌入式 linux Git常用命令 抽补丁 打补丁

Git常用命令 为什么要学习git呢&#xff1f;我相信刚入门的小伙伴敲打肯定碰到过这种玄学问题&#xff0c;我明明刚刚还能用的代码&#xff0c;后面不知道咋的就不能用了&#xff0c;所以每次你调出一个功能点以后都会手动复制一份代码防止出问题&#xff0c;时间一长发现整个…...

windows C#-方法概述(上)

方法是包含一系列语句的代码块。 程序通过调用该方法并指定任何所需的方法参数使语句得以执行。 在 C# 中&#xff0c;每个执行的指令均在方法的上下文中执行。 Main 方法是每个 C# 应用程序的入口点&#xff0c;并在启动程序时由公共语言运行时 (CLR) 调用。 在使用顶级语句的…...

SpringCloud和Nacos的基础知识和使用

1.什么是SpringCloud ​ 什么是微服务&#xff1f; ​ 假如我们需要搭建一个网上购物系统&#xff0c;那么我们需要哪些功能呢&#xff1f;商品中心、订单中心和客户中心等。 ​ 当业务功能较少时&#xff0c;我们可以把这些功能塞到一个SpringBoot项目中来进行管理。但是随…...

一行一行出字的视频怎么做?简单的操作方法

在视频制作中&#xff0c;逐行出现的字幕效果不仅能够增强视觉冲击力&#xff0c;还能让观众更加专注于内容&#xff0c;特别适合用于教育视频、书单推荐、诗歌朗诵等多种场景。下面&#xff0c;我们将详细介绍如何影忆&#xff0c;来制作这种逐行出字的视频效果。 1.字幕逐行…...

鸿蒙NEXT开发案例:颜文字搜索器

【引言】 本文将介绍一个名为“颜文字搜索器”的开发案例&#xff0c;该应用是基于鸿蒙NEXT平台构建的&#xff0c;旨在帮助用户快速查找和使用各种风格的表情符号。通过本案例的学习&#xff0c;读者可以了解如何在鸿蒙平台上进行数据处理、UI设计以及交互逻辑的实现。 【环…...

python在纯文本程序里面藏一张图

思路base64编码是纯文本的,base64是以字符串的形式存在,包括但不限于python,js,C#,C/Cpp. 这里给出python示例:运行后可以显示一张opencv的官方例程图. 废话不说,上程序. import os,sys,time,cv2,base64,requests from PIL import Image from io import BytesIO import nump…...

Java 身份证校验工具类(15位校验、18位校验与15转18)

文章目录 身份证简介&#xff08;一&#xff09;身份证号码的组成&#xff08;二&#xff09;一代和二代身份证一代身份证二代身份证 检验思路分析&#xff08;一&#xff09;15位身份证号码&#xff08;二&#xff09;18位身份证号码&#xff08;三&#xff09;校验算法示例&a…...

The Past, Present and Future of Apache Flink

摘要&#xff1a;本文整理自阿里云开源大数据负责人王峰&#xff08;莫问&#xff09;在 Flink Forward Asia 2024上海站主论坛开场的分享&#xff0c;今年正值Flink开源项目诞生的第10周年&#xff0c;借此时机&#xff0c;王峰回顾了Flink在过去10年的发展历程以及 Flink社区…...

不能通过 ip 直接访问 共享盘 解决方法

from base_config.config import OpenSMB, SMB import os, time, calendar, requests, decimal, platform, fs.smbfsinfo_dict SMB.EPDI_dict info_dict[host] (FS03,10.6.12.182) info_dict[direct_tcp] True# smb OpenSMB(info_dict)print(ok)# 根据 ip 查询电脑名 impor…...

IDEA方法注释模板设置

目录 创建模板 新建模板&#xff1a;命名为* 设置模板内容-IDEA格式模板 设置模板应用场景 设置参数 创建模板 /**Enter这里我们也按照这种习惯来设置IDEA的方法注释&#xff1a;File-->Settings-->Editor-->Live Templates 先新建模板组&#xff0c;然后在模板组中…...

组件缓存keep-alive

希望点击面经详情回来之后该1面经详情停留在滚动条停止的位置 有些 组件是不需要缓存的&#xff0c;例如详情页不需要缓存。解决方法是keep-alive的三个属性 include:组件名数组&#xff0c;只有匹配的组件会被缓存exclude:组件名数组&#xff0c;任何匹配的组件都不会被缓存ma…...

【经验分享】搭建本地训练环境知识点及方法

最近忙于备考没关注&#xff0c;有次点进某小黄鱼发现首页出现了我的笔记还被人收费了 虽然我也卖了一些资源&#xff0c;但我以交流、交换为主&#xff0c;笔记都是免费给别人看的 由于当时刚刚接触写的并不成熟&#xff0c;为了避免更多人花没必要的钱&#xff0c;所以决定公…...

Ant Design of Vue之带select控件,单元格编辑功能的表格EditableCell组件

效果图 功能 表格里面某一行或者某一个单元格支持select复选框可以编辑&#xff0c;新增一行数据&#xff0c;删除一行数据&#xff0c;并且有校验规则 源码 editablecell组件源码 参考自 源码...

etcd节点扩/缩容

etcd集群节点数越多越好吗&#xff1f; etcd 集群是一个 Raft Group&#xff0c;没有 shared。所以它的极限有两部分&#xff0c;一是单机的容量限制&#xff0c;内存和磁盘&#xff1b;二是网络开销&#xff0c;每次 Raft 操作需要所有节点参与&#xff0c;每一次写操作需要集…...

FFmpeg功能使用

步骤&#xff1a;1&#xff0c;安装FFmpeg Download FFmpeg 在这里点击->Windows builds from gyan.dev&#xff1b;如下图 会跳到另外的下载界面&#xff1a; 在里面下拉选择点击ffmpeg-7.1-essentials_build.zip&#xff1a; 即可下载到FFmpeg&#xff1b; 使用&#…...

动手学深度学习-线性神经网络-7softmax回归的简洁实现

目录 初始化模型参数 重新审视Softmax的实现 优化算法 训练 小结 在 线性回归的实现中&#xff0c; 我们发现通过深度学习框架的高级API能够使实现 线性回归变得更加容易。 同样&#xff0c;通过深度学习框架的高级API也能更方便地实现softmax回归模型。 本节如在上一节…...

GenAI + 3D:开启4D场景重建的新纪元

近日,一项激动人心的研究成果在《GenAI + 3D》方向取得了重大进展,它提出了一种创新的方法,能够将普通的2D视频转换为完整的4D场景。想象一下,《黑客帝国》中的"子弹时间"效果——现在你不仅可以停留在一个特定的时刻来改变视角,还可以自由地在空间和时间中移动…...

记一个framebuffer显示混乱的低级错误

记一个framebuffer显示混乱的低级错误 由于framebuffer的基础知识不扎实&#xff0c;这个任务上我多卡了两天&#xff0c;差点把我搞死&#xff0c;于此记录为后鉴。 打算用awtk做一个多进程项目&#xff0c;计划把framebuffer的内容通过websocket输出到浏览器上去显示画面, …...

网络安全教学博客(二):常见网络安全威胁剖析

在上一篇博客中&#xff0c;我们了解了网络安全的基础概念和重要性。今天&#xff0c;让我们深入探讨一下常见的网络安全威胁&#xff0c;以便我们能够更好地识别和防范它们。 恶意软件&#xff08;Malware&#xff09; 病毒&#xff08;Virus&#xff09;&#xff1a;病毒是一…...

【ZYNQ开发】Vitis下保存与快速加载BSP配置的方法

在使用Xilinx的Vitis进行ZYNQ PS端开发时&#xff0c;常常涉及到对于BSP的设置&#xff0c;比较典型的像是使用lwip时&#xff0c;需要对DHCP、memory以及send_buffer等进行一些自定义的修改。在设计到硬件描述文件需要进行更换&#xff08;PL端更改程序&#xff09;重新加载工…...

go开发中interface和方法接收器的使用

Go 语言中的接口和方法接收器学习 Go 中的 interface 就像是一个神奇的魔法杖&#xff0c;能让你轻松地将不同的类型拉到同一个阵营里。与其他语言的接口不同&#xff0c;Go 的接口无需显式声明“我实现了你”&#xff0c;只要你满足了接口规定的方法&#xff0c;Go 就会自动认…...

【昇腾】NPU ID:物理ID、逻辑ID、芯片映射关系

起因&#xff1a; https://www.hiascend.com/document/detail/zh/Atlas%20200I%20A2/23.0.0/re/npu/npusmi_013.html npu-smi info -l查询所有NPU设备&#xff1a; [naienotebook-npu-bd130045-55bbffd786-lr6t8 DCNN]$ npu-smi info -lTotal Count : 1NPU…...

景联文科技提供高质量文本标注服务,驱动AI技术发展

文本标注是指在原始文本数据上添加标签的过程&#xff0c;这些标签可以用来指示特定的实体、关系、事件等信息&#xff0c;以帮助计算机理解和处理这些数据。 文本标注是自然语言处理&#xff08;NLP&#xff09;领域的一个重要环节&#xff0c;它通过为文本的不同部分提供具体…...

【Spark】Spark Join类型及Join实现方式

如果觉得这篇文章对您有帮助&#xff0c;别忘了点赞、分享或关注哦&#xff01;您的一点小小支持&#xff0c;不仅能帮助更多人找到有价值的内容&#xff0c;还能鼓励我持续分享更多精彩的技术文章。感谢您的支持&#xff0c;让我们一起在技术的世界中不断进步&#xff01; Sp…...

docker安装、升级、以及sudo dockerd --debug查看启动失败的问题

1、docker安装包tar下载地址 Index of linux/static/stable/x86_64/ 2、下载tgz文件并解压 tar -zxvf docker-24.0.8.tgz 解压后docker文件夹下位docker相关文件 3、将老版本docker相关文件&#xff0c;备份 将 /usr/bin/docker下docker相关的文件&#xff0c;mv到备份目录…...

做T和做T+0有什么区别

做T和做T0在股市中实际上有紧密的联系&#xff0c;但也有所区别。以下是对两者的详细比较&#xff1a; 一、定义与原理 做T&#xff1a; 广义上&#xff0c;做T指的是一种通过低买高卖或高卖低买来赚取差价的交易策略。这种策略可以应用于不同的交易周期&#xff0c;包括日内交…...

【JAVA项目】基于ssm的【美食推荐管理系统】

【JAVA项目】基于ssm的【美食推荐管理系统】 技术简介&#xff1a;采用JSP技术、B/S架构、SSM框架、MySQL技术等实现。 系统简介&#xff1a;美食推荐管理系统&#xff0c;在系统首页可以查看首页、热门美食、美食教程、美食店铺、美食社区、美食资讯、我的、跳转到后台等内容。…...

从零开始学docker(五)-可用的docker镜像

最近docker镜像都不能访问&#xff0c;目前亲测可用的docker镜像可用&#xff0c;并拉取mysql测试完成。 [缺点] docker search 查不到镜像的索引列表&#xff0c;只能手动查询索引目录&#xff08;解决方案在最后&#xff09;。 linux服务器vim打开镜像文件daemon.json vim /e…...

repmgr集群部署-PostgreSQL高可用保证

&#x1f4e2;&#x1f4e2;&#x1f4e2;&#x1f4e3;&#x1f4e3;&#x1f4e3; 作者&#xff1a;IT邦德 中国DBA联盟(ACDU)成员&#xff0c;10余年DBA工作经验&#xff0c; Oracle、PostgreSQL ACE CSDN博客专家及B站知名UP主&#xff0c;全网粉丝10万 擅长主流Oracle、My…...

2020数字中国创新大赛-虎符网络安全赛道丨Web Writeup

本文是i春秋论坛作家「OPLV1H」表哥参加2020数字中国创新大赛-虎符网络安全赛道线上初赛的赛后总结&#xff0c;关于Web的Writeup记录&#xff0c;感兴趣的小伙伴快来学习吧。 1、hash_file — 是使用给定文件的内容生成哈希值&#xff0c;和文件名称无关。 2、jwt令牌结构和j…...

手动部署前后端项目到LInux上面

一&#xff1a;部署后端工程 在本地的idea中先启动当前的工程&#xff0c;然后访问一下&#xff0c;看看工程是否正常访问。 执行package指令&#xff0c;进行打包操作&#xff0c;将当前的springboot项目&#xff0c;打成一个jar包。 <!-- SpringBoot应用打包插件--> …...

【一本通】intervals

【一本通】intervals &#x1f490;The Begin&#x1f490;点点关注&#xff0c;收藏不迷路&#x1f490; 给出n个闭区间[ai,bi]和n个整数c1,……,cn。令Z表示一个整数集合&#xff0c;Z集合中最少要包含多少个整数可以使得每个区[ai,bi]都至少有ci个整数位于Z集合中。 输入 …...

测试脚本并发多进程:pytest-xdist用法

参考&#xff1a;https://www.cnblogs.com/poloyy/p/12694861.html pytest-xdist详解&#xff1a; https://www.cnblogs.com/poloyy/p/14708825.html 总 https://www.cnblogs.com/poloyy/category/1690628.html...