mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-26 01:42:53 +01:00
Compare commits
No commits in common. "0091fa11fb533e88a95a3b13c88a18d9763e16c6" and "f211708509e67fa6e0f36492f83d1fa9fb3623ab" have entirely different histories.
0091fa11fb
...
f211708509
@ -1,5 +1,5 @@
|
|||||||
using Phantom.Utils.Collections;
|
using Phantom.Utils.Collections;
|
||||||
using Phantom.Utils.Processes;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Agent.Minecraft.Instance;
|
namespace Phantom.Agent.Minecraft.Instance;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using Phantom.Agent.Minecraft.Instance;
|
using Phantom.Agent.Minecraft.Instance;
|
||||||
using Phantom.Agent.Minecraft.Java;
|
using Phantom.Agent.Minecraft.Java;
|
||||||
using Phantom.Agent.Minecraft.Server;
|
using Phantom.Agent.Minecraft.Server;
|
||||||
using Phantom.Utils.Processes;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Agent.Minecraft.Launcher;
|
namespace Phantom.Agent.Minecraft.Launcher;
|
||||||
|
@ -13,7 +13,10 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.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>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -6,7 +6,7 @@ using Phantom.Common.Messages.BiDirectional;
|
|||||||
using Phantom.Common.Messages.ToServer;
|
using Phantom.Common.Messages.ToServer;
|
||||||
using Phantom.Utils.Rpc;
|
using Phantom.Utils.Rpc;
|
||||||
using Phantom.Utils.Rpc.Message;
|
using Phantom.Utils.Rpc.Message;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ using Phantom.Agent.Services.Backups;
|
|||||||
using Phantom.Agent.Services.Instances;
|
using Phantom.Agent.Services.Instances;
|
||||||
using Phantom.Common.Data.Agent;
|
using Phantom.Common.Data.Agent;
|
||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services;
|
namespace Phantom.Agent.Services;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Utils.Processes;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Backups;
|
namespace Phantom.Agent.Services.Backups;
|
||||||
|
@ -4,8 +4,7 @@ using Phantom.Agent.Services.Instances;
|
|||||||
using Phantom.Agent.Services.Instances.Procedures;
|
using Phantom.Agent.Services.Instances.Procedures;
|
||||||
using Phantom.Common.Data.Backups;
|
using Phantom.Common.Data.Backups;
|
||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Phantom.Utils.Threading;
|
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Backups;
|
namespace Phantom.Agent.Services.Backups;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Phantom.Agent.Minecraft.Command;
|
using Phantom.Agent.Minecraft.Command;
|
||||||
using Phantom.Agent.Minecraft.Instance;
|
using Phantom.Agent.Minecraft.Instance;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Backups;
|
namespace Phantom.Agent.Services.Backups;
|
||||||
@ -14,9 +14,9 @@ sealed partial class BackupServerCommandDispatcher : IDisposable {
|
|||||||
private readonly InstanceProcess process;
|
private readonly InstanceProcess process;
|
||||||
private readonly CancellationToken cancellationToken;
|
private readonly CancellationToken cancellationToken;
|
||||||
|
|
||||||
private readonly TaskCompletionSource automaticSavingDisabled = AsyncTasks.CreateCompletionSource();
|
private readonly TaskCompletionSource automaticSavingDisabled = Tasks.CreateCompletionSource();
|
||||||
private readonly TaskCompletionSource savedTheGame = AsyncTasks.CreateCompletionSource();
|
private readonly TaskCompletionSource savedTheGame = Tasks.CreateCompletionSource();
|
||||||
private readonly TaskCompletionSource automaticSavingEnabled = AsyncTasks.CreateCompletionSource();
|
private readonly TaskCompletionSource automaticSavingEnabled = Tasks.CreateCompletionSource();
|
||||||
|
|
||||||
public BackupServerCommandDispatcher(ILogger logger, InstanceProcess process, CancellationToken cancellationToken) {
|
public BackupServerCommandDispatcher(ILogger logger, InstanceProcess process, CancellationToken cancellationToken) {
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
|
@ -3,7 +3,7 @@ using System.Threading.Channels;
|
|||||||
using Phantom.Agent.Rpc;
|
using Phantom.Agent.Rpc;
|
||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Common.Messages.ToServer;
|
using Phantom.Common.Messages.ToServer;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Instances;
|
namespace Phantom.Agent.Services.Instances;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using Phantom.Agent.Services.Instances.Procedures;
|
using Phantom.Agent.Services.Instances.Procedures;
|
||||||
using Phantom.Common.Data.Minecraft;
|
using Phantom.Common.Data.Minecraft;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Collections;
|
||||||
using Phantom.Utils.Threading;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Instances;
|
namespace Phantom.Agent.Services.Instances;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using Phantom.Agent.Minecraft.Launcher;
|
using Phantom.Agent.Minecraft.Launcher;
|
||||||
using Phantom.Agent.Services.Backups;
|
using Phantom.Agent.Services.Backups;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Instances;
|
namespace Phantom.Agent.Services.Instances;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ using Phantom.Common.Data.Replies;
|
|||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Common.Messages.ToServer;
|
using Phantom.Common.Messages.ToServer;
|
||||||
using Phantom.Utils.IO;
|
using Phantom.Utils.IO;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Agent.Services.Instances;
|
namespace Phantom.Agent.Services.Instances;
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<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.Minecraft\Phantom.Agent.Minecraft.csproj" />
|
||||||
<ProjectReference Include="..\Phantom.Agent.Services\Phantom.Agent.Services.csproj" />
|
<ProjectReference Include="..\Phantom.Agent.Services\Phantom.Agent.Services.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -7,7 +7,6 @@ using Phantom.Common.Data.Agent;
|
|||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Utils.Rpc;
|
using Phantom.Utils.Rpc;
|
||||||
using Phantom.Utils.Runtime;
|
using Phantom.Utils.Runtime;
|
||||||
using Phantom.Utils.Tasks;
|
|
||||||
|
|
||||||
const int ProtocolVersion = 1;
|
const int ProtocolVersion = 1;
|
||||||
|
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<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>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
37
Dockerfile
37
Dockerfile
@ -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
|
FROM ubuntu:focal AS java-legacy
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
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 && \
|
rm -f /etc/apt/apt.conf.d/docker-clean && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y \
|
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
|
zstd
|
||||||
|
|
||||||
|
RUN mkdir /data && chmod 777 /data
|
||||||
|
WORKDIR /data
|
||||||
|
|
||||||
COPY --from=phantom-agent-builder --chmod=755 /app/out /app
|
COPY --from=phantom-agent-builder --chmod=755 /app/out /app
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "/app/Phantom.Agent.dll"]
|
ENTRYPOINT ["dotnet", "/app/Phantom.Agent.dll"]
|
||||||
|
@ -48,13 +48,21 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Server.Web.Componen
|
|||||||
EndProject
|
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}"
|
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
|
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
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Events", "Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj", "{2E81523B-5DBE-4992-A77B-1679758D0688}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Events", "Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj", "{2E81523B-5DBE-4992-A77B-1679758D0688}"
|
||||||
EndProject
|
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}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Rpc", "Utils\Phantom.Utils.Rpc\Phantom.Utils.Rpc.csproj", "{BB112660-7A20-45E6-9195-65363B74027F}"
|
||||||
EndProject
|
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
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
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}.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.ActiveCfg = Release|Any CPU
|
||||||
{A9870842-FE7A-4760-95DC-9D485DDDA31F}.Release|Any CPU.Build.0 = 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
|
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{384885E2-5113-45C5-9B15-09BDA0911852}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{384885E2-5113-45C5-9B15-09BDA0911852}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{444AC6C1-E0E1-45C3-965E-BFA818D70913}.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}.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.ActiveCfg = Debug|Any CPU
|
||||||
{2E81523B-5DBE-4992-A77B-1679758D0688}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Release|Any CPU
|
||||||
{2E81523B-5DBE-4992-A77B-1679758D0688}.Release|Any CPU.Build.0 = 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.ActiveCfg = Debug|Any CPU
|
||||||
{BB112660-7A20-45E6-9195-65363B74027F}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Release|Any CPU
|
||||||
{BB112660-7A20-45E6-9195-65363B74027F}.Release|Any CPU.Build.0 = 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.ActiveCfg = Debug|Any CPU
|
||||||
{742599E6-2FC2-4B39-85B8-976C98013030}.Debug|Any CPU.Build.0 = 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
|
{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}
|
{83FA86DB-34E4-4C2C-832C-90F491CA10C7} = {8AC8FB6C-033A-4626-820F-ED0F908756B2}
|
||||||
{3F4F9059-F869-42D3-B92C-90D27ADFC42D} = {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}
|
{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}
|
{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}
|
{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}
|
{742599E6-2FC2-4B39-85B8-976C98013030} = {7A3C7B26-26A0-49B9-8505-5F8267C10F10}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.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>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -4,7 +4,7 @@ using Phantom.Common.Messages.BiDirectional;
|
|||||||
using Phantom.Common.Messages.ToServer;
|
using Phantom.Common.Messages.ToServer;
|
||||||
using Phantom.Utils.Rpc;
|
using Phantom.Utils.Rpc;
|
||||||
using Phantom.Utils.Rpc.Message;
|
using Phantom.Utils.Rpc.Message;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ using Phantom.Server.Rpc;
|
|||||||
using Phantom.Server.Services.Instances;
|
using Phantom.Server.Services.Instances;
|
||||||
using Phantom.Utils.Collections;
|
using Phantom.Utils.Collections;
|
||||||
using Phantom.Utils.Events;
|
using Phantom.Utils.Events;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using ILogger = Serilog.ILogger;
|
using ILogger = Serilog.ILogger;
|
||||||
|
|
||||||
namespace Phantom.Server.Services.Agents;
|
namespace Phantom.Server.Services.Agents;
|
||||||
|
@ -4,7 +4,7 @@ using Phantom.Server.Database;
|
|||||||
using Phantom.Server.Database.Entities;
|
using Phantom.Server.Database.Entities;
|
||||||
using Phantom.Server.Database.Enums;
|
using Phantom.Server.Database.Enums;
|
||||||
using Phantom.Server.Services.Users;
|
using Phantom.Server.Services.Users;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Server.Services.Audit;
|
namespace Phantom.Server.Services.Audit;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using Phantom.Server.Database;
|
using Phantom.Server.Database;
|
||||||
using Phantom.Server.Database.Entities;
|
using Phantom.Server.Database.Entities;
|
||||||
using Phantom.Server.Database.Enums;
|
using Phantom.Server.Database.Enums;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Server.Services.Events;
|
namespace Phantom.Server.Services.Events;
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
<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="..\..\Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj" />
|
||||||
<ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" />
|
<ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" />
|
||||||
<ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" />
|
<ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" />
|
||||||
|
@ -9,7 +9,7 @@ using Phantom.Server.Services.Agents;
|
|||||||
using Phantom.Server.Services.Events;
|
using Phantom.Server.Services.Events;
|
||||||
using Phantom.Server.Services.Instances;
|
using Phantom.Server.Services.Instances;
|
||||||
using Phantom.Utils.Rpc.Message;
|
using Phantom.Utils.Rpc.Message;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
|
|
||||||
namespace Phantom.Server.Services.Rpc;
|
namespace Phantom.Server.Services.Rpc;
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public sealed class MessageToServerListener : IMessageToServerListener {
|
|||||||
private readonly InstanceLogManager instanceLogManager;
|
private readonly InstanceLogManager instanceLogManager;
|
||||||
private readonly EventLog eventLog;
|
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; }
|
public bool IsDisposed { get; private set; }
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Phantom.Common.Logging;
|
using Phantom.Common.Logging;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using ILogger = Serilog.ILogger;
|
using ILogger = Serilog.ILogger;
|
||||||
|
|
||||||
namespace Phantom.Server.Web.Identity.Authentication;
|
namespace Phantom.Server.Web.Identity.Authentication;
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" />
|
<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" />
|
<ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
<ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" />
|
||||||
<ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.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.Database.Postgres\Phantom.Server.Database.Postgres.csproj" />
|
||||||
<ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" />
|
<ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" />
|
||||||
<ProjectReference Include="..\Phantom.Server.Rpc\Phantom.Server.Rpc.csproj" />
|
<ProjectReference Include="..\Phantom.Server.Rpc\Phantom.Server.Rpc.csproj" />
|
||||||
|
@ -11,7 +11,6 @@ using Phantom.Utils.Cryptography;
|
|||||||
using Phantom.Utils.IO;
|
using Phantom.Utils.IO;
|
||||||
using Phantom.Utils.Rpc;
|
using Phantom.Utils.Rpc;
|
||||||
using Phantom.Utils.Runtime;
|
using Phantom.Utils.Runtime;
|
||||||
using Phantom.Utils.Tasks;
|
|
||||||
using WebConfiguration = Phantom.Server.Web.Configuration;
|
using WebConfiguration = Phantom.Server.Web.Configuration;
|
||||||
using WebLauncher = Phantom.Server.Web.Launcher;
|
using WebLauncher = Phantom.Server.Web.Launcher;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ using Phantom.Server.Services.Events;
|
|||||||
using Phantom.Server.Services.Instances;
|
using Phantom.Server.Services.Instances;
|
||||||
using Phantom.Server.Services.Rpc;
|
using Phantom.Server.Services.Rpc;
|
||||||
using Phantom.Server.Services.Users;
|
using Phantom.Server.Services.Users;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using WebLauncher = Phantom.Server.Web.Launcher;
|
using WebLauncher = Phantom.Server.Web.Launcher;
|
||||||
|
|
||||||
namespace Phantom.Server;
|
namespace Phantom.Server;
|
||||||
|
@ -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>
|
@ -1,7 +1,6 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Phantom.Utils.Collections;
|
|
||||||
|
|
||||||
namespace Phantom.Utils.Tests.Collections;
|
namespace Phantom.Utils.Collections.Tests;
|
||||||
|
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public sealed class RingBufferTests {
|
public sealed class RingBufferTests {
|
@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -1,4 +1,4 @@
|
|||||||
namespace Phantom.Utils.Threading;
|
namespace Phantom.Utils.Collections;
|
||||||
|
|
||||||
public sealed class ThreadSafeLinkedList<T> : IDisposable {
|
public sealed class ThreadSafeLinkedList<T> : IDisposable {
|
||||||
private readonly LinkedList<T> list = new ();
|
private readonly LinkedList<T> list = new ();
|
@ -5,9 +5,5 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Serilog" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -11,7 +11,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" />
|
<ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
9
Utils/Phantom.Utils.IO/Phantom.Utils.IO.csproj
Normal file
9
Utils/Phantom.Utils.IO/Phantom.Utils.IO.csproj
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -1,4 +1,4 @@
|
|||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Utils.Rpc.Message;
|
namespace Phantom.Utils.Rpc.Message;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Utils.Rpc.Message;
|
namespace Phantom.Utils.Rpc.Message;
|
||||||
@ -16,7 +16,7 @@ public sealed class MessageReplyTracker {
|
|||||||
|
|
||||||
public uint RegisterReply() {
|
public uint RegisterReply() {
|
||||||
var sequenceId = Interlocked.Increment(ref lastSequenceId);
|
var sequenceId = Interlocked.Increment(ref lastSequenceId);
|
||||||
replyTasks[sequenceId] = AsyncTasks.CreateCompletionSource<byte[]>();
|
replyTasks[sequenceId] = Tasks.CreateCompletionSource<byte[]>();
|
||||||
return sequenceId;
|
return sequenceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" />
|
<ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using NetMQ;
|
using NetMQ;
|
||||||
using Phantom.Utils.Rpc.Message;
|
using Phantom.Utils.Rpc.Message;
|
||||||
using Phantom.Utils.Tasks;
|
using Phantom.Utils.Runtime;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Utils.Rpc;
|
namespace Phantom.Utils.Rpc;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Phantom.Utils.Runtime;
|
|
||||||
|
|
||||||
namespace Phantom.Utils.Tests.Runtime;
|
namespace Phantom.Utils.Runtime.Tests;
|
||||||
|
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
|
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
|
@ -19,7 +19,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" />
|
<ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -1,6 +1,6 @@
|
|||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Utils.Tasks;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public abstract class CancellableBackgroundTask {
|
public abstract class CancellableBackgroundTask {
|
||||||
private readonly CancellationTokenSource cancellationTokenSource = new ();
|
private readonly CancellationTokenSource cancellationTokenSource = new ();
|
@ -1,6 +1,6 @@
|
|||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Utils.Processes;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public sealed class OneShotProcess {
|
public sealed class OneShotProcess {
|
||||||
private readonly ILogger logger;
|
private readonly ILogger logger;
|
17
Utils/Phantom.Utils.Runtime/Phantom.Utils.Runtime.csproj
Normal file
17
Utils/Phantom.Utils.Runtime/Phantom.Utils.Runtime.csproj
Normal 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>
|
@ -1,6 +1,6 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Phantom.Utils.Processes;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public sealed class Process : IDisposable {
|
public sealed class Process : IDisposable {
|
||||||
public readonly record struct Output(string Line, bool IsError);
|
public readonly record struct Output(string Line, bool IsError);
|
@ -1,7 +1,7 @@
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Phantom.Utils.Processes;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public sealed class ProcessConfigurator {
|
public sealed class ProcessConfigurator {
|
||||||
private readonly ProcessStartInfo startInfo = new () {
|
private readonly ProcessStartInfo startInfo = new () {
|
@ -2,7 +2,7 @@
|
|||||||
using Phantom.Utils.Collections;
|
using Phantom.Utils.Collections;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Phantom.Utils.Tasks;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public sealed class TaskManager {
|
public sealed class TaskManager {
|
||||||
private readonly ILogger logger;
|
private readonly ILogger logger;
|
@ -1,6 +1,6 @@
|
|||||||
namespace Phantom.Utils.Tasks;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public static class AsyncTasks {
|
public static class Tasks {
|
||||||
public static TaskCompletionSource CreateCompletionSource() {
|
public static TaskCompletionSource CreateCompletionSource() {
|
||||||
return new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
return new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace Phantom.Utils.Threading;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct {
|
public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct {
|
||||||
private T? value;
|
private T? value;
|
@ -1,4 +1,4 @@
|
|||||||
namespace Phantom.Utils.Threading;
|
namespace Phantom.Utils.Runtime;
|
||||||
|
|
||||||
public static class WaitHandleExtensions {
|
public static class WaitHandleExtensions {
|
||||||
public static Task WaitOneAsync(this WaitHandle waitHandle, CancellationToken cancellationToken = default) {
|
public static Task WaitOneAsync(this WaitHandle waitHandle, CancellationToken cancellationToken = default) {
|
Loading…
Reference in New Issue
Block a user