1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-10-17 12:42:51 +02:00
Minecraft-Phantom-Panel/Server/Phantom.Server.Services/Agents/AgentConnection.cs

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);
}
}