|
@@ -6,8 +6,10 @@ namespace GFGGame
|
|
|
{
|
|
|
public class AntiAddictionController
|
|
|
{
|
|
|
- public static bool CheckAntiAddiction(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay) {
|
|
|
- if(!GameGlobal.antiAddiction) {
|
|
|
+ public static bool CheckAntiAddiction(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
|
|
|
+ {
|
|
|
+ if (!GameGlobal.antiAddiction)
|
|
|
+ {
|
|
|
return false;
|
|
|
}
|
|
|
Debug.LogFormat("init onlineTimeSecs {0} onlineDurationSecs {1} onlineDurationSecsDay{2}", onlineTimeSecs, onlineDurationSecs, onlineDurationSecsDay);
|
|
@@ -18,8 +20,9 @@ namespace GFGGame
|
|
|
if (remainMinutes <= 0)
|
|
|
{
|
|
|
string promptStr = "您属于未成年人,已被纳入防沉迷系统。仅可在周五、周六、周日和法定节假日每日20时至21时登录游戏,目前已超出健康游戏体验时间,将强制游戏下线。";
|
|
|
- Alert.Show(promptStr)
|
|
|
- .SetRightButton(true, "知道啦", (object data) => {
|
|
|
+ AlertSystem.Show(promptStr)
|
|
|
+ .SetRightButton(true, "知道啦", (object data) =>
|
|
|
+ {
|
|
|
GameController.QuitToLoginView(false);
|
|
|
});
|
|
|
return true;
|
|
@@ -41,15 +44,16 @@ namespace GFGGame
|
|
|
promptStr += "单次充值金额不得超过{0}元人民币,每月充值金额不得超过{1}元人民币。";
|
|
|
promptStr = String.Format(promptStr, maxRechargeSingle, maxRechargeTotal);
|
|
|
}
|
|
|
- Alert.Show(promptStr)
|
|
|
+ AlertSystem.Show(promptStr)
|
|
|
.SetRightButton(true, "知道啦");
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public static bool CheckOnlineTime(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay) {
|
|
|
- if(!GameGlobal.antiAddiction)
|
|
|
+ public static bool CheckOnlineTime(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
|
|
|
+ {
|
|
|
+ if (!GameGlobal.antiAddiction)
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
@@ -61,8 +65,9 @@ namespace GFGGame
|
|
|
if (remainMinutes <= 0)
|
|
|
{
|
|
|
string promptStr = "您属于未成年人,已被纳入防沉迷系统。仅可在周五、周六、周日和法定节假日每日20时至21时登录游戏。目前已超出健康游戏体验时间,将强制游戏下线。";
|
|
|
- Alert.Show(promptStr)
|
|
|
- .SetRightButton(true, "知道啦", (object data) => {
|
|
|
+ AlertSystem.Show(promptStr)
|
|
|
+ .SetRightButton(true, "知道啦", (object data) =>
|
|
|
+ {
|
|
|
GameController.QuitToLoginView(false);
|
|
|
});
|
|
|
return true;
|
|
@@ -71,8 +76,9 @@ namespace GFGGame
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public static bool CheckAntiAddictionRecharge(int value) {
|
|
|
- if(!GameGlobal.antiAddiction)
|
|
|
+ public static bool CheckAntiAddictionRecharge(int value)
|
|
|
+ {
|
|
|
+ if (!GameGlobal.antiAddiction)
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
@@ -80,8 +86,8 @@ namespace GFGGame
|
|
|
if (GameGlobal.isVisitor)
|
|
|
{
|
|
|
promptStr += "您当前为游客模式,已被纳入防沉迷系统,在此模式下不能充值和付费消费。";
|
|
|
- Alert.Show(promptStr)
|
|
|
- .SetRightButton(true, "知道啦");
|
|
|
+ AlertSystem.Show(promptStr)
|
|
|
+ .SetRightButton(true, "知道啦");
|
|
|
return true;
|
|
|
}
|
|
|
string ageRangeStr = null;
|
|
@@ -94,7 +100,7 @@ namespace GFGGame
|
|
|
if (age < 8)
|
|
|
{
|
|
|
promptStr += "本游戏不为未满8周岁的用户提供游戏充值服务。";
|
|
|
- Alert.Show(promptStr)
|
|
|
+ AlertSystem.Show(promptStr)
|
|
|
.SetRightButton(true, "知道啦");
|
|
|
return true;
|
|
|
}
|
|
@@ -105,7 +111,7 @@ namespace GFGGame
|
|
|
{
|
|
|
promptStr += "单次充值金额不得超过{0}元人民币,每月充值金额不得超过{1}元人民币。";
|
|
|
promptStr = String.Format(promptStr, maxRechargeSingle, maxRechargeTotal);
|
|
|
- Alert.Show(promptStr)
|
|
|
+ AlertSystem.Show(promptStr)
|
|
|
.SetRightButton(true, "知道啦");
|
|
|
return true;
|
|
|
}
|
|
@@ -113,7 +119,8 @@ namespace GFGGame
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private static void GetAntiValue(out string ageRangeStr, out int maxRechargeSingle, out int maxRechargeTotal) {
|
|
|
+ private static void GetAntiValue(out string ageRangeStr, out int maxRechargeSingle, out int maxRechargeTotal)
|
|
|
+ {
|
|
|
int age = GameGlobal.userAge;
|
|
|
if (age < 8)
|
|
|
{
|