Skip to content

Commit

Permalink
fix version logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Rynchodon committed Mar 23, 2017
1 parent c479906 commit 99c7325
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Scripts/Properties/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
//
// Major, Minor, and Build should be set in VersionInfo.cs not VersionInfo - User.cs
// Revision is set by pre-build.py
[assembly: AssemblyVersion("1.79.14.0")]
[assembly: AssemblyVersion("1.79.15.0")]
28 changes: 18 additions & 10 deletions Scripts/Update/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static UpdateManager()
Logger.AlwaysLog("No file at " + AutopilotSettings, Logger.severity.WARNING);
}
else
Logger.AlwaysLog("No directory at " + oldPath);
Logger.DebugLog("No directory at " + oldPath);
}

/// <param name="unregisterOnClosing">Leave as null if you plan on using Unregister at all.</param>
Expand Down Expand Up @@ -473,16 +473,16 @@ public void Init()
myLogger.alwaysLog("Client, running client scripts only", Logger.severity.INFO);
}

#pragma warning disable 162
if (!MyFinalBuildConstants.IS_STABLE)
myLogger.alwaysLog("Space Engineers build is UNSTABLE");
if (!MyFinalBuildConstants.IS_OFFICIAL)
myLogger.alwaysLog("Space Engineers build is UNOFFICIAL");
if (MyFinalBuildConstants.IS_DEBUG)
myLogger.alwaysLog("Space Engineers build is DEBUG");
#pragma warning restore 162
if (!CheckFinalBuildConstant("IS_OFFICIAL"))
myLogger.alwaysLog("Space Engineers build is UNOFFICIAL; this build is not supported. Version: " + MyFinalBuildConstants.APP_VERSION_STRING, Logger.severity.WARNING);
else if (CheckFinalBuildConstant("IS_DEBUG"))
myLogger.alwaysLog("Space Engineers build is DEBUG; this build is not supported. Version: " + MyFinalBuildConstants.APP_VERSION_STRING, Logger.severity.WARNING);
else if (CheckFinalBuildConstant("IS_STABLE"))
myLogger.alwaysLog("Space Engineers build is STABLE. Version: " + MyFinalBuildConstants.APP_VERSION_STRING, Logger.severity.INFO);
else
myLogger.alwaysLog("Space Engineers build is UNSTABLE. Version: " + MyFinalBuildConstants.APP_VERSION_STRING, Logger.severity.INFO);

Logger.DebugNotify("ARMS dev version loaded", 10000, Logger.severity.INFO);
Logger.DebugNotify("ARMS DEBUG build loaded", 10000, Logger.severity.INFO);

ManagerStatus = Status.Initialized;
}
Expand All @@ -493,6 +493,14 @@ public void Init()
}
}

private bool CheckFinalBuildConstant(string fieldName)
{
FieldInfo field = typeof(MyFinalBuildConstants).GetField(fieldName);
if (field == null)
throw new NullReferenceException("MyFinalBuildConstants does not have a field named " + fieldName + " or it has unexpected binding");
return (bool)field.GetValue(null);
}

private void Start()
{
RegisterScripts_ClientAndServer();
Expand Down

0 comments on commit 99c7325

Please sign in to comment.