|
@@ -6,25 +6,29 @@ namespace GFGGame
|
|
{
|
|
{
|
|
public class AntiAddictionController
|
|
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)
|
|
if (!GameGlobal.antiAddiction)
|
|
{
|
|
{
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- Debug.LogFormat("init onlineTimeSecs {0} onlineDurationSecs {1} onlineDurationSecsDay{2}", onlineTimeSecs, onlineDurationSecs, onlineDurationSecsDay);
|
|
|
|
int age = GameGlobal.userAge;
|
|
int age = GameGlobal.userAge;
|
|
if (age < 18)
|
|
if (age < 18)
|
|
{
|
|
{
|
|
int remainMinutes = GetRemainGameMinutes();
|
|
int remainMinutes = GetRemainGameMinutes();
|
|
if (remainMinutes <= 0)
|
|
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;
|
|
return true;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -51,13 +55,12 @@ namespace GFGGame
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- public static bool CheckOnlineTime(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
|
|
|
|
|
|
+ public static bool CheckAntiAddictionWhenPlay()
|
|
{
|
|
{
|
|
if (!GameGlobal.antiAddiction)
|
|
if (!GameGlobal.antiAddiction)
|
|
{
|
|
{
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- Debug.LogFormat("update onlineTimeSecs {0} onlineDurationSecs {1} onlineDurationSecsDay{2}", onlineTimeSecs, onlineDurationSecs, onlineDurationSecsDay);
|
|
|
|
int age = GameGlobal.userAge;
|
|
int age = GameGlobal.userAge;
|
|
if (age < 18)
|
|
if (age < 18)
|
|
{
|
|
{
|
|
@@ -150,7 +153,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
var dateTime = TimeHelper.DateTimeNow();
|
|
var dateTime = TimeHelper.DateTimeNow();
|
|
int hour = dateTime.Hour;
|
|
int hour = dateTime.Hour;
|
|
- if (hour >= 20 && hour < 21)
|
|
|
|
|
|
+ if (hour >= 17 && hour < 21)
|
|
{
|
|
{
|
|
int minute = dateTime.Minute;
|
|
int minute = dateTime.Minute;
|
|
return 60 - minute;
|
|
return 60 - minute;
|