diff --git a/Tanji.CLI/Program.cs b/Tanji.CLI/Program.cs index 074f4ea..0a5b5c4 100644 --- a/Tanji.CLI/Program.cs +++ b/Tanji.CLI/Program.cs @@ -46,12 +46,12 @@ static void CleanUp(PosixSignalContext context) private readonly ILogger _logger; private readonly IWebInterceptionService _webInterception; - private readonly IClientHandlerService _clientHandler; + private readonly IClientHandlerService _clientHandler; private readonly IConnectionHandlerService _connectionHandler; public Program(ILogger logger, IWebInterceptionService webInterception, - IClientHandlerService clientHandler, + IClientHandlerService clientHandler, IConnectionHandlerService connectionHandler) { _logger = logger; @@ -70,7 +70,7 @@ public async Task RunAsync(CancellationToken cancellationToken = default) string ticket = await _webInterception.InterceptTicketAsync(cancellationToken).ConfigureAwait(false); _logger.LogInformation("Game Ticket: {Ticket}", ticket); - CachedGame game = _clientHandler.PatchClient(HPlatform.Flash, null); + IGame game = _clientHandler.PatchClient(HPlatform.Flash); _logger.LogInformation("Client Processed : {game.path}", game.Path); var connectionContext = new HConnectionContext(game); diff --git a/Tanji.Core/ServiceCollectionExtensions.cs b/Tanji.Core/ServiceCollectionExtensions.cs index 071f33a..4997143 100644 --- a/Tanji.Core/ServiceCollectionExtensions.cs +++ b/Tanji.Core/ServiceCollectionExtensions.cs @@ -1,6 +1,5 @@ using Tanji.Core.Services; using Tanji.Core.ViewModels; -using Tanji.Core.Habbo.Canvas; using Tanji.Core.Configuration; using Microsoft.Extensions.Options; @@ -18,7 +17,7 @@ public static IServiceCollection AddTanjiCore(this IServiceCollection services) // Services services.AddSingleton(); - services.AddSingleton, ClientHandlerService>(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton, ConnectionHandlerService>(); diff --git a/Tanji.Core/Services/IClientHandlerService.cs b/Tanji.Core/Services/IClientHandlerService.cs index 0cf60eb..276cf1f 100644 --- a/Tanji.Core/Services/IClientHandlerService.cs +++ b/Tanji.Core/Services/IClientHandlerService.cs @@ -5,11 +5,11 @@ namespace Tanji.Core.Services; -public interface IClientHandlerService where TGame : IGame +public interface IClientHandlerService { DirectoryInfo PatchedClientsDirectory { get; } - public TGame PatchClient(HPlatform platform, string? clientPath = null); + IGame PatchClient(HPlatform platform, string? clientPath = null); public Process? LaunchClient(HPlatform platform, string ticket, string? clientPath = null); bool TryGetIdentifiers(string? revision, out Outgoing? outgoing, out Incoming? incoming); } \ No newline at end of file diff --git a/Tanji.Core/Services/Implementations/ClientHandlerService.cs b/Tanji.Core/Services/Implementations/ClientHandlerService.cs index f8b2b39..974a8e2 100644 --- a/Tanji.Core/Services/Implementations/ClientHandlerService.cs +++ b/Tanji.Core/Services/Implementations/ClientHandlerService.cs @@ -21,7 +21,7 @@ namespace Tanji.Core.Services; -public sealed class ClientHandlerService(ILogger logger, IOptions options) : IClientHandlerService +public sealed class ClientHandlerService(ILogger logger, IOptions options) : IClientHandlerService { private static readonly JsonSerializerOptions SerializerOptions; @@ -44,7 +44,7 @@ static ClientHandlerService() SerializerOptions.Converters.Add(new IPEndPointConverter()); } - public CachedGame PatchClient(HPlatform platform, string? clientPath = null) + public IGame PatchClient(HPlatform platform, string? clientPath = null) { if (string.IsNullOrWhiteSpace(clientPath)) { diff --git a/Tanji.Core/Services/Implementations/ConnectionHandlerService.cs b/Tanji.Core/Services/Implementations/ConnectionHandlerService.cs index 568b2a6..676b8f3 100644 --- a/Tanji.Core/Services/Implementations/ConnectionHandlerService.cs +++ b/Tanji.Core/Services/Implementations/ConnectionHandlerService.cs @@ -16,12 +16,12 @@ public sealed class ConnectionHandlerService : IConnectionHandlerService _logger; - private readonly IClientHandlerService _clientHandler; + private readonly IClientHandlerService _clientHandler; public ObservableCollection> Connections { get; } = []; public ConnectionHandlerService(ILogger logger, - IClientHandlerService clientHandler, + IClientHandlerService clientHandler) PacketMiddlemanService packetMiddleman) { _logger = logger;