incomplete sdk server + inferred server address

This commit is contained in:
rfi
2024-02-19 11:31:35 +07:00
parent 7445a1f5d8
commit 5e8f90b2e9
12 changed files with 193 additions and 6 deletions

View File

@@ -10,6 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\BLHX.Server.Game\BLHX.Server.Game.csproj" />
<ProjectReference Include="..\BLHX.Server.SDK\BLHX.Server.SDK.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,17 +1,25 @@
using BLHX.Server.Common.Utils;
using BLHX.Server.Game;
using BLHX.Server.Sdk;
using System.Net.NetworkInformation;
namespace BLHX.Server;
internal class Program
{
static void Main()
static void Main(string[] args)
{
Logger.c.Log("Starting...");
Config.Load();
if (Config.Instance.Address == "127.0.0.1")
{
Config.Instance.Address = NetworkInterface.GetAllNetworkInterfaces().Where(i => i.NetworkInterfaceType != NetworkInterfaceType.Loopback && i.OperationalStatus == OperationalStatus.Up).First().GetIPProperties().UnicastAddresses.Where(a => a.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().Address.ToString();
Config.Save();
}
Task.Run(GameServer.Start);
SDKServer.Main(args);
Task.Run(InputSystem.Start).Wait();
}
}