From db17baea20f6706161010bbd1ca615d53cfc0ed5 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Wed, 5 Apr 2023 10:16:11 -0500 Subject: [PATCH] misc clearnup --- Application/EventParsers/BaseEventParser.cs | 6 ++--- Application/Misc/MetaServiceV2.cs | 25 --------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/Application/EventParsers/BaseEventParser.cs b/Application/EventParsers/BaseEventParser.cs index 13e64fd1..6eade2c1 100644 --- a/Application/EventParsers/BaseEventParser.cs +++ b/Application/EventParsers/BaseEventParser.cs @@ -306,7 +306,7 @@ namespace IW4MAdmin.Application.EventParsers }; } - private GameEvent? ParseJoinTeamEvent(string logLine, long gameTime) + private GameEvent ParseJoinTeamEvent(string logLine, long gameTime) { var match = Configuration.JoinTeam.PatternMatcher.Match(logLine); @@ -360,7 +360,7 @@ namespace IW4MAdmin.Application.EventParsers }; } - private GameEvent? ParseClientEnterMatchEvent(string logLine, long gameTime) + private GameEvent ParseClientEnterMatchEvent(string logLine, long gameTime) { var match = Configuration.Join.PatternMatcher.Match(logLine); @@ -409,7 +409,7 @@ namespace IW4MAdmin.Application.EventParsers #region DAMAGE - private GameEvent? ParseDamageEvent(string logLine, long gameTime) + private GameEvent ParseDamageEvent(string logLine, long gameTime) { var match = Configuration.Damage.PatternMatcher.Match(logLine); diff --git a/Application/Misc/MetaServiceV2.cs b/Application/Misc/MetaServiceV2.cs index 076ba126..3c7003f4 100644 --- a/Application/Misc/MetaServiceV2.cs +++ b/Application/Misc/MetaServiceV2.cs @@ -7,10 +7,7 @@ using System.Threading.Tasks; using Data.Abstractions; using Data.Models; using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using SharedLibraryCore; -using SharedLibraryCore.Database.Models; using SharedLibraryCore.Dtos; using SharedLibraryCore.Interfaces; using SharedLibraryCore.QueryHelper; @@ -22,7 +19,6 @@ public class MetaServiceV2 : IMetaServiceV2 { private readonly IDictionary> _metaActions; private readonly IDatabaseContextFactory _contextFactory; - private readonly IServiceProvider _serviceProvider; private readonly ILogger _logger; public MetaServiceV2(ILogger logger, IDatabaseContextFactory contextFactory, IServiceProvider serviceProvider) @@ -30,7 +26,6 @@ public class MetaServiceV2 : IMetaServiceV2 _logger = logger; _metaActions = new Dictionary>(); _contextFactory = contextFactory; - _serviceProvider = serviceProvider; } public async Task SetPersistentMeta(string metaKey, string metaValue, int clientId, @@ -69,26 +64,6 @@ public class MetaServiceV2 : IMetaServiceV2 } await context.SaveChangesAsync(token); - - - var manager = _serviceProvider.GetRequiredService(); - var matchingClient = manager.GetActiveClients().FirstOrDefault(client => client.ClientId == clientId); - var server = matchingClient?.CurrentServer ?? manager.GetServers().FirstOrDefault(); - - if (server is not null) - { - manager.AddEvent(new GameEvent - { - Type = GameEvent.EventType.MetaUpdated, - Origin = matchingClient ?? new EFClient - { - ClientId = clientId - }, - Data = metaValue, - Extra = metaKey, - Owner = server - }); - } } public async Task SetPersistentMetaValue(string metaKey, T metaValue, int clientId,