1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-10-18 06:42:50 +02:00

Compare commits

..

No commits in common. "0091fa11fb533e88a95a3b13c88a18d9763e16c6" and "f211708509e67fa6e0f36492f83d1fa9fb3623ab" have entirely different histories.

71 changed files with 179 additions and 75 deletions

View File

@ -1,5 +1,5 @@
using Phantom.Utils.Collections;
using Phantom.Utils.Processes;
using Phantom.Utils.Runtime;
namespace Phantom.Agent.Minecraft.Instance;

View File

@ -2,7 +2,7 @@
using Phantom.Agent.Minecraft.Instance;
using Phantom.Agent.Minecraft.Java;
using Phantom.Agent.Minecraft.Server;
using Phantom.Utils.Processes;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Agent.Minecraft.Launcher;

View File

@ -13,7 +13,10 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
</ItemGroup>
</Project>

View File

@ -6,7 +6,7 @@ using Phantom.Common.Messages.BiDirectional;
using Phantom.Common.Messages.ToServer;
using Phantom.Utils.Rpc;
using Phantom.Utils.Rpc.Message;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
using Serilog.Events;

View File

@ -3,7 +3,7 @@ using Phantom.Agent.Services.Backups;
using Phantom.Agent.Services.Instances;
using Phantom.Common.Data.Agent;
using Phantom.Common.Logging;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Agent.Services;

View File

@ -1,5 +1,5 @@
using Phantom.Common.Logging;
using Phantom.Utils.Processes;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Agent.Services.Backups;

View File

@ -4,8 +4,7 @@ using Phantom.Agent.Services.Instances;
using Phantom.Agent.Services.Instances.Procedures;
using Phantom.Common.Data.Backups;
using Phantom.Common.Logging;
using Phantom.Utils.Tasks;
using Phantom.Utils.Threading;
using Phantom.Utils.Runtime;
namespace Phantom.Agent.Services.Backups;

View File

@ -1,7 +1,7 @@
using System.Text.RegularExpressions;
using Phantom.Agent.Minecraft.Command;
using Phantom.Agent.Minecraft.Instance;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Agent.Services.Backups;
@ -14,9 +14,9 @@ sealed partial class BackupServerCommandDispatcher : IDisposable {
private readonly InstanceProcess process;
private readonly CancellationToken cancellationToken;
private readonly TaskCompletionSource automaticSavingDisabled = AsyncTasks.CreateCompletionSource();
private readonly TaskCompletionSource savedTheGame = AsyncTasks.CreateCompletionSource();
private readonly TaskCompletionSource automaticSavingEnabled = AsyncTasks.CreateCompletionSource();
private readonly TaskCompletionSource automaticSavingDisabled = Tasks.CreateCompletionSource();
private readonly TaskCompletionSource savedTheGame = Tasks.CreateCompletionSource();
private readonly TaskCompletionSource automaticSavingEnabled = Tasks.CreateCompletionSource();
public BackupServerCommandDispatcher(ILogger logger, InstanceProcess process, CancellationToken cancellationToken) {
this.logger = logger;

View File

@ -3,7 +3,7 @@ using System.Threading.Channels;
using Phantom.Agent.Rpc;
using Phantom.Common.Logging;
using Phantom.Common.Messages.ToServer;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
namespace Phantom.Agent.Services.Instances;

View File

@ -1,7 +1,7 @@
using Phantom.Agent.Services.Instances.Procedures;
using Phantom.Common.Data.Minecraft;
using Phantom.Utils.Tasks;
using Phantom.Utils.Threading;
using Phantom.Utils.Collections;
using Phantom.Utils.Runtime;
namespace Phantom.Agent.Services.Instances;

View File

@ -1,6 +1,6 @@
using Phantom.Agent.Minecraft.Launcher;
using Phantom.Agent.Services.Backups;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
namespace Phantom.Agent.Services.Instances;

View File

@ -16,7 +16,7 @@ using Phantom.Common.Data.Replies;
using Phantom.Common.Logging;
using Phantom.Common.Messages.ToServer;
using Phantom.Utils.IO;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Agent.Services.Instances;

View File

@ -12,7 +12,8 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
<ProjectReference Include="..\Phantom.Agent.Minecraft\Phantom.Agent.Minecraft.csproj" />
<ProjectReference Include="..\Phantom.Agent.Services\Phantom.Agent.Services.csproj" />
</ItemGroup>

View File

@ -7,7 +7,6 @@ using Phantom.Common.Data.Agent;
using Phantom.Common.Logging;
using Phantom.Utils.Rpc;
using Phantom.Utils.Runtime;
using Phantom.Utils.Tasks;
const int ProtocolVersion = 1;

View File

@ -11,7 +11,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" />
</ItemGroup>
</Project>

View File

@ -27,17 +27,9 @@ RUN dotnet publish Server/Phantom.Server/Phantom.Server.csproj -c Release -o /ap
# +------------------------------+
# | Finalize Phantom Agent image |
# | Download older Java versions |
# +------------------------------+
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS phantom-agent
RUN mkdir /data && chmod 777 /data
WORKDIR /data
COPY --from=eclipse-temurin:8-jre /opt/java/openjdk /opt/java/8
COPY --from=eclipse-temurin:16-jdk /opt/java/openjdk /opt/java/16
COPY --from=eclipse-temurin:17-jre /opt/java/openjdk /opt/java/17
COPY --from=eclipse-temurin:20-jre /opt/java/openjdk /opt/java/20
FROM ubuntu:focal AS java-legacy
ARG DEBIAN_FRONTEND=noninteractive
@ -46,8 +38,33 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && \
apt-get install -y \
openjdk-8-jre-headless \
openjdk-16-jre-headless \
openjdk-17-jre-headless
# +------------------------------+
# | Finalize Phantom Agent image |
# +------------------------------+
FROM mcr.microsoft.com/dotnet/runtime:7.0-jammy AS phantom-agent
COPY --from=java-legacy /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/java-8-openjdk-amd64
COPY --from=java-legacy /usr/lib/jvm/java-16-openjdk-amd64 /usr/lib/jvm/java-16-openjdk-amd64
COPY --from=java-legacy /usr/lib/jvm/java-17-openjdk-amd64 /usr/lib/jvm/java-17-openjdk-amd64
ARG DEBIAN_FRONTEND=noninteractive
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && \
apt-get install -y \
openjdk-18-jre-headless \
zstd
RUN mkdir /data && chmod 777 /data
WORKDIR /data
COPY --from=phantom-agent-builder --chmod=755 /app/out /app
ENTRYPOINT ["dotnet", "/app/Phantom.Agent.dll"]

View File

@ -48,13 +48,21 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Server.Web.Componen
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Server.Web.Identity", "Server\Phantom.Server.Web.Identity\Phantom.Server.Web.Identity.csproj", "{A9870842-FE7A-4760-95DC-9D485DDDA31F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils", "Utils\Phantom.Utils\Phantom.Utils.csproj", "{384885E2-5113-45C5-9B15-09BDA0911852}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Collections", "Utils\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj", "{444AC6C1-E0E1-45C3-965E-BFA818D70913}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Collections.Tests", "Utils\Phantom.Utils.Collections.Tests\Phantom.Utils.Collections.Tests.csproj", "{C418CCDB-2D7E-4B66-8C86-029928AA80A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Cryptography", "Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj", "{31661196-164A-4F92-86A1-31F13F4E4C83}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Events", "Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj", "{2E81523B-5DBE-4992-A77B-1679758D0688}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.IO", "Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj", "{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Rpc", "Utils\Phantom.Utils.Rpc\Phantom.Utils.Rpc.csproj", "{BB112660-7A20-45E6-9195-65363B74027F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Tests", "Utils\Phantom.Utils.Tests\Phantom.Utils.Tests.csproj", "{742599E6-2FC2-4B39-85B8-976C98013030}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Runtime", "Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj", "{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Runtime.Tests", "Utils\Phantom.Utils.Runtime.Tests\Phantom.Utils.Runtime.Tests.csproj", "{742599E6-2FC2-4B39-85B8-976C98013030}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -130,18 +138,34 @@ Global
{A9870842-FE7A-4760-95DC-9D485DDDA31F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9870842-FE7A-4760-95DC-9D485DDDA31F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9870842-FE7A-4760-95DC-9D485DDDA31F}.Release|Any CPU.Build.0 = Release|Any CPU
{384885E2-5113-45C5-9B15-09BDA0911852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{384885E2-5113-45C5-9B15-09BDA0911852}.Debug|Any CPU.Build.0 = Debug|Any CPU
{384885E2-5113-45C5-9B15-09BDA0911852}.Release|Any CPU.ActiveCfg = Release|Any CPU
{384885E2-5113-45C5-9B15-09BDA0911852}.Release|Any CPU.Build.0 = Release|Any CPU
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.Debug|Any CPU.Build.0 = Debug|Any CPU
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.Release|Any CPU.ActiveCfg = Release|Any CPU
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.Release|Any CPU.Build.0 = Release|Any CPU
{C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Release|Any CPU.Build.0 = Release|Any CPU
{31661196-164A-4F92-86A1-31F13F4E4C83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31661196-164A-4F92-86A1-31F13F4E4C83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31661196-164A-4F92-86A1-31F13F4E4C83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31661196-164A-4F92-86A1-31F13F4E4C83}.Release|Any CPU.Build.0 = Release|Any CPU
{2E81523B-5DBE-4992-A77B-1679758D0688}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E81523B-5DBE-4992-A77B-1679758D0688}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E81523B-5DBE-4992-A77B-1679758D0688}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E81523B-5DBE-4992-A77B-1679758D0688}.Release|Any CPU.Build.0 = Release|Any CPU
{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Release|Any CPU.Build.0 = Release|Any CPU
{BB112660-7A20-45E6-9195-65363B74027F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB112660-7A20-45E6-9195-65363B74027F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB112660-7A20-45E6-9195-65363B74027F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB112660-7A20-45E6-9195-65363B74027F}.Release|Any CPU.Build.0 = Release|Any CPU
{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Release|Any CPU.Build.0 = Release|Any CPU
{742599E6-2FC2-4B39-85B8-976C98013030}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{742599E6-2FC2-4B39-85B8-976C98013030}.Debug|Any CPU.Build.0 = Debug|Any CPU
{742599E6-2FC2-4B39-85B8-976C98013030}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -166,9 +190,13 @@ Global
{83FA86DB-34E4-4C2C-832C-90F491CA10C7} = {8AC8FB6C-033A-4626-820F-ED0F908756B2}
{3F4F9059-F869-42D3-B92C-90D27ADFC42D} = {8AC8FB6C-033A-4626-820F-ED0F908756B2}
{A9870842-FE7A-4760-95DC-9D485DDDA31F} = {8AC8FB6C-033A-4626-820F-ED0F908756B2}
{384885E2-5113-45C5-9B15-09BDA0911852} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{444AC6C1-E0E1-45C3-965E-BFA818D70913} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{31661196-164A-4F92-86A1-31F13F4E4C83} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{2E81523B-5DBE-4992-A77B-1679758D0688} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{BB112660-7A20-45E6-9195-65363B74027F} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD} = {AA217EB8-E480-456B-BDF3-39419EF2AD85}
{C418CCDB-2D7E-4B66-8C86-029928AA80A8} = {7A3C7B26-26A0-49B9-8505-5F8267C10F10}
{742599E6-2FC2-4B39-85B8-976C98013030} = {7A3C7B26-26A0-49B9-8505-5F8267C10F10}
EndGlobalSection
EndGlobal

View File

@ -9,7 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
</ItemGroup>
</Project>

View File

@ -4,7 +4,7 @@ using Phantom.Common.Messages.BiDirectional;
using Phantom.Common.Messages.ToServer;
using Phantom.Utils.Rpc;
using Phantom.Utils.Rpc.Message;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
using Serilog.Events;

View File

@ -10,7 +10,7 @@ using Phantom.Server.Rpc;
using Phantom.Server.Services.Instances;
using Phantom.Utils.Collections;
using Phantom.Utils.Events;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using ILogger = Serilog.ILogger;
namespace Phantom.Server.Services.Agents;

View File

@ -4,7 +4,7 @@ using Phantom.Server.Database;
using Phantom.Server.Database.Entities;
using Phantom.Server.Database.Enums;
using Phantom.Server.Services.Users;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
namespace Phantom.Server.Services.Audit;

View File

@ -2,7 +2,7 @@
using Phantom.Server.Database;
using Phantom.Server.Database.Entities;
using Phantom.Server.Database.Enums;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
namespace Phantom.Server.Services.Events;

View File

@ -12,6 +12,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj" />
<ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" />
<ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" />

View File

@ -9,7 +9,7 @@ using Phantom.Server.Services.Agents;
using Phantom.Server.Services.Events;
using Phantom.Server.Services.Instances;
using Phantom.Utils.Rpc.Message;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
namespace Phantom.Server.Services.Rpc;
@ -22,7 +22,7 @@ public sealed class MessageToServerListener : IMessageToServerListener {
private readonly InstanceLogManager instanceLogManager;
private readonly EventLog eventLog;
private readonly TaskCompletionSource<Guid> agentGuidWaiter = AsyncTasks.CreateCompletionSource<Guid>();
private readonly TaskCompletionSource<Guid> agentGuidWaiter = Tasks.CreateCompletionSource<Guid>();
public bool IsDisposed { get; private set; }

View File

@ -2,7 +2,7 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Identity;
using Phantom.Common.Logging;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using ILogger = Serilog.ILogger;
namespace Phantom.Server.Web.Identity.Authentication;

View File

@ -21,7 +21,8 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
<ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" />
</ItemGroup>

View File

@ -14,7 +14,8 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" />
<ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
<ProjectReference Include="..\Phantom.Server.Database.Postgres\Phantom.Server.Database.Postgres.csproj" />
<ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" />
<ProjectReference Include="..\Phantom.Server.Rpc\Phantom.Server.Rpc.csproj" />

View File

@ -11,7 +11,6 @@ using Phantom.Utils.Cryptography;
using Phantom.Utils.IO;
using Phantom.Utils.Rpc;
using Phantom.Utils.Runtime;
using Phantom.Utils.Tasks;
using WebConfiguration = Phantom.Server.Web.Configuration;
using WebLauncher = Phantom.Server.Web.Launcher;

View File

@ -8,7 +8,7 @@ using Phantom.Server.Services.Events;
using Phantom.Server.Services.Instances;
using Phantom.Server.Services.Rpc;
using Phantom.Server.Services.Users;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using WebLauncher = Phantom.Server.Web.Launcher;
namespace Phantom.Server;

View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="NUnit.Analyzers" />
<PackageReference Include="coverlet.collector" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,6 @@
using NUnit.Framework;
using Phantom.Utils.Collections;
namespace Phantom.Utils.Tests.Collections;
namespace Phantom.Utils.Collections.Tests;
[TestFixture]
public sealed class RingBufferTests {

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Threading;
namespace Phantom.Utils.Collections;
public sealed class ThreadSafeLinkedList<T> : IDisposable {
private readonly LinkedList<T> list = new ();

View File

@ -5,9 +5,5 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog" />
</ItemGroup>
</Project>

View File

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -1,4 +1,4 @@
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Utils.Rpc.Message;

View File

@ -1,5 +1,5 @@
using System.Collections.Concurrent;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Utils.Rpc.Message;
@ -16,7 +16,7 @@ public sealed class MessageReplyTracker {
public uint RegisterReply() {
var sequenceId = Interlocked.Increment(ref lastSequenceId);
replyTasks[sequenceId] = AsyncTasks.CreateCompletionSource<byte[]>();
replyTasks[sequenceId] = Tasks.CreateCompletionSource<byte[]>();
return sequenceId;
}

View File

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
</ItemGroup>
</Project>

View File

@ -1,6 +1,6 @@
using NetMQ;
using Phantom.Utils.Rpc.Message;
using Phantom.Utils.Tasks;
using Phantom.Utils.Runtime;
using Serilog;
namespace Phantom.Utils.Rpc;

View File

@ -1,7 +1,6 @@
using NUnit.Framework;
using Phantom.Utils.Runtime;
namespace Phantom.Utils.Tests.Runtime;
namespace Phantom.Utils.Runtime.Tests;
[TestFixture]
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]

View File

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" />
<ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
</ItemGroup>
</Project>

View File

@ -1,6 +1,6 @@
using Serilog;
namespace Phantom.Utils.Tasks;
namespace Phantom.Utils.Runtime;
public abstract class CancellableBackgroundTask {
private readonly CancellationTokenSource cancellationTokenSource = new ();

View File

@ -1,6 +1,6 @@
using Serilog;
namespace Phantom.Utils.Processes;
namespace Phantom.Utils.Runtime;
public sealed class OneShotProcess {
private readonly ILogger logger;

View File

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" />
</ItemGroup>
</Project>

View File

@ -1,6 +1,6 @@
using System.Diagnostics;
namespace Phantom.Utils.Processes;
namespace Phantom.Utils.Runtime;
public sealed class Process : IDisposable {
public readonly record struct Output(string Line, bool IsError);

View File

@ -1,7 +1,7 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace Phantom.Utils.Processes;
namespace Phantom.Utils.Runtime;
public sealed class ProcessConfigurator {
private readonly ProcessStartInfo startInfo = new () {

View File

@ -2,7 +2,7 @@
using Phantom.Utils.Collections;
using Serilog;
namespace Phantom.Utils.Tasks;
namespace Phantom.Utils.Runtime;
public sealed class TaskManager {
private readonly ILogger logger;

View File

@ -1,6 +1,6 @@
namespace Phantom.Utils.Tasks;
namespace Phantom.Utils.Runtime;
public static class AsyncTasks {
public static class Tasks {
public static TaskCompletionSource CreateCompletionSource() {
return new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
}

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Threading;
namespace Phantom.Utils.Runtime;
public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct {
private T? value;

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Threading;
namespace Phantom.Utils.Runtime;
public static class WaitHandleExtensions {
public static Task WaitOneAsync(this WaitHandle waitHandle, CancellationToken cancellationToken = default) {