2020-02-11 17:44:06 -05:00
|
|
|
|
using SharedLibraryCore;
|
|
|
|
|
using SharedLibraryCore.Configuration;
|
|
|
|
|
using SharedLibraryCore.Interfaces;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
|
|
namespace IW4MAdmin.Application.Factories
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// implementation of IGameServerInstanceFactory
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class GameServerInstanceFactory : IGameServerInstanceFactory
|
|
|
|
|
{
|
|
|
|
|
private readonly ITranslationLookup _translationLookup;
|
|
|
|
|
private readonly IRConConnectionFactory _rconConnectionFactory;
|
2020-05-04 17:50:02 -04:00
|
|
|
|
private readonly IGameLogReaderFactory _gameLogReaderFactory;
|
2020-08-17 22:21:11 -04:00
|
|
|
|
private readonly IMetaService _metaService;
|
2020-02-11 17:44:06 -05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// base constructor
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="translationLookup"></param>
|
|
|
|
|
/// <param name="rconConnectionFactory"></param>
|
2020-08-17 22:21:11 -04:00
|
|
|
|
public GameServerInstanceFactory(ITranslationLookup translationLookup, IRConConnectionFactory rconConnectionFactory, IGameLogReaderFactory gameLogReaderFactory, IMetaService metaService)
|
2020-02-11 17:44:06 -05:00
|
|
|
|
{
|
|
|
|
|
_translationLookup = translationLookup;
|
|
|
|
|
_rconConnectionFactory = rconConnectionFactory;
|
2020-05-04 17:50:02 -04:00
|
|
|
|
_gameLogReaderFactory = gameLogReaderFactory;
|
2020-08-17 22:21:11 -04:00
|
|
|
|
_metaService = metaService;
|
2020-02-11 17:44:06 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// creates an IW4MServer instance
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="config">server configuration</param>
|
|
|
|
|
/// <param name="manager">application manager</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public Server CreateServer(ServerConfiguration config, IManager manager)
|
|
|
|
|
{
|
2020-08-17 22:21:11 -04:00
|
|
|
|
return new IW4MServer(manager, config, _translationLookup, _rconConnectionFactory, _gameLogReaderFactory, _metaService);
|
2020-02-11 17:44:06 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|