Browse Source

修复离线收益Bug

liuqilin 7 years ago
parent
commit
417f6f9bc3

+ 15 - 3
Assets/Script/Manage/HttpManager.cs

@@ -1777,12 +1777,24 @@ public class HttpManager : Regist
                 coinPerson += ability.NewCoinPerson;
             }
         }
-        float offlineTime = (float) CurrentDateTime.Subtract(Manager.LastQuitTime).TotalSeconds;
+        double offlineTime = (float)CurrentDateTime.Subtract(Manager.LastQuitTime).TotalSeconds;
+        offlineTime *= 100;
         offlineTime -= Time.time - Manager.GameBeginTime;
-        double offlineIncom = offlineTime*person*coinPerson;
+        if (offlineTime < Manager.OfflineMinTime)
+        {
+            offlineTime = 0;
+        }
+        if (offlineTime > Manager.OfflineMaxTime)
+        {
+            offlineTime = (long)Manager.OfflineMaxTime;
+
+            ResourceManager.SetText(CanvasLabel.Ba_Lab2, Language.GetStr(LanguageLabel.UI__Ba_Lab2));
+            ResourceManager.SetActive(CanvasLabel.Ba_Lab2, true);
+        }
+        double offlineIncom = offlineTime * person * coinPerson;
         if (offlineIncom > 0)
         {
-            offlineIncom = (long) Manager.AdjustOfflineIncome(offlineIncom);
+            offlineIncom = (long)Manager.AdjustOfflineIncome(offlineIncom);
 
             Manager.AddCoin(offlineIncom, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Income);
 

+ 1 - 0
Assets/Script/Manage/Manager.cs

@@ -1447,6 +1447,7 @@ public class Manager : Regist
         if (pause)
         {
             InBackground = true;
+            AlreadyGetOfflineIncome = true;
 
             if (DownloadConfigFlag)
             {

+ 4 - 4
ProjectSettings/ProjectSettings.asset

@@ -68,7 +68,7 @@ PlayerSettings:
   disableDepthAndStencilBuffers: 0
   defaultIsFullScreen: 1
   defaultIsNativeResolution: 1
-  runInBackground: 0
+  runInBackground: 1
   captureSingleScreen: 0
   muteOtherAudioSources: 0
   Prepare IOS For Recording: 0
@@ -122,13 +122,13 @@ PlayerSettings:
     16:9: 1
     Others: 1
   bundleIdentifier: com.dashgame.garden
-  bundleVersion: 1.2.7
+  bundleVersion: 1.2.8
   preloadedAssets: []
   metroInputSource: 0
   m_HolographicPauseOnTrackingLoss: 1
   xboxOneDisableKinectGpuReservation: 0
   protectGraphicsMemory: 0
-  AndroidBundleVersionCode: 19
+  AndroidBundleVersionCode: 20
   AndroidMinSdkVersion: 16
   AndroidPreferredInstallLocation: 1
   aotOptions: 
@@ -136,7 +136,7 @@ PlayerSettings:
   stripEngineCode: 0
   iPhoneStrippingLevel: 0
   iPhoneScriptCallOptimization: 0
-  iPhoneBuildNumber: 13
+  iPhoneBuildNumber: 14
   ForceInternetPermission: 0
   ForceSDCardPermission: 1
   CreateWallpaper: 0