guodong před 3 roky
rodič
revize
90a50a2f19

+ 14 - 11
GameClient/Assets/Game/HotUpdate/Controller/AntiAddictionController.cs

@@ -6,25 +6,29 @@ namespace GFGGame
 {
     public class AntiAddictionController
     {
-        public static bool CheckAntiAddiction(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
+        public static void ShowAntiAddictionAlert()
+        {
+            string promptStr = "您属于未成年人,账号已被纳入防沉迷系统,根据国家新闻出版署《关于防止未成年人沉迷网络游戏的通知》、《关于进一步严格管理切实防止未成年人沉迷网络游戏的通知》要求,您仅可在周五、周六、周日和法定节假日每日20时只21时登录游戏。未满8周岁用户无法充值;8周岁至未满16周岁用户单次充值不得超过50元,每月累计充值金额不得超过200元;16周岁至未满18周岁用户单次充值不得超过100元,每月累计充值金额不得超过400元。目前已超出健康游戏体验时间,将强制游戏下线。";
+            AlertSystem.Show(promptStr)
+                .SetRightButton(true, "知道啦", (object data) =>
+                {
+                    GameController.QuitToLoginView(true);
+                });
+        }
+
+        public static bool CheckAntiAddictionWhenLogin()
         {
             if (!GameGlobal.antiAddiction)
             {
                 return false;
             }
-            Debug.LogFormat("init onlineTimeSecs {0} onlineDurationSecs {1} onlineDurationSecsDay{2}", onlineTimeSecs, onlineDurationSecs, onlineDurationSecsDay);
             int age = GameGlobal.userAge;
             if (age < 18)
             {
                 int remainMinutes = GetRemainGameMinutes();
                 if (remainMinutes <= 0)
                 {
-                    string promptStr = "您属于未成年人,账号已被纳入防沉迷系统,根据国家新闻出版署《关于防止未成年人沉迷网络游戏的通知》、《关于进一步严格管理切实防止未成年人沉迷网络游戏的通知》要求,您仅可在周五、周六、周日和法定节假日每日20时只21时登录游戏。未满8周岁用户无法充值;8周岁至未满16周岁用户单次充值不得超过50元,每月累计充值金额不得超过200元;16周岁至未满18周岁用户单次充值不得超过100元,每月累计充值金额不得超过400元。目前已超出健康游戏体验时间,将强制游戏下线。";
-                    AlertSystem.Show(promptStr)
-                        .SetRightButton(true, "知道啦", (object data) =>
-                        {
-                            GameController.QuitToLoginView(false);
-                        });
+                    ShowAntiAddictionAlert();
                     return true;
                 }
                 else
@@ -51,13 +55,12 @@ namespace GFGGame
             return false;
         }
 
-        public static bool CheckOnlineTime(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
+        public static bool CheckAntiAddictionWhenPlay()
         {
             if (!GameGlobal.antiAddiction)
             {
                 return false;
             }
-            Debug.LogFormat("update onlineTimeSecs {0} onlineDurationSecs {1} onlineDurationSecsDay{2}", onlineTimeSecs, onlineDurationSecs, onlineDurationSecsDay);
             int age = GameGlobal.userAge;
             if (age < 18)
             {
@@ -150,7 +153,7 @@ namespace GFGGame
         {
             var dateTime = TimeHelper.DateTimeNow();
             int hour = dateTime.Hour;
-            if (hour >= 20 && hour < 21)
+            if (hour >= 17 && hour < 21)
             {
                 int minute = dateTime.Minute;
                 return 60 - minute;

+ 2 - 7
GameClient/Assets/Game/HotUpdate/Controller/ErrorCodeController.cs

@@ -14,7 +14,7 @@ namespace GFGGame
                         AlertSystem.Show("网络异常,也有可能是服务器异常,请稍后再试!")
                         .SetRightButton(true, "好的", (object data) =>
                         {
-                            
+                            GameController.QuitToLoginView(false);
                         });
                     }
                     break;
@@ -47,12 +47,7 @@ namespace GFGGame
                     break;
                 case ET.ErrorCode.ERR_AntiAddiction:
                     {
-                        string promptStr = "您属于未成年人,已被纳入防沉迷系统,当前为非游戏时间,本游戏将无法为未成年人用户提供游戏服务。";
-                        AlertSystem.Show(promptStr)
-                            .SetRightButton(true, "休息一下", (object data) =>
-                            {
-                                Application.Quit();
-                            });
+                        AntiAddictionController.ShowAntiAddictionAlert();
                         return false;
                     }
                 default:

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -93,6 +93,11 @@ namespace GFGGame
             ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
             EventAgent.DispatchEvent(ConstMessage.SERVER_CHANGE, serverInfosComponent.CurrentServerId);
             EventAgent.DispatchEvent(ConstMessage.LOGIN_SUCCESS);
+            if(AntiAddictionController.CheckAntiAddictionWhenLogin())
+            {
+                ViewManager.Hide<ModalStatusView>();
+                return;
+            }
             await ReqNoticeInfo();
 
             ViewManager.Hide<ModalStatusView>();

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Data/Handler/RoleDataHandler.cs

@@ -20,6 +20,11 @@ namespace GFGGame
 
         private static void OnUpdate(object param)
         {
+            if(AntiAddictionController.CheckAntiAddictionWhenPlay())
+            {
+                StopUpdate();
+                return;
+            }
             int currentTimeSecs = (int)(Game.TimeInfo.ServerNow() / 1000);
             if (!RoleDataManager.powerTimeServerLock && !RoleDataManager.CheckPowerFull())
             {

+ 7 - 5
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -1,8 +1,5 @@
-using System;
-using UnityEngine;
 using FairyGUI;
 using ET;
-using System.Collections.Generic;
 
 namespace GFGGame
 {
@@ -11,8 +8,13 @@ namespace GFGGame
         public static bool powerTimeServerLock;
         public static long roleId;
         public static string roleName;
-        public static int rechargeTotal;
-        public static int rechargeTotalMon;
+        public static int rechargeTotalMon
+        {
+            get
+            {
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.RechargeTotaMonthly);
+            }
+        }
         public static string slogan = "";
 
         public static int power

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Login/LoginHelper.cs

@@ -81,7 +81,7 @@ namespace ET
             accountInfoComponent.Token = a2CLoginAccount.Token;
             accountInfoComponent.AccountId = a2CLoginAccount.AccountId;
             accountInfoComponent.Account = account;
-
+            accountInfoComponent.Age = a2CLoginAccount.Age;
         }
 
 

+ 5 - 2
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertWindow.cs

@@ -223,8 +223,11 @@ namespace GFGGame
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
-            GuideController.TryGuide(_ui.m_btnRight, ConstGuideId.LUCKY_BOX, 4, "点击确定。");
-            GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX, 4);
+            if(GameGlobal.DataInited)
+            {
+                GuideController.TryGuide(_ui.m_btnRight, ConstGuideId.LUCKY_BOX, 4, "点击确定。");
+                GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX, 4);
+            }
         }
 
     }

+ 5 - 3
GameClient/Assets/Game/HotUpdate/Views/RechargeStore/RechargeStoreView.cs

@@ -140,9 +140,11 @@ namespace GFGGame
             {
                 item.target.onClick.Add(() =>
                 {
-                    RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
-                    LogServerHelper.SendNodeLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
-
+                    if(!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
+                    {
+                        RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
+                        LogServerHelper.SendNodeLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
+                    }
                 });
             }
             item.target.data = index;