From 0bef50e9ddf0df2d7bd9025086d5c526740c29db Mon Sep 17 00:00:00 2001
From: Spring774 <337905794@qq.com>
Date: Tue, 04 Nov 2025 21:20:18 +0800
Subject: [PATCH] 接为华为,可以直接提交审核
---
assets/Script/Sdk/SdkHuawei.ts | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/assets/Script/Sdk/SdkHuawei.ts b/assets/Script/Sdk/SdkHuawei.ts
index 61735d6..f6a6503 100644
--- a/assets/Script/Sdk/SdkHuawei.ts
+++ b/assets/Script/Sdk/SdkHuawei.ts
@@ -23,8 +23,9 @@
success: (data) => {
// 登录成功后,可以存储账号信息。
console.log(" game login with real success:" + JSON.stringify(data));
- cb && cb();
+ cb && cb(true);
+ this.lastShowInterAdTime = Date.now();
this.getOAID();
this.reLoadVideo();
@@ -36,13 +37,15 @@
//此时,建议返回游戏界面,可以让玩家重新进行登录操作。
if (code == 7004 || code == 2012) {
console.log("玩家取消登录,返回游戏界面让玩家重新登录。");
- cc.director.loadScene('logo');
+ // cc.director.loadScene('logo');
+ cb && cb(false);
} else
//状态码为7021表示玩家取消实名认证。
//在中国大陆的情况下,此时需要禁止玩家进入游戏。
if (code == 7021) {
console.log("The player has canceled identity verification. Forbid the player from entering the game.")
- cc.director.loadScene('logo');
+ // cc.director.loadScene('logo');
+ cc.game.end();
} else {
cc.game.end();
}
@@ -67,13 +70,11 @@
//Ads
showInterAd() {
cc.log('show InterAd');
- // if (Date.now() - this.lastShowInterAdTime > 30000) {//最少间隔30秒
- // this.lastShowInterAdTime = Date.now();
+ if (Date.now() - this.lastShowInterAdTime > 40000) {//最少间隔40秒
+ this.lastShowInterAdTime = Date.now();
-
- // }
-
- this.loadInterAd();
+ this.loadInterAd();
+ }
}
@@ -83,8 +84,8 @@
}
this.interstitialAd = qg.createInterstitialAd({
adUnitId:
- // "g2tz5d4wkv" //测试ID
- "q5m5hlquus"//正式ID
+ // "g2tz5d4wkv" //测试ID
+ "q5m5hlquus"//正式ID
});
this.interstitialAd.load({
"channelExtras": {
@@ -114,8 +115,8 @@
reLoadVideo() {
this.rewardedVideoAd = qg.createRewardedVideoAd({
adUnitId:
- // "testx9dtjwj8hp" //测试ID
- "v1gtsb1ga8" //正式ID
+ // "testx9dtjwj8hp" //测试ID
+ "v1gtsb1ga8" //正式ID
,
success: (code) => {
cc.log("ad demo : loadAndShowVideoAd createRewardedVideoAd success");
@@ -159,6 +160,7 @@
// cb && cb(true);
rewardCallback = cb;
+ this.lastShowInterAdTime = Date.now();
this.rewardedVideoAd.show();
this.rewardedVideoAd.load();
}
--
Gitblit v1.9.1