refactor: added server project
This commit is contained in:
22
Platforms/Server/Program.cs
Normal file
22
Platforms/Server/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Syntriax.Engine.Core;
|
||||
|
||||
IUniverse universe = Pong.PongUniverse.GetPongUniverse(isServerEnabled: true, isClientEnabled: false);
|
||||
|
||||
DateTime lastRun = DateTime.UtcNow;
|
||||
TimeSpan interval = new(0, 0, 0, 0, 16);
|
||||
TimeSpan timeSinceStart = new(0);
|
||||
|
||||
universe.Initialize();
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (lastRun + interval <= DateTime.UtcNow)
|
||||
{
|
||||
lastRun += interval;
|
||||
timeSinceStart += interval;
|
||||
universe.Update(new(timeSinceStart, interval));
|
||||
}
|
||||
Thread.Sleep(1);
|
||||
}
|
20
Platforms/Server/Server.csproj
Normal file
20
Platforms/Server/Server.csproj
Normal file
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../Shared/Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.2.1105">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user