2025-09-22 00:29:51 -05:00
|
|
|
using LANCommander.SDK.Abstractions;
|
|
|
|
|
using LANCommander.SDK.Factories;
|
2025-09-29 19:49:09 -05:00
|
|
|
using LANCommander.SDK.Models;
|
2025-11-26 01:09:52 -06:00
|
|
|
using LANCommander.SDK.PowerShell;
|
2025-09-22 00:29:51 -05:00
|
|
|
using LANCommander.SDK.Providers;
|
2025-09-24 20:58:23 -05:00
|
|
|
using LANCommander.SDK.Rpc.Client;
|
2025-09-22 00:29:51 -05:00
|
|
|
using LANCommander.SDK.Services;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2025-12-23 21:12:06 -06:00
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
2025-10-25 22:00:50 -05:00
|
|
|
using RpcSubscriber = LANCommander.SDK.Rpc.Clients.RpcSubscriber;
|
2025-09-22 00:29:51 -05:00
|
|
|
|
|
|
|
|
namespace LANCommander.SDK.Extensions;
|
|
|
|
|
|
|
|
|
|
public static class IServiceCollectionExtensions
|
|
|
|
|
{
|
2025-10-02 19:41:47 -05:00
|
|
|
public static IServiceCollection AddLANCommanderClient<TSettings>(this IServiceCollection services) where TSettings : Settings, new()
|
2025-09-22 00:29:51 -05:00
|
|
|
{
|
2025-10-02 19:41:47 -05:00
|
|
|
services.AddSingleton<SettingsProvider<TSettings>>();
|
|
|
|
|
services.AddSingleton<ISettingsProvider>(sp =>
|
|
|
|
|
sp.GetRequiredService<SettingsProvider<TSettings>>());
|
|
|
|
|
|
2025-12-23 21:12:06 -06:00
|
|
|
services.TryAddSingleton<ITokenProvider, TokenProvider>();
|
|
|
|
|
services.TryAddSingleton<INetworkInformationProvider, NetworkInformationProvider>();
|
|
|
|
|
services.TryAddSingleton<IServerAddressProvider, ServerAddressProvider>();
|
2025-10-02 19:41:47 -05:00
|
|
|
|
2025-10-25 22:00:50 -05:00
|
|
|
services.AddSingleton<IRpcSubscriber, RpcSubscriber>();
|
|
|
|
|
services.AddSingleton<RpcClient>();
|
2025-09-27 16:39:54 -05:00
|
|
|
services.AddSingleton<ApiRequestFactory>();
|
|
|
|
|
services.AddSingleton<ProcessExecutionContextFactory>();
|
2025-11-26 01:09:52 -06:00
|
|
|
services.AddSingleton<PowerShellScriptFactory>();
|
2025-09-22 00:29:51 -05:00
|
|
|
|
2025-09-27 16:39:54 -05:00
|
|
|
services.AddSingleton<AuthenticationClient>();
|
2025-09-24 20:58:23 -05:00
|
|
|
services.AddSingleton<BeaconClient>();
|
2025-12-23 21:12:06 -06:00
|
|
|
services.AddSingleton<ChatHubClient>();
|
2025-09-24 20:58:23 -05:00
|
|
|
services.AddSingleton<IConnectionClient, ConnectionClient>();
|
2025-09-27 16:39:54 -05:00
|
|
|
services.AddSingleton<DepotClient>();
|
|
|
|
|
services.AddSingleton<GameClient>();
|
|
|
|
|
services.AddSingleton<IssueClient>();
|
|
|
|
|
services.AddSingleton<LauncherClient>();
|
|
|
|
|
services.AddSingleton<LibraryClient>();
|
|
|
|
|
services.AddSingleton<LobbyClient>();
|
|
|
|
|
services.AddSingleton<MediaClient>();
|
|
|
|
|
services.AddSingleton<PlaySessionClient>();
|
|
|
|
|
services.AddSingleton<ProfileClient>();
|
|
|
|
|
services.AddSingleton<RedistributableClient>();
|
|
|
|
|
services.AddSingleton<SaveClient>();
|
|
|
|
|
services.AddSingleton<ScriptClient>();
|
|
|
|
|
services.AddSingleton<ServerClient>();
|
|
|
|
|
services.AddSingleton<TagClient>();
|
2025-09-24 20:58:23 -05:00
|
|
|
|
2025-09-27 16:39:54 -05:00
|
|
|
services.AddSingleton<Client>();
|
2025-12-13 00:27:54 -06:00
|
|
|
|
2025-12-18 11:12:41 +11:00
|
|
|
services.AddSingleton<MigrationHistoryService>();
|
2025-12-13 00:27:54 -06:00
|
|
|
services.AddSingleton<MigrationService>();
|
2025-09-22 00:29:51 -05:00
|
|
|
|
2025-12-31 20:01:37 -06:00
|
|
|
services.TryAddSingleton<IChatClient, ChatClient>();
|
|
|
|
|
|
2025-09-22 00:29:51 -05:00
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|