Browse Source

七日签到弹窗

zhaoyang 3 years ago
parent
commit
b0614e06b7

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstStorageId.cs

@@ -11,6 +11,7 @@ namespace GFGGame
         public const int SKIP_CHECK_OPEN = 20003;//跳过检查功能开启0不跳过,1跳过
         public const int SKIP_CHECK_OPEN = 20003;//跳过检查功能开启0不跳过,1跳过
         public const int STORAGE_CUSTOME_SUIT_INDEX = 20004;//自定义套装当前使用索引
         public const int STORAGE_CUSTOME_SUIT_INDEX = 20004;//自定义套装当前使用索引
         public const int FIELD_AUTO_PLAY_SPEED = 20005;//田野调查战斗速度
         public const int FIELD_AUTO_PLAY_SPEED = 20005;//田野调查战斗速度
+        public const int LAST_LOGIN_TIME = 20006;//上次登录时间
 
 
     }
     }
 }
 }

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

@@ -32,7 +32,8 @@ namespace GFGGame
         public static void GetGameCfg()
         public static void GetGameCfg()
         {
         {
             var url = LauncherConfig.cfgUrl.Replace("{cfgName}", GameGlobal.cfgName);
             var url = LauncherConfig.cfgUrl.Replace("{cfgName}", GameGlobal.cfgName);
-            HttpTool.Instance.Get(url, (string data) => {
+            HttpTool.Instance.Get(url, (string data) =>
+            {
                 GameGlobal.InitData(data);
                 GameGlobal.InitData(data);
                 //显示登录
                 //显示登录
                 LoginController.ShowLogin();
                 LoginController.ShowLogin();
@@ -99,6 +100,10 @@ namespace GFGGame
             await InstanceZonesSProxy.GetInstanceZonesInfos();
             await InstanceZonesSProxy.GetInstanceZonesInfos();
             await StorageSProxy.ReqGetClientValues();
             await StorageSProxy.ReqGetClientValues();
 
 
+            GameGlobal.lastLoginTime = StorageDataManager.Instance.GetStorageValue(ConstStorageId.LAST_LOGIN_TIME);
+            long lastTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
+            StorageSProxy.ReqSetClientValue(ConstStorageId.LAST_LOGIN_TIME, (int)lastTime).Coroutine();
+
             int skipGuide = StorageDataManager.Instance.GetStorageValue(ConstStorageId.STORAGE_SKIP_GUIDE);
             int skipGuide = StorageDataManager.Instance.GetStorageValue(ConstStorageId.STORAGE_SKIP_GUIDE);
 
 
             if (skipGuide <= 0 && LauncherConfig.netType == EnumNetType.LOCAL)
             if (skipGuide <= 0 && LauncherConfig.netType == EnumNetType.LOCAL)
@@ -132,7 +137,7 @@ namespace GFGGame
             GameGlobal.userId = 0;
             GameGlobal.userId = 0;
             GameGlobal.userAge = 0;
             GameGlobal.userAge = 0;
             GameGlobal.skipGuide = false;
             GameGlobal.skipGuide = false;
-            if(GameGlobal.myUnit != null)
+            if (GameGlobal.myUnit != null)
             {
             {
                 GameGlobal.myUnit.Dispose();
                 GameGlobal.myUnit.Dispose();
                 GameGlobal.myUnit = null;
                 GameGlobal.myUnit = null;

+ 2 - 1
GameClient/Assets/Game/HotUpdate/GameGlobal.cs

@@ -27,8 +27,9 @@ namespace GFGGame
         public static Scene zoneScene;
         public static Scene zoneScene;
         public static Unit myUnit;
         public static Unit myUnit;
         public static NumericComponent myNumericComponent;
         public static NumericComponent myNumericComponent;
+        public static int lastLoginTime;//上次登录时间
+
 
 
-        
 
 
         //平台
         //平台
         public static int platformId = 1;
         public static int platformId = 1;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -125,7 +125,7 @@ namespace GFGGame
             UpdateRoleLvl();
             UpdateRoleLvl();
             _valueBarController.OnShown();
             _valueBarController.OnShown();
 
 
-            long lastTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
+            long lastTime = GameGlobal.lastLoginTime;// GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);
             if (!TimeUtil.CheckIsSameTime(lastTime * 1000, TimeHelper.ClientNow()))
             if (!TimeUtil.CheckIsSameTime(lastTime * 1000, TimeHelper.ClientNow()))
             {
             {
                 ViewManager.Show<DailyLoginView>();
                 ViewManager.Show<DailyLoginView>();