mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-08-16 21:31:45 +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
25 lines
568 B
C#
25 lines
568 B
C#
using Phantom.Common.Messages;
|
|
using Phantom.Server.Rpc;
|
|
|
|
namespace Phantom.Server.Services.Agents;
|
|
|
|
sealed class AgentConnection {
|
|
private readonly RpcClientConnection connection;
|
|
|
|
internal AgentConnection(RpcClientConnection connection) {
|
|
this.connection = connection;
|
|
}
|
|
|
|
public bool IsSame(RpcClientConnection connection) {
|
|
return this.connection.IsSame(connection);
|
|
}
|
|
|
|
public void Close() {
|
|
connection.Close();
|
|
}
|
|
|
|
public async Task SendMessage<TMessage>(TMessage message) where TMessage : IMessageToAgent {
|
|
await connection.Send(message);
|
|
}
|
|
}
|