mirror of
https://github.com/NexusForever/NexusForever
synced 2026-08-14 00:26:05 -04:00
Servers now support graceful shutdown. Reworked how console commands are parsed to allow for graceful world server shutdown. Moved WebHost into generic host in world server. Added some additional logging and comments to various managers.
24 lines
667 B
C#
24 lines
667 B
C#
using System;
|
|
using System.Linq;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace NexusForever.Shared.Configuration
|
|
{
|
|
public static class SharedConfiguration
|
|
{
|
|
public static IConfiguration Configuration { get; private set; }
|
|
|
|
public static void Initialise(string file)
|
|
{
|
|
if (Configuration != null)
|
|
return;
|
|
|
|
var builder = new ConfigurationBuilder()
|
|
.AddJsonFile(file, false, true)
|
|
.AddEnvironmentVariables()
|
|
.AddCommandLine(Environment.GetCommandLineArgs().Skip(1).ToArray());
|
|
|
|
Configuration = builder.Build();
|
|
}
|
|
}
|
|
}
|