Prechádzať zdrojové kódy

【功能】添加防沉迷,添加游戏实名制认证

mojunshou 7 mesiacov pred
rodič
commit
0e9786a181

BIN
assets/bundle/gui/eliminate/texture/bg/bg11.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/bg/bg11.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "9d1882a5-d3d5-4c72-bbaa-2b26efe16beb",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "9d1882a5-d3d5-4c72-bbaa-2b26efe16beb@6c48a",
+      "displayName": "bg11",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "9d1882a5-d3d5-4c72-bbaa-2b26efe16beb",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "9d1882a5-d3d5-4c72-bbaa-2b26efe16beb@f9941",
+      "displayName": "bg11",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 568,
+        "height": 300,
+        "rawWidth": 568,
+        "rawHeight": 300,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -284,
+            -150,
+            0,
+            284,
+            -150,
+            0,
+            -284,
+            150,
+            0,
+            284,
+            150,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            300,
+            568,
+            300,
+            0,
+            0,
+            568,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -284,
+            -150,
+            0
+          ],
+          "maxPos": [
+            284,
+            150,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "9d1882a5-d3d5-4c72-bbaa-2b26efe16beb@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "9d1882a5-d3d5-4c72-bbaa-2b26efe16beb@6c48a"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/icon_qsnbh.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/icon_qsnbh.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "51d80e39-2819-4b51-9d32-03744ae3281f",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "51d80e39-2819-4b51-9d32-03744ae3281f@6c48a",
+      "displayName": "icon_qsnbh",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "51d80e39-2819-4b51-9d32-03744ae3281f",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "51d80e39-2819-4b51-9d32-03744ae3281f@f9941",
+      "displayName": "icon_qsnbh",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": -0.5,
+        "offsetY": -9.5,
+        "trimX": 2,
+        "trimY": 20,
+        "width": 235,
+        "height": 203,
+        "rawWidth": 240,
+        "rawHeight": 224,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -117.5,
+            -101.5,
+            0,
+            117.5,
+            -101.5,
+            0,
+            -117.5,
+            101.5,
+            0,
+            117.5,
+            101.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            2,
+            204,
+            237,
+            204,
+            2,
+            1,
+            237,
+            1
+          ],
+          "nuv": [
+            0.008333333333333333,
+            0.004464285714285714,
+            0.9875,
+            0.004464285714285714,
+            0.008333333333333333,
+            0.9107142857142857,
+            0.9875,
+            0.9107142857142857
+          ],
+          "minPos": [
+            -117.5,
+            -101.5,
+            0
+          ],
+          "maxPos": [
+            117.5,
+            101.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "51d80e39-2819-4b51-9d32-03744ae3281f@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "51d80e39-2819-4b51-9d32-03744ae3281f@6c48a"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/icon_sltx.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/icon_sltx.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "575dd6b1-b8c6-4131-a61c-2fc2019cc256",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "575dd6b1-b8c6-4131-a61c-2fc2019cc256@6c48a",
+      "displayName": "icon_sltx",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "575dd6b1-b8c6-4131-a61c-2fc2019cc256",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "575dd6b1-b8c6-4131-a61c-2fc2019cc256@f9941",
+      "displayName": "icon_sltx",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 66,
+        "height": 84,
+        "rawWidth": 66,
+        "rawHeight": 84,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -33,
+            -42,
+            0,
+            33,
+            -42,
+            0,
+            -33,
+            42,
+            0,
+            33,
+            42,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            84,
+            66,
+            84,
+            0,
+            0,
+            66,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -33,
+            -42,
+            0
+          ],
+          "maxPos": [
+            33,
+            42,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "575dd6b1-b8c6-4131-a61c-2fc2019cc256@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "575dd6b1-b8c6-4131-a61c-2fc2019cc256@6c48a"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/title/title_qsnbh.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/title/title_qsnbh.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "559772ec-0fe6-4004-8bba-bc2c3c745b24",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "559772ec-0fe6-4004-8bba-bc2c3c745b24@6c48a",
+      "displayName": "title_qsnbh",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "559772ec-0fe6-4004-8bba-bc2c3c745b24",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "559772ec-0fe6-4004-8bba-bc2c3c745b24@f9941",
+      "displayName": "title_qsnbh",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 4,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 548,
+        "height": 116,
+        "rawWidth": 548,
+        "rawHeight": 124,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -274,
+            -58,
+            0,
+            274,
+            -58,
+            0,
+            -274,
+            58,
+            0,
+            274,
+            58,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            124,
+            548,
+            124,
+            0,
+            8,
+            548,
+            8
+          ],
+          "nuv": [
+            0,
+            0.06451612903225806,
+            1,
+            0.06451612903225806,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -274,
+            -58,
+            0
+          ],
+          "maxPos": [
+            274,
+            58,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "559772ec-0fe6-4004-8bba-bc2c3c745b24@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "559772ec-0fe6-4004-8bba-bc2c3c745b24@6c48a"
+  }
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 778 - 223
assets/bundle/gui/loading/loading.prefab


+ 1 - 2
assets/script/game/common/config/GameUIConfig.ts

@@ -1,7 +1,7 @@
 /*
  * @Date: 2021-08-12 09:33:37
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-28 17:09:35
+ * @LastEditTime: 2025-05-06 15:29:23
  */
 import { LayerType, UIConfig } from "../../../../../extensions/oops-plugin-framework/assets/core/gui/layer/LayerManager";
 
@@ -106,5 +106,4 @@ export var UIConfigData: { [key: number]: UIConfig } = {
 
 
 
-
 }

+ 3 - 1
assets/script/game/common/manager/ADHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:14:44
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-30 17:36:00
+ * @LastEditTime: 2025-05-06 15:20:55
  * @Description: 
  */
 // ADHandler.ts
@@ -81,6 +81,7 @@ export class ADHandler {
         if (oops.gui.has(UIID.KindTips)) oops.gui.remove(UIID.KindTips);
         if (oops.gui.has(UIID.Retention)) oops.gui.remove(UIID.Retention);
         ServerHandler.inst.getAccountInfo();
+        LoginHandler.inst.openChildProtection();
     };
 
     adSplashLoadFailed = () => {
@@ -88,6 +89,7 @@ export class ADHandler {
         console.log('[广告] 启屏广告加载失败');
         ServerHandler.inst.getAccountInfo();
         //加载实名认证
+        LoginHandler.inst.openChildProtection();
     };
 
     //插屏广告展示的时候也要暂停

+ 22 - 1
assets/script/game/common/manager/LoginHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:15:45
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-30 18:32:37
+ * @LastEditTime: 2025-05-06 10:32:01
  * @Description: 登录管理
  */
 // LoginHandler.ts
@@ -99,6 +99,27 @@ export class LoginHandler {
         DCHandler.inst.reportData(3000004, 1002);
     }
 
+
+    /**打开防沉迷*/
+    openChildProtection() {
+        const param = {
+            callback: {
+                onSuccess: 'LoginHandler.inst.openChildProtectionSuccess',
+                onFail: 'LoginHandler.inst.openChildProtectionFail'
+            }
+        }
+        const data = { method: 'sdk.realname.start', param: JSON.stringify(param) };
+        CocosHandler.inst.sendMessageToAndroid(data, '打开防沉迷');
+    }
+
+    openChildProtectionSuccess(str: string) {
+        console.log('[防沉迷] 打开成功', str);
+    }
+
+    openChildProtectionFail(str: number) {
+        console.log('[防沉迷] 打开失败', str);
+    }
+
 }
 
 window["LoginHandler"] = LoginHandler;

+ 2 - 3
assets/script/game/common/tips/KindTipsView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 18:02:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 16:51:29
+ * @LastEditTime: 2025-05-06 10:52:05
  * @Description: 温馨提示弹窗
  */
 import { _decorator } from 'cc';
@@ -27,10 +27,9 @@ export class KindTipsView extends GameComponent {
         DCHandler.inst.reportData(3000000)
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
             LoginHandler.inst.savePrivacyStatus(true);
+            //加载实名制保护
             this.scheduleOnce(() => {
                 ADHandler.inst.showAd(AD_TYPE.Start);
-                //先关闭,同意直接进游戏
-                // ServerHandler.inst.getAccountInfo();
                 oops.gui.remove(UIID.KindTips);
             }, 0.2)
         }

+ 1 - 1
assets/script/game/common/tips/RetentionView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 18:02:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 09:53:39
+ * @LastEditTime: 2025-05-06 14:31:15
  * @Description: 隐私挽留弹窗
  */
 import { _decorator, game } from 'cc';

+ 5 - 5
assets/script/game/initialize/view/LoadingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 16:23:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-30 18:33:30
+ * @LastEditTime: 2025-05-06 15:25:59
  * @Description: loading界面
  */
 import { _decorator, Toggle } from "cc";
@@ -126,7 +126,6 @@ export class LoadingViewComp extends CCVMParentComp {
     private onProgressCallback(finished: number, total: number, item: any) {
         this.data.finished = finished;
         this.data.total = total;
-
         var progress = finished / total;
         if (progress > this.progress) {
             this.progress = progress;
@@ -139,7 +138,6 @@ export class LoadingViewComp extends CCVMParentComp {
         // 获取用户信息的多语言提示文本
         this.data.prompt = oops.language.getLangByID("loading_load_player");
         await ModuleUtil.addViewUiAsync(smc.account, EliminateViewComp, UIID.Eliminate);
-        // await ModuleUtil.addViewUiAsync(smc.account, EliminateView, UIID.Eliminate);
         ModuleUtil.removeViewUi(this.ent, LoadingViewComp, UIID.Loading);
     }
 
@@ -167,12 +165,14 @@ export class LoadingViewComp extends CCVMParentComp {
         if (wxNode) {
             wxNode.active = state;
         }
-
-        //load条相反
         const loadNode = this.node.getChildByName("pro_progress");
+        const tipsNode = this.node.getChildByPath("pro_progress/tipsNode");
         if (loadNode) {
             loadNode.active = !state;
         }
+        if (tipsNode) {
+            tipsNode.active = !state;
+        }
     }
 
 

+ 2 - 2
native/engine/android/app/src/main/assets/ysdkconf.ini

@@ -1,9 +1,9 @@
 ;**************游戏相关配置, 游戏需要根据各自情况修改 START **********
 ;游戏的QQAPPID
-QQ_APP_ID=11122180511
+QQ_APP_ID=11122180522
 
 ;游戏的OFFER_ID
-OFFER_ID=11122180511
+OFFER_ID=11122180522
 ;***************游戏配置项, 游戏需要根据各自情况修改 END **************
 
 ;************* YSDK相关配置项,游戏需要根据各自情况修改 START **********