This commit is contained in:
陈思海 2026-03-11 15:23:50 +08:00
parent 8a236fba5a
commit 0053647441
2 changed files with 11 additions and 1 deletions

View File

@ -11,6 +11,9 @@ namespace Unity.Startup.Procedure
/// </summary> /// </summary>
public sealed class ProcedureGetAppVersionInfoState : ProcedureBase public sealed class ProcedureGetAppVersionInfoState : ProcedureBase
{ {
private const int MaxTryCount = 3;
private int currentTryCount;
protected override void OnEnter() protected override void OnEnter()
{ {
base.OnEnter(); base.OnEnter();
@ -22,6 +25,7 @@ namespace Unity.Startup.Procedure
{ {
try try
{ {
currentTryCount++;
if (StartupSetting.Version != AppVersion.GameVersion) if (StartupSetting.Version != AppVersion.GameVersion)
{ {
Log.Warning($"Version inconsistency : {AppVersion.GameVersion}->{StartupSetting.Version} "); Log.Warning($"Version inconsistency : {AppVersion.GameVersion}->{StartupSetting.Version} ");
@ -34,11 +38,17 @@ namespace Unity.Startup.Procedure
return; return;
} }
SwitchProcedure<ProcedureInitPackageState>(); SwitchProcedure<ProcedureInitPackageState>();
} }
catch (Exception e) catch (Exception e)
{ {
Log.Exception(e); Log.Exception(e);
if (currentTryCount > MaxTryCount)
{
return;
}
await UniTask.Delay(3000); await UniTask.Delay(3000);
GetAppVersionInfo(); GetAppVersionInfo();
} }

@ -1 +1 @@
Subproject commit 49ecff82621c18e1521ed58d72bb6f932d5da658 Subproject commit 839af110274ffe9498f4de468723ced56216b0f5