From 8685ebe65596ba64286af6242e7ed3b5093fbb02 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Nov 2022 00:20:37 +0000 Subject: [PATCH] try fix osx detection than ms keeps breaking --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 2 +- OpenSim/Framework/Servers/ServerBase.cs | 2 +- OpenSim/Framework/Util.cs | 14 ++++++++------ OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 689f3444d7..63cc4bb0a2 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -187,7 +187,7 @@ namespace OpenSim.Framework.Servers m_log.Info("[STARTUP]: version: " + m_version); m_log.InfoFormat("[STARTUP]: Operating system version: {0}, .NET platform {1}, Runtime {2}", - Environment.OSVersion, Environment.OSVersion.Platform, Environment.Version.ToString()); + Environment.OSVersion, Util.RuntimePlatformStr, Environment.Version.ToString()); m_log.InfoFormat("[STARTUP]: Processor Architecture: {0}({1} {2}bit)", RuntimeInformation.ProcessArchitecture.ToString(), BitConverter.IsLittleEndian ?"le":"be", Environment.Is64BitProcess ? "64" : "32"); diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 1def987169..3521528a7b 100755 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -140,7 +140,7 @@ namespace OpenSim.Framework.Servers //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); m_log.InfoFormat( "[SERVER BASE]: Operating system version: {0}, .NET platform {1}, {2}-bit", - Environment.OSVersion, Environment.OSVersion.Platform, Environment.Is64BitProcess ? "64" : "32"); + Environment.OSVersion, Util.RuntimePlatformStr, Environment.Is64BitProcess ? "64" : "32"); } public void RegisterCommonAppenders(IConfig startupConfig) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 518be9f41c..76d90b4f61 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2308,15 +2308,17 @@ namespace OpenSim.Framework //return os; } - public static string GetRuntimeInformation() - { - return RuntimeInformation.ProcessArchitecture.ToString() + "/" + Environment.OSVersion.Platform switch + public static readonly string RuntimeInformationStr = RuntimeInformation.ProcessArchitecture.ToString() + "/" + Environment.OSVersion.Platform switch { - PlatformID.MacOSX => "OSX/DotNet", - PlatformID.Unix => "Unix/DotNet", + PlatformID.MacOSX or PlatformID.Unix => RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "OSX/DotNet" : "Unix/DotNet", + _ => "Win/DotNet", + }; + + public static readonly string RuntimePlatformStr = Environment.OSVersion.Platform switch + { + PlatformID.MacOSX or PlatformID.Unix => RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "OSX/DotNet" : "Unix/DotNet", _ => "Win/DotNet", }; - } /// /// Is the given string a UUID? diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index dab09e20ed..a3ae816536 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -875,7 +875,7 @@ namespace OpenSim.Region.Framework.Scenes PhysicsEnabled = !RegionInfo.RegionSettings.DisablePhysics; - m_simulatorVersion = simulatorVersion + " (" + Util.GetRuntimeInformation() + ")"; + m_simulatorVersion = simulatorVersion + " (" + Util.RuntimeInformationStr + ")"; #region Region Config