本地统计load
This commit is contained in:
parent
4225b1e92a
commit
2f9093bcc9
@ -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;
|
||||
|
||||
@ -245,6 +245,13 @@
|
||||
};
|
||||
[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 {
|
||||
|
||||
@ -1077,7 +1077,33 @@ 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){
|
||||
var mdic = [String: Any]()
|
||||
|
||||
@ -83,6 +83,7 @@ class AdItem :NSObject, ATInterstitialDelegate {
|
||||
BbbAdManager.config.loadcount1 += 1
|
||||
NSLog("XS- didFinishLoadingAD\(String(describing: placementID))")
|
||||
NotificationCenter.default.post(name: NSNotification.Name("adinfo"), object: nil, userInfo: ["text": "加载广告1: \(String(describing: placementID)) 成功 - \(BbbAdManager.config.loadcount1)"])
|
||||
YL_NetWorkManager.onLoad()
|
||||
changeStatus(st: 2)
|
||||
}
|
||||
|
||||
@ -324,7 +325,7 @@ class AdItem :NSObject, ATInterstitialDelegate {
|
||||
NotificationCenter.default.post(name: NSNotification.Name("adinfo"), object: nil, userInfo: ["text": "成功展示了ad\(placementID)"])
|
||||
|
||||
changeStatus(st: 3)
|
||||
|
||||
YL_NetWorkManager.onShow()
|
||||
initializationTopOn.performRandomClick()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user