IW4M-Admin/Application/Factories/RConConnectionFactory.cs
RaidMax c3c21a7749 refactor a good bit of stuff for better dependency injection
fix regular expression for T6 log parsing
2020-02-11 16:44:06 -06:00

37 lines
1.2 KiB
C#

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