public Plugin(ILogger <Plugin> logger, IConfigurationHandlerFactory configurationHandlerFactory, ApplicationConfiguration appConfig) { _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <LiveRadarConfiguration>("LiveRadarConfiguration"); _botGuidLookups = new Dictionary <string, long>(); _logger = logger; _appConfig = appConfig; }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory, IDatabaseContextFactory databaseContextFactory, ITranslationLookup translationLookup, IMetaService metaService, IResourceQueryHelper <ChatSearchQuery, MessageResponse> chatQueryHelper) { Config = configurationHandlerFactory.GetConfigurationHandler <StatsConfiguration>("StatsPluginSettings"); _databaseContextFactory = databaseContextFactory; _translationLookup = translationLookup; _metaService = metaService; _chatQueryHelper = chatQueryHelper; }
public ServerDistributionCalculator(IDatabaseContextFactory contextFactory, IDataValueCache <EFClientStatistics, Dictionary <long, Extensions.LogParams> > distributionCache, IDataValueCache <EFClientStatistics, double> maxZScoreCache, IConfigurationHandlerFactory configFactory) { _contextFactory = contextFactory; _distributionCache = distributionCache; _maxZScoreCache = maxZScoreCache; _configurationHandler = configFactory.GetConfigurationHandler <StatsConfiguration>("StatsPluginSettings"); }
public GscApiController(IManager manager, IMetaService metaService, IConfigurationHandlerFactory configurationHandlerFactory) : base(manager) { _metaService = metaService; _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("ClanTagRankCommands"); if (_configurationHandler.Configuration() == null) { _configurationHandler.Set((Configuration) new Configuration().Generate()); _configurationHandler.Save(); } Config = _configurationHandler.Configuration(); }
public Plugin(ILogger <Plugin> logger, IConfigurationHandlerFactory configurationHandlerFactory, IDatabaseContextFactory databaseContextFactory, ITranslationLookup translationLookup, IMetaService metaService, IResourceQueryHelper <ChatSearchQuery, MessageResponse> chatQueryHelper, ILogger <StatManager> managerLogger, IEnumerable <IClientStatisticCalculator> statCalculators, IServerDistributionCalculator serverDistributionCalculator) { Config = configurationHandlerFactory.GetConfigurationHandler <StatsConfiguration>("StatsPluginSettings"); _databaseContextFactory = databaseContextFactory; _translationLookup = translationLookup; _metaService = metaService; _chatQueryHelper = chatQueryHelper; _managerLogger = managerLogger; _logger = logger; _statCalculators = statCalculators.ToList(); _serverDistributionCalculator = serverDistributionCalculator; }
public void Setup() { logger = A.Fake <ILogger>(); handlerFactory = A.Fake <IConfigurationHandlerFactory>(); serviceProvider = new ServiceCollection() .BuildBase() .AddSingleton(A.Fake <IConfigurationHandler <StatsConfiguration> >()) .AddSingleton <StatsResourceQueryHelper>() .AddSingleton(new ServerConfiguration() { IPAddress = "127.0.0.1", Port = 28960 }) .AddSingleton <StatManager>() .AddSingleton <IW4MAdmin.Plugins.Stats.Plugin>() .BuildServiceProvider(); contextFactory = serviceProvider.GetRequiredService <IDatabaseContextFactory>(); }
public void Setup() { logger = A.Fake <ILogger>(); handlerFactory = A.Fake <IConfigurationHandlerFactory>(); serviceProvider = new ServiceCollection() .AddSingleton <StatsResourceQueryHelper>() .BuildBase() .AddSingleton <IW4MAdmin.Plugins.Stats.Plugin>() .BuildServiceProvider(); contextFactory = serviceProvider.GetRequiredService <IDatabaseContextFactory>(); void testLog(string msg) => Console.WriteLine(msg); A.CallTo(() => logger.WriteError(A <string> .Ignored)).Invokes((string msg) => testLog(msg)); A.CallTo(() => logger.WriteWarning(A <string> .Ignored)).Invokes((string msg) => testLog(msg)); A.CallTo(() => logger.WriteInfo(A <string> .Ignored)).Invokes((string msg) => testLog(msg)); A.CallTo(() => logger.WriteDebug(A <string> .Ignored)).Invokes((string msg) => testLog(msg)); }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) { _configHandler = configurationHandlerFactory.GetConfigurationHandler <WelcomeConfiguration>("WelcomePluginSettings"); }
public RadarController(IManager manager, IConfigurationHandlerFactory configurationHandlerFactory) : base(manager) { _manager = manager; _config = configurationHandlerFactory.GetConfigurationHandler <LiveRadarConfiguration>("LiveRadarConfiguration").Configuration() ?? new LiveRadarConfiguration(); }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory, ITranslationLookup translationLookup, IMetaService metaService) { _metaService = metaService; }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory, IDatabaseContextFactory contextFactory) { _configHandler = configurationHandlerFactory.GetConfigurationHandler <WelcomeConfiguration>("WelcomePluginSettings"); _contextFactory = contextFactory; }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) { _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <LiveRadarConfiguration>("LiveRadarConfiguration"); _botGuidLookups = new Dictionary <string, long>(); }
public ResetRankCommand(CommandConfiguration config, ITranslationLookup lookup, IMetaService metaService, IConfigurationHandlerFactory configurationHandlerFactory) : base(config, lookup) { _metaService = metaService; _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("ClanTagRankCommands"); if (_configurationHandler.Configuration() == null) { _configurationHandler.Set((Configuration) new Configuration().Generate()); _configurationHandler.Save(); } Config = _configurationHandler.Configuration(); Name = "ResetRank"; Description = "set a user's clan tag Rank (does not give permissions)"; Alias = "rr"; Permission = EFClient.Permission.Administrator; RequiresTarget = true; Arguments = new[] { new CommandArgument() { //Name = "rank", //Required = false } }; }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) { _configHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("LoginPluginSettings"); }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) { _configHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("ProfanityDetermentSettings"); }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory) { _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("AutomessageFeedPluginSettings"); }
public Plugin(IMetaService metaService, IConfigurationHandlerFactory configurationHandlerFactory, ILogger <Plugin> logger) { _logger = logger; _metaService = metaService; _configurationHandler = (IConfigurationHandler <Configuration>)configurationHandlerFactory.GetConfigurationHandler <Configuration>("ClanTagRankCommands"); }