-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unstable releases are now stable when the version of SE it was compiled with is stable
- Loading branch information
Showing
12 changed files
with
124 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Reflection; | ||
using VRage.Game; | ||
|
||
namespace Rynchodon.Loader | ||
{ | ||
public static class BuildTest | ||
{ | ||
|
||
/// <summary> | ||
/// Check that the current Space Engineers build is stable. | ||
/// </summary> | ||
/// <returns>True iff the current Space Engineers build is stable.</returns> | ||
public static bool IsStable() | ||
{ | ||
FieldInfo field = typeof(MyFinalBuildConstants).GetField("IS_STABLE"); | ||
if (field == null) | ||
throw new NullReferenceException("MyFinalBuildConstants does not have a field named IS_STABLE or it has unexpected binding"); | ||
return (bool)field.GetValue(null); | ||
} | ||
|
||
/// <summary> | ||
/// Check that a version's build matches the current Space Engineers build. | ||
/// </summary> | ||
/// <param name="version">The version that may be compatible.</param> | ||
/// <returns>True iff the version is compatible with the current Space Engineers build.</returns> | ||
public static bool MatchesCurrent(Version version) | ||
{ | ||
return IsStable() ? version.StableBuild : version.UnstableBuild; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters