Skip to content

Commit

Permalink
Support 2012 R2, fix initial ping
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Jun 25, 2024
1 parent c78f465 commit 62586c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
[assembly: AssemblyVersion("1.0.0.6")]
[assembly: AssemblyFileVersion("1.0.0.6")]
2 changes: 1 addition & 1 deletion XRFAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
2 changes: 2 additions & 0 deletions modNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public static void Load()
if (string.IsNullOrEmpty(Ping_InternetCheckAddress))
{
modDatabase.AddConfig(new modDatabase.Config { Key = "Ping_InternetCheckAddress", Value = "4.2.2.2" });
Ping_InternetCheckAddress = "4.2.2.2";
}

Ping_PublicIPSource = modDatabase.GetConfig("Ping_PublicIPSource");
if (string.IsNullOrEmpty(Ping_PublicIPSource))
{
modDatabase.AddConfig(new modDatabase.Config { Key = "Ping_PublicIPSource", Value = "dyndns" });
Ping_PublicIPSource = "dyndns";
}

PingTimer = new System.Timers.Timer();
Expand Down
8 changes: 7 additions & 1 deletion modSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ public static string GetWindowsVersion()
try
{
RegistryKey currentVersion = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\MICROSOFT\Windows NT\CurrentVersion");
string currentWindowsVersion = currentVersion.GetValue("CurrentMajorVersionNumber").ToString() + "." + currentVersion.GetValue("CurrentMinorVersionNumber").ToString() + "." + currentVersion.GetValue("CurrentBuild").ToString() + "." + currentVersion.GetValue("UBR").ToString();
string currentWindowsVersion = "";
if (currentVersion.GetValue("CurrentBuild").ToString() == "9600") {
// Temporary support for Windows Server 2012 R2
currentWindowsVersion = "6.3.9600." + "." + currentVersion.GetValue("UBR").ToString();
} else {
currentWindowsVersion = currentVersion.GetValue("CurrentMajorVersionNumber").ToString() + "." + currentVersion.GetValue("CurrentMinorVersionNumber").ToString() + "." + currentVersion.GetValue("CurrentBuild").ToString() + "." + currentVersion.GetValue("UBR").ToString();
}

string oldWindowsVersion = modDatabase.GetConfig("System_LastKnownWindowsVersion");
if (oldWindowsVersion != currentWindowsVersion)
Expand Down

0 comments on commit 62586c8

Please sign in to comment.