mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
refactor a good bit of stuff for better dependency injection
fix regular expression for T6 log parsing
This commit is contained in:
36
Application/Factories/RConConnectionFactory.cs
Normal file
36
Application/Factories/RConConnectionFactory.cs
Normal file
@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user