using IW4MAdmin.Application.RCon;
using SharedLibraryCore.Interfaces;
using System.Text;
using Microsoft.Extensions.Logging;
namespace IW4MAdmin.Application.Factories
{
///
/// implementation of IRConConnectionFactory
///
internal class RConConnectionFactory : IRConConnectionFactory
{
private static readonly Encoding gameEncoding = Encoding.GetEncoding("windows-1252");
private readonly ILogger _logger;
///
/// Base constructor
///
///
public RConConnectionFactory(ILogger logger)
{
_logger = logger;
}
///
/// creates a new rcon connection instance
///
/// ip address of the server
/// port of the server
/// rcon password of the server
///
public IRConConnection CreateConnection(string ipAddress, int port, string password)
{
return new RConConnection(ipAddress, port, password, _logger, gameEncoding);
}
}
}