mirror of
				https://github.com/chylex/Minecraft-Phantom-Panel.git
				synced 2025-10-31 11:17:15 +01:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			f211708509
			...
			0091fa11fb
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0091fa11fb | |||
| 20ff2871fa | 
| @@ -1,5 +1,5 @@ | ||||
| using Phantom.Utils.Collections; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Processes; | ||||
|  | ||||
| namespace Phantom.Agent.Minecraft.Instance;  | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
| using Phantom.Agent.Minecraft.Instance; | ||||
| using Phantom.Agent.Minecraft.Java; | ||||
| using Phantom.Agent.Minecraft.Server; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Processes; | ||||
| using Serilog; | ||||
|  | ||||
| namespace Phantom.Agent.Minecraft.Launcher; | ||||
|   | ||||
| @@ -13,10 +13,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.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" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Serilog; | ||||
| using Serilog.Events; | ||||
|  | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Serilog; | ||||
|  | ||||
| namespace Phantom.Agent.Services; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| using Phantom.Common.Logging; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Processes; | ||||
| using Serilog; | ||||
|  | ||||
| namespace Phantom.Agent.Services.Backups;  | ||||
|   | ||||
| @@ -4,7 +4,8 @@ using Phantom.Agent.Services.Instances; | ||||
| using Phantom.Agent.Services.Instances.Procedures; | ||||
| using Phantom.Common.Data.Backups; | ||||
| using Phantom.Common.Logging; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Phantom.Utils.Threading; | ||||
|  | ||||
| namespace Phantom.Agent.Services.Backups; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| using System.Text.RegularExpressions; | ||||
| using Phantom.Agent.Minecraft.Command; | ||||
| using Phantom.Agent.Minecraft.Instance; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| 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 = Tasks.CreateCompletionSource(); | ||||
| 	private readonly TaskCompletionSource savedTheGame = Tasks.CreateCompletionSource(); | ||||
| 	private readonly TaskCompletionSource automaticSavingEnabled = Tasks.CreateCompletionSource(); | ||||
| 	private readonly TaskCompletionSource automaticSavingDisabled = AsyncTasks.CreateCompletionSource(); | ||||
| 	private readonly TaskCompletionSource savedTheGame = AsyncTasks.CreateCompletionSource(); | ||||
| 	private readonly TaskCompletionSource automaticSavingEnabled = AsyncTasks.CreateCompletionSource(); | ||||
|  | ||||
| 	public BackupServerCommandDispatcher(ILogger logger, InstanceProcess process, CancellationToken cancellationToken) { | ||||
| 		this.logger = logger; | ||||
|   | ||||
| @@ -3,7 +3,7 @@ using System.Threading.Channels; | ||||
| using Phantom.Agent.Rpc; | ||||
| using Phantom.Common.Logging; | ||||
| using Phantom.Common.Messages.ToServer; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
|  | ||||
| namespace Phantom.Agent.Services.Instances; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| using Phantom.Agent.Services.Instances.Procedures; | ||||
| using Phantom.Common.Data.Minecraft; | ||||
| using Phantom.Utils.Collections; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Phantom.Utils.Threading; | ||||
|  | ||||
| namespace Phantom.Agent.Services.Instances; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| using Phantom.Agent.Minecraft.Launcher; | ||||
| using Phantom.Agent.Services.Backups; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
|  | ||||
| namespace Phantom.Agent.Services.Instances;  | ||||
|  | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Serilog; | ||||
|  | ||||
| namespace Phantom.Agent.Services.Instances; | ||||
|   | ||||
| @@ -12,8 +12,7 @@ | ||||
|   </PropertyGroup> | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|     <ProjectReference Include="..\Phantom.Agent.Minecraft\Phantom.Agent.Minecraft.csproj" /> | ||||
|     <ProjectReference Include="..\Phantom.Agent.Services\Phantom.Agent.Services.csproj" /> | ||||
|   </ItemGroup> | ||||
|   | ||||
| @@ -7,6 +7,7 @@ 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; | ||||
|  | ||||
|   | ||||
| @@ -11,8 +11,7 @@ | ||||
|   </ItemGroup> | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <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\Phantom.Utils.csproj" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
							
								
								
									
										47
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -26,45 +26,28 @@ RUN dotnet publish Server/Phantom.Server.Web/Phantom.Server.Web.csproj -c Releas | ||||
| RUN dotnet publish Server/Phantom.Server/Phantom.Server.csproj -c Release -o /app/out | ||||
|  | ||||
|  | ||||
| # +------------------------------+ | ||||
| # | Download older Java versions | | ||||
| # +------------------------------+ | ||||
| FROM ubuntu:focal AS java-legacy | ||||
|  | ||||
| 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-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 | ||||
| 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 | ||||
|  | ||||
| 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                                          \ | ||||
|     zstd | ||||
|  | ||||
| COPY --from=phantom-agent-builder --chmod=755 /app/out /app | ||||
|  | ||||
| ENTRYPOINT ["dotnet", "/app/Phantom.Agent.dll"] | ||||
|   | ||||
| @@ -48,21 +48,13 @@ 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.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}" | ||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils", "Utils\Phantom.Utils\Phantom.Utils.csproj", "{384885E2-5113-45C5-9B15-09BDA0911852}" | ||||
| 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.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}" | ||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Tests", "Utils\Phantom.Utils.Tests\Phantom.Utils.Tests.csproj", "{742599E6-2FC2-4B39-85B8-976C98013030}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| @@ -138,34 +130,18 @@ 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 | ||||
| 		{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 | ||||
| 		{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 | ||||
| 		{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 | ||||
| @@ -190,13 +166,9 @@ 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} | ||||
| 		{444AC6C1-E0E1-45C3-965E-BFA818D70913} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} | ||||
| 		{31661196-164A-4F92-86A1-31F13F4E4C83} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} | ||||
| 		{384885E2-5113-45C5-9B15-09BDA0911852} = {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 | ||||
|   | ||||
| @@ -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.Runtime\Phantom.Utils.Runtime.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Serilog; | ||||
| using Serilog.Events; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ using Phantom.Server.Rpc; | ||||
| using Phantom.Server.Services.Instances; | ||||
| using Phantom.Utils.Collections; | ||||
| using Phantom.Utils.Events; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using ILogger = Serilog.ILogger; | ||||
|  | ||||
| namespace Phantom.Server.Services.Agents; | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
|  | ||||
| namespace Phantom.Server.Services.Audit; | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
| using Phantom.Server.Database; | ||||
| using Phantom.Server.Database.Entities; | ||||
| using Phantom.Server.Database.Enums; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
|  | ||||
| namespace Phantom.Server.Services.Events;  | ||||
|  | ||||
|   | ||||
| @@ -12,7 +12,6 @@ | ||||
|    | ||||
|   <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" /> | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
|  | ||||
| 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 = Tasks.CreateCompletionSource<Guid>(); | ||||
| 	private readonly TaskCompletionSource<Guid> agentGuidWaiter = AsyncTasks.CreateCompletionSource<Guid>(); | ||||
|  | ||||
| 	public bool IsDisposed { get; private set; } | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
| using System.Diagnostics; | ||||
| using Microsoft.AspNetCore.Identity; | ||||
| using Phantom.Common.Logging; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using ILogger = Serilog.ILogger; | ||||
|  | ||||
| namespace Phantom.Server.Web.Identity.Authentication;  | ||||
|   | ||||
| @@ -21,8 +21,7 @@ | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|     <ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   | ||||
| @@ -14,8 +14,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.IO\Phantom.Utils.IO.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> | ||||
|     <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.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" /> | ||||
|   | ||||
| @@ -11,6 +11,7 @@ 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; | ||||
|  | ||||
|   | ||||
| @@ -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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using WebLauncher = Phantom.Server.Web.Launcher; | ||||
|  | ||||
| namespace Phantom.Server; | ||||
|   | ||||
| @@ -1,25 +0,0 @@ | ||||
| <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,9 +0,0 @@ | ||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||
|    | ||||
|   <PropertyGroup> | ||||
|     <TargetFramework>net7.0</TargetFramework> | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|     <Nullable>enable</Nullable> | ||||
|   </PropertyGroup> | ||||
|  | ||||
| </Project> | ||||
| @@ -11,7 +11,7 @@ | ||||
|   </ItemGroup> | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" /> | ||||
|     <ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|   </ItemGroup> | ||||
|    | ||||
| </Project> | ||||
|   | ||||
| @@ -1,9 +0,0 @@ | ||||
| <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.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Serilog; | ||||
|  | ||||
| namespace Phantom.Utils.Rpc.Message;  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| using System.Collections.Concurrent; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| 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] = Tasks.CreateCompletionSource<byte[]>(); | ||||
| 		replyTasks[sequenceId] = AsyncTasks.CreateCompletionSource<byte[]>(); | ||||
| 		return sequenceId; | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,7 @@ | ||||
|   </ItemGroup> | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> | ||||
|     <ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| using NetMQ; | ||||
| using Phantom.Utils.Rpc.Message; | ||||
| using Phantom.Utils.Runtime; | ||||
| using Phantom.Utils.Tasks; | ||||
| using Serilog; | ||||
|  | ||||
| namespace Phantom.Utils.Rpc; | ||||
|   | ||||
| @@ -1,17 +0,0 @@ | ||||
| <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,7 @@ | ||||
| using NUnit.Framework; | ||||
| using Phantom.Utils.Collections; | ||||
| 
 | ||||
| namespace Phantom.Utils.Collections.Tests; | ||||
| namespace Phantom.Utils.Tests.Collections; | ||||
| 
 | ||||
| [TestFixture] | ||||
| public sealed class RingBufferTests { | ||||
| @@ -19,7 +19,7 @@ | ||||
|   </ItemGroup> | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> | ||||
|     <ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" /> | ||||
|   </ItemGroup> | ||||
| 
 | ||||
| </Project> | ||||
| @@ -1,6 +1,7 @@ | ||||
| using NUnit.Framework; | ||||
| using Phantom.Utils.Runtime; | ||||
| 
 | ||||
| namespace Phantom.Utils.Runtime.Tests; | ||||
| namespace Phantom.Utils.Tests.Runtime; | ||||
| 
 | ||||
| [TestFixture] | ||||
| [FixtureLifeCycle(LifeCycle.InstancePerTestCase)] | ||||
| @@ -5,5 +5,9 @@ | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|     <Nullable>enable</Nullable> | ||||
|   </PropertyGroup> | ||||
| 
 | ||||
|    | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Serilog" /> | ||||
|   </ItemGroup> | ||||
|    | ||||
| </Project> | ||||
| @@ -1,6 +1,6 @@ | ||||
| using Serilog; | ||||
| 
 | ||||
| namespace Phantom.Utils.Runtime; | ||||
| namespace Phantom.Utils.Processes; | ||||
| 
 | ||||
| public sealed class OneShotProcess { | ||||
| 	private readonly ILogger logger; | ||||
| @@ -1,6 +1,6 @@ | ||||
| using System.Diagnostics; | ||||
| 
 | ||||
| namespace Phantom.Utils.Runtime; | ||||
| namespace Phantom.Utils.Processes; | ||||
| 
 | ||||
| public sealed class Process : IDisposable { | ||||
| 	public readonly record struct Output(string Line, bool IsError); | ||||
| @@ -1,7 +1,7 @@ | ||||
| using System.Collections.ObjectModel; | ||||
| using System.Diagnostics; | ||||
| 
 | ||||
| namespace Phantom.Utils.Runtime;  | ||||
| namespace Phantom.Utils.Processes;  | ||||
| 
 | ||||
| public sealed class ProcessConfigurator { | ||||
| 	private readonly ProcessStartInfo startInfo = new () { | ||||
| @@ -1,6 +1,6 @@ | ||||
| namespace Phantom.Utils.Runtime;  | ||||
| namespace Phantom.Utils.Tasks;  | ||||
| 
 | ||||
| public static class Tasks { | ||||
| public static class AsyncTasks { | ||||
| 	public static TaskCompletionSource CreateCompletionSource() { | ||||
| 		return new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); | ||||
| 	} | ||||
| @@ -1,6 +1,6 @@ | ||||
| using Serilog; | ||||
| 
 | ||||
| namespace Phantom.Utils.Runtime;  | ||||
| namespace Phantom.Utils.Tasks;  | ||||
| 
 | ||||
| public abstract class CancellableBackgroundTask { | ||||
| 	private readonly CancellationTokenSource cancellationTokenSource = new (); | ||||
| @@ -2,7 +2,7 @@ | ||||
| using Phantom.Utils.Collections; | ||||
| using Serilog; | ||||
| 
 | ||||
| namespace Phantom.Utils.Runtime;  | ||||
| namespace Phantom.Utils.Tasks;  | ||||
| 
 | ||||
| public sealed class TaskManager { | ||||
| 	private readonly ILogger logger; | ||||
| @@ -1,4 +1,4 @@ | ||||
| namespace Phantom.Utils.Collections;  | ||||
| namespace Phantom.Utils.Threading;  | ||||
| 
 | ||||
| public sealed class ThreadSafeLinkedList<T> : IDisposable { | ||||
| 	private readonly LinkedList<T> list = new (); | ||||
| @@ -1,4 +1,4 @@ | ||||
| namespace Phantom.Utils.Runtime;  | ||||
| namespace Phantom.Utils.Threading;  | ||||
| 
 | ||||
| public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct { | ||||
| 	private T? value; | ||||
| @@ -1,4 +1,4 @@ | ||||
| namespace Phantom.Utils.Runtime; | ||||
| namespace Phantom.Utils.Threading; | ||||
| 
 | ||||
| public static class WaitHandleExtensions { | ||||
| 	public static Task WaitOneAsync(this WaitHandle waitHandle, CancellationToken cancellationToken = default) { | ||||
		Reference in New Issue
	
	Block a user