Started on UE4 server, semi working handshake

This commit is contained in:
AeonLucid
2022-01-09 06:29:02 +01:00
parent e9091d7ac3
commit ed0f771df6
34 changed files with 2931 additions and 9 deletions
+44 -3
View File
@@ -1,9 +1,50 @@
namespace Prospect.Server.Game;
using Prospect.Unreal.Net;
using Serilog;
namespace Prospect.Server.Game;
internal static class Program
{
public static void Main(string[] args)
private const float TickRate = (1000.0f / 60.0f) / 1000.0f;
private static readonly ILogger Logger = Log.ForContext(typeof(Program));
private static readonly PeriodicTimer Tick = new PeriodicTimer(TimeSpan.FromSeconds(TickRate));
public static async Task Main(string[] args)
{
Console.WriteLine("Hello, World!");
Console.CancelKeyPress += (s, e) =>
{
Tick.Dispose();
e.Cancel = true;
};
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.Enrich.FromLogContext()
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] ({SourceContext,-52}) {Message:lj}{NewLine}{Exception}")
.CreateLogger();
Logger.Information("Starting Prospect.Server.Game");
await using (var driver = new UIpNetDriver())
{
driver.Init();
// Tick all components.
while (await Tick.WaitForNextTickAsync())
{
var deltaTime = TickRate;
driver.TickDispatch(deltaTime);
// driver.PostTickDispatch();
if (driver.ConnectionlessHandler != null)
{
driver.ConnectionlessHandler.Tick(deltaTime);
}
}
}
Logger.Information("Shutting down");
}
}
@@ -12,4 +12,8 @@
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Prospect.Unreal\Prospect.Unreal.csproj" />
</ItemGroup>
</Project>