Added UWorld

This commit is contained in:
AeonLucid
2022-01-09 21:21:18 +01:00
parent 29bd62cc9e
commit 49e6e0f6f8
10 changed files with 151 additions and 33 deletions
+12 -16
View File
@@ -1,4 +1,4 @@
using Prospect.Unreal.Net;
using Prospect.Unreal.Core;
using Serilog;
namespace Prospect.Server.Game;
@@ -10,9 +10,9 @@ internal static class Program
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)
public static async Task Main()
{
Console.CancelKeyPress += (s, e) =>
Console.CancelKeyPress += (_, e) =>
{
Tick.Dispose();
e.Cancel = true;
@@ -25,23 +25,19 @@ internal static class Program
.CreateLogger();
Logger.Information("Starting Prospect.Server.Game");
await using (var driver = new UIpNetDriver())
var worldUrl = new FUrl
{
driver.Init();
Map = "/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap"
};
await using (var world = new ProspectWorld(worldUrl))
{
world.Listen();
// Tick all components.
while (await Tick.WaitForNextTickAsync())
{
var deltaTime = TickRate;
driver.TickDispatch(deltaTime);
// driver.PostTickDispatch();
if (driver.ConnectionlessHandler != null)
{
driver.ConnectionlessHandler.Tick(deltaTime);
}
world.Tick(TickRate);
}
}