Merge pull request 'idk what's going on here it's probably fine' (#108) from waffle.lord/Installer:fix/version-checks into master

Reviewed-on: SPT/Installer#108
This commit is contained in:
IsWaffle 2024-10-04 13:56:17 +00:00
commit 55cd23a983
2 changed files with 22 additions and 3 deletions

View File

@ -73,8 +73,27 @@ public class ReleaseCheckTask : InstallerTaskBase
{ {
patchNeedCheck = false; patchNeedCheck = false;
} }
/*
An example of the logic going on here because holy shit I can't keep track of why we do it this way -waffle.lazy
---- Example data ----
gameVersion : 32738
sptVersion : 30626
SourceClientVersion : 32678
TargetClientVersion : 30626
patchNeeded : true
----------------------------
* spt client is 'outdated' if the game and target versions don't match
* or
* the game version is behind the mirror's source client version
sptClientIsOutdated = (30626 != 30626 || 32738 > 32678) && true
* otherwise, if the game version doesn't match the mirror's source version, we assume live is outdated
liveClientIsOutdated = 32738 != 32678 && true
*/
bool sptClientIsOutdated = intSPTVersion != patchMirrorInfo.TargetClientVersion && patchNeedCheck; bool sptClientIsOutdated = (intSPTVersion != patchMirrorInfo.TargetClientVersion || intGameVersion > patchMirrorInfo.SourceClientVersion) && patchNeedCheck;
bool liveClientIsOutdated = intGameVersion != patchMirrorInfo.SourceClientVersion && patchNeedCheck; bool liveClientIsOutdated = intGameVersion != patchMirrorInfo.SourceClientVersion && patchNeedCheck;
if (sptClientIsOutdated) if (sptClientIsOutdated)

View File

@ -10,8 +10,8 @@
<PackageIcon>icon.ico</PackageIcon> <PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon> <ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations> <Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.91</AssemblyVersion> <AssemblyVersion>2.92</AssemblyVersion>
<FileVersion>2.91</FileVersion> <FileVersion>2.92</FileVersion>
<Company>SPT</Company> <Company>SPT</Company>
</PropertyGroup> </PropertyGroup>