mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-08-18 18:24:56 +02:00
.config
.run
.workdir
Agent
Common
Docker
Server
Phantom.Server
Phantom.Server.Database
Phantom.Server.Database.Postgres
Phantom.Server.Rpc
Phantom.Server.Services
Agents
Agent.cs
AgentConnection.cs
AgentJavaRuntimesManager.cs
AgentManager.cs
AgentStats.cs
AgentStatsManager.cs
Instances
Rpc
Phantom.Server.Services.csproj
ServiceConfiguration.cs
Phantom.Server.Web
Phantom.Server.Web.Bootstrap
Phantom.Server.Web.Components
Utils
.gitattributes
.gitignore
AddMigration.bat
AddMigration.sh
PhantomPanel.sln
global.json
27 lines
733 B
C#
27 lines
733 B
C#
using Phantom.Common.Data;
|
|
using Phantom.Common.Data.Agent;
|
|
|
|
namespace Phantom.Server.Services.Agents;
|
|
|
|
public sealed record Agent(
|
|
Guid Guid,
|
|
string Name,
|
|
ushort Version,
|
|
ushort MaxInstances,
|
|
RamAllocationUnits MaxMemory,
|
|
AllowedPorts? AllowedServerPorts = null,
|
|
AllowedPorts? AllowedRconPorts = null,
|
|
DateTimeOffset? LastPing = null
|
|
) {
|
|
internal AgentConnection? Connection { get; init; }
|
|
|
|
internal Agent(AgentInfo info) : this(info.Guid, info.Name, info.Version, info.MaxInstances, info.MaxMemory, info.AllowedServerPorts, info.AllowedRconPorts) {}
|
|
|
|
public bool IsOnline => Connection is not null;
|
|
public bool IsOffline => Connection is null;
|
|
|
|
internal Agent AsOffline() => this with {
|
|
Connection = null
|
|
};
|
|
}
|