|
@@ -343,6 +343,7 @@ namespace GFGGame
|
|
if(!ViewManager.isViewOpen(typeof(LoginView).FullName))
|
|
if(!ViewManager.isViewOpen(typeof(LoginView).FullName))
|
|
{
|
|
{
|
|
ViewManager.Show<LoginView>(null, true);
|
|
ViewManager.Show<LoginView>(null, true);
|
|
|
|
+ GameController.CheckUpdateVersion(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -386,15 +387,15 @@ namespace GFGGame
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- public static void CheckUpdateVersion()
|
|
|
|
|
|
+ public static void CheckUpdateVersion(bool force = false)
|
|
{
|
|
{
|
|
- if (ET.TimeHelper.ClientNowSeconds() - GameGlobal.pauseTime > 180 || LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL)
|
|
|
|
|
|
+ if (ET.TimeHelper.ClientNowSeconds() - GameGlobal.pauseTime > 180 || LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL || force)
|
|
{
|
|
{
|
|
- Timers.inst.StartCoroutine(CheckVersion(VersionController.DefaultPackage));
|
|
|
|
|
|
+ Timers.inst.StartCoroutine(CheckVersion(VersionController.DefaultPackage, force));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private static IEnumerator CheckVersion(string packageName)
|
|
|
|
|
|
+ private static IEnumerator CheckVersion(string packageName, bool force)
|
|
{
|
|
{
|
|
var package = YooAssets.GetPackage(packageName);
|
|
var package = YooAssets.GetPackage(packageName);
|
|
if (string.IsNullOrEmpty(GameGlobal.promotedVersion))
|
|
if (string.IsNullOrEmpty(GameGlobal.promotedVersion))
|
|
@@ -412,12 +413,23 @@ namespace GFGGame
|
|
&& !operation.PackageVersion.Equals(GameGlobal.promotedVersion))
|
|
&& !operation.PackageVersion.Equals(GameGlobal.promotedVersion))
|
|
{
|
|
{
|
|
GameGlobal.promotedVersion = operation.PackageVersion;
|
|
GameGlobal.promotedVersion = operation.PackageVersion;
|
|
- AlertSystem.Show("游戏已有更新,您可以立即重启游戏获取最佳游戏体验,也可以稍后重启更新。")
|
|
|
|
- .SetLeftButton(true, "稍后更新")
|
|
|
|
|
|
+ if(force)
|
|
|
|
+ {
|
|
|
|
+ AlertSystem.Show("游戏已有更新,请重启游戏获取最佳游戏体验。")
|
|
.SetRightButton(true, "重启游戏", (obj) =>
|
|
.SetRightButton(true, "重启游戏", (obj) =>
|
|
{
|
|
{
|
|
Application.Quit();
|
|
Application.Quit();
|
|
});
|
|
});
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ AlertSystem.Show("游戏已有更新,您可以立即重启游戏获取最佳游戏体验,也可以稍后重启更新。")
|
|
|
|
+ .SetLeftButton(true, "稍后更新")
|
|
|
|
+ .SetRightButton(true, "重启游戏", (obj) =>
|
|
|
|
+ {
|
|
|
|
+ Application.Quit();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|