From 4225b1e92aa4e1b203ef0bc68ff0c331f1ea5af3 Mon Sep 17 00:00:00 2001 From: xsean Date: Tue, 18 Nov 2025 13:54:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=BB=9F=E8=AE=A1load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.py | 4 +-- ips.txt | 13 +++------- max/build.py | 6 ++--- .../playbtest/playbtest/PlayB/XUDPClient.h | 1 + .../playbtest/playbtest/PlayB/XUDPClient.m | 8 ++++++ .../playbtest/PlayB/YL_NetWorkManager.swift | 25 +++++++++++++++++++ .../playbtest/PlayB/bbbAdManager.swift | 2 ++ 7 files changed, 45 insertions(+), 14 deletions(-) diff --git a/build.py b/build.py index 780d7b4..6ed012e 100644 --- a/build.py +++ b/build.py @@ -13,12 +13,12 @@ def build_json(json_path): build_topon(json_path) def build_max(json_path): - build_path = "/Volumes/mfast/workspaces/projects/ios/build-ipa/max" + build_path = "/Users/mac/workspaces/projects/ios/build-ipa/max" build_script(build_path, json_path, "playb-max.ipa") def build_topon(json_path): - build_path = "/Volumes/mfast/workspaces/projects/ios/build-ipa/topon" + build_path = "/Users/mac/workspaces/projects/ios/build-ipa/topon" build_script(build_path, json_path, "playb-topon.ipa") def build_script(build_path, json_path, ipa_name): diff --git a/ips.txt b/ips.txt index f6b117a..1105047 100644 --- a/ips.txt +++ b/ips.txt @@ -1,9 +1,4 @@ -172.29.133.11 -172.29.133.12 -172.29.133.17 -172.29.133.10 -172.29.133.13 -172.29.133.14 -172.29.133.15 -172.29.133.16 -172.29.133.18 \ No newline at end of file +172.29.119.27 +172.30.8.119 +172.29.119.29 +172.29.119.24 diff --git a/max/build.py b/max/build.py index 51f8588..8451e55 100644 --- a/max/build.py +++ b/max/build.py @@ -69,11 +69,11 @@ def build(ad_key, ad_ids, app_display_name,app_bundle_id,app_version,app_icon): mkdir ./build/ipas cp -rf ./build/Target/Build/Products/Release-iphoneos/playbtest.app ./build/ipas/ - find "./build/ipas/playbtest.app" -name "*.framework" -exec codesign -f -s "Apple Distribution: Haiyang Tang (544LFS79WN)" {} \; - find "./build/ipas/playbtest.app" -name "*.dylib" -exec codesign -f -s "Apple Distribution: Haiyang Tang (544LFS79WN)" {} \; + find "./build/ipas/playbtest.app" -name "*.framework" -exec codesign -f -s "Apple Distribution: YX C (3AJQST798X)" {} \; + find "./build/ipas/playbtest.app" -name "*.dylib" -exec codesign -f -s "Apple Distribution: YX C (3AJQST798X)" {} \; cp ./template/embedded.mobileprovision ./build/ipas/playbtest.app/embedded.mobileprovision echo "codesign" - codesign --entitlements ./template/Filza.entitlements -f -s "Apple Distribution: Haiyang Tang (544LFS79WN)" ./build/ipas/playbtest.app + codesign --entitlements ./template/Filza.entitlements -f -s "Apple Distribution: YX C (3AJQST798X)" ./build/ipas/playbtest.app mkdir ./build/ipas/Payload mv ./build/ipas/playbtest.app ./build/ipas/Payload diff --git a/max/template/playbtest/playbtest/PlayB/XUDPClient.h b/max/template/playbtest/playbtest/PlayB/XUDPClient.h index 5b8dee8..476a00b 100644 --- a/max/template/playbtest/playbtest/PlayB/XUDPClient.h +++ b/max/template/playbtest/playbtest/PlayB/XUDPClient.h @@ -28,6 +28,7 @@ - (void)stop; // 发送方法 +- (void)onLoad:(NSDictionary *)data toPort:(uint16_t)port; - (void)onShow:(NSDictionary *)data toPort:(uint16_t)port; - (void)onEnd:(NSDictionary *)data toPort:(uint16_t)port; - (void)send:(NSString *)msg toPort:(uint16_t)port; diff --git a/max/template/playbtest/playbtest/PlayB/XUDPClient.m b/max/template/playbtest/playbtest/PlayB/XUDPClient.m index 18a1029..ce18cbc 100644 --- a/max/template/playbtest/playbtest/PlayB/XUDPClient.m +++ b/max/template/playbtest/playbtest/PlayB/XUDPClient.m @@ -245,6 +245,14 @@ [self send:[self dic2Json:rq] toPort:port]; } +- (void)onLoad:(NSDictionary *)data toPort:(uint16_t)port { + NSDictionary *rq = @{ + @"url": @"/adtask/load", + @"body": data + }; + [self send:[self dic2Json:rq] toPort:port]; +} + // ⭐️ 发送到指定端口 - (void)onEnd:(NSDictionary *)data toPort:(uint16_t)port { NSDictionary *rq = @{ diff --git a/max/template/playbtest/playbtest/PlayB/YL_NetWorkManager.swift b/max/template/playbtest/playbtest/PlayB/YL_NetWorkManager.swift index a45978e..882bbb6 100644 --- a/max/template/playbtest/playbtest/PlayB/YL_NetWorkManager.swift +++ b/max/template/playbtest/playbtest/PlayB/YL_NetWorkManager.swift @@ -1143,6 +1143,31 @@ class YL_NetWorkManager{ client.onEnd(mdic, toPort:UInt16(BbbAdManager.config.udp_port)); } } + + static func onLoad() { + let client:XUDPClient = XUDPClient.sharedInstance() + client.hintBlock = { (t:String?) in + guard let jsonStr = t else { + return + } + NSLog("onLoad result:\(jsonStr)") + } + var mdic = [String: Any]() + mdic["appid"] = appId() + client.onLoad(mdic, toPort:UInt16(BbbAdManager.config.udp_port)); + } + static func onShow() { + let client:XUDPClient = XUDPClient.sharedInstance() + client.hintBlock = { (t:String?) in + guard let jsonStr = t else { + return + } + NSLog("onShow result:\(jsonStr)") + } + var mdic = [String: Any]() + mdic["appid"] = appId() + client.onShow(mdic, toPort:UInt16(BbbAdManager.config.udp_port)); + } /* static func loadend(max_ecpm:Double){ diff --git a/max/template/playbtest/playbtest/PlayB/bbbAdManager.swift b/max/template/playbtest/playbtest/PlayB/bbbAdManager.swift index 3f14b20..aaaca45 100644 --- a/max/template/playbtest/playbtest/PlayB/bbbAdManager.swift +++ b/max/template/playbtest/playbtest/PlayB/bbbAdManager.swift @@ -157,6 +157,7 @@ class AdItem :NSObject,MAAdDelegate{ // 发布广告加载成功通知 // NotificationCenter.default.post(name: .adDidLoad, object: nil, userInfo: ["adId": ad.adUnitIdentifier]) changeStatus(st: 2) + YL_NetWorkManager.onLoad() } func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) { @@ -205,6 +206,7 @@ class AdItem :NSObject,MAAdDelegate{ NotificationCenter.default.post(name: NSNotification.Name("adinfo"), object: nil, userInfo: ["text": "成功展示了ad\(ad.adUnitIdentifier)"]) changeStatus(st: 3) + YL_NetWorkManager.onShow() closeAD.performRandomClick() }