mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-04-21 17:15:43 +02:00
Force invariant culture for all applications
This commit is contained in:
parent
c1cbb848a9
commit
94148add2d
Agent/Phantom.Agent
Controller/Phantom.Controller
Utils/Phantom.Utils/Runtime
Web/Phantom.Web
@ -18,12 +18,13 @@ const int ProtocolVersion = 1;
|
||||
var shutdownCancellationTokenSource = new CancellationTokenSource();
|
||||
var shutdownCancellationToken = shutdownCancellationTokenSource.Token;
|
||||
|
||||
ProgramCulture.UseInvariantCulture();
|
||||
ThreadPool.SetMinThreads(workerThreads: 2, completionPortThreads: 1);
|
||||
|
||||
PosixSignals.RegisterCancellation(shutdownCancellationTokenSource, static () => {
|
||||
PhantomLogger.Root.InformationHeading("Stopping Phantom Panel agent...");
|
||||
});
|
||||
|
||||
ThreadPool.SetMinThreads(workerThreads: 2, completionPortThreads: 1);
|
||||
|
||||
try {
|
||||
var fullVersion = AssemblyAttributes.GetFullVersion(Assembly.GetExecutingAssembly());
|
||||
|
||||
|
@ -15,6 +15,8 @@ using Phantom.Utils.Tasks;
|
||||
var shutdownCancellationTokenSource = new CancellationTokenSource();
|
||||
var shutdownCancellationToken = shutdownCancellationTokenSource.Token;
|
||||
|
||||
ProgramCulture.UseInvariantCulture();
|
||||
|
||||
PosixSignals.RegisterCancellation(shutdownCancellationTokenSource, static () => {
|
||||
PhantomLogger.Root.InformationHeading("Stopping Phantom Panel controller...");
|
||||
});
|
||||
|
13
Utils/Phantom.Utils/Runtime/ProgramCulture.cs
Normal file
13
Utils/Phantom.Utils/Runtime/ProgramCulture.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace Phantom.Utils.Runtime;
|
||||
|
||||
public static class ProgramCulture {
|
||||
public static void UseInvariantCulture() {
|
||||
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
|
||||
|
||||
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
|
||||
}
|
||||
}
|
@ -17,6 +17,8 @@ using Phantom.Web.Services.Rpc;
|
||||
var shutdownCancellationTokenSource = new CancellationTokenSource();
|
||||
var shutdownCancellationToken = shutdownCancellationTokenSource.Token;
|
||||
|
||||
ProgramCulture.UseInvariantCulture();
|
||||
|
||||
PosixSignals.RegisterCancellation(shutdownCancellationTokenSource, static () => {
|
||||
PhantomLogger.Root.InformationHeading("Stopping Phantom Panel web...");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user