Started on UE4 server, semi working handshake
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user