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;
|
|
|
|
|
using LANCommander.SDK.Rpc.Client;
|
2025-09-22 00:29:51 -05:00
|
|
|
using LANCommander.SDK.Services;
|
2025-10-08 19:53:05 -05:00
|
|
|
using Microsoft.Extensions.Configuration;
|
2025-09-22 00:29:51 -05:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2025-10-08 19:53:05 -05:00
|
|
|
using Microsoft.Extensions.Options;
|
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-09-22 00:29:51 -05:00
|
|
|
services.AddSingleton<ITokenProvider, TokenProvider>();
|
|
|
|
|
services.AddSingleton<INetworkInformationProvider, NetworkInformationProvider>();
|
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-09-27 16:39:54 -05:00
|
|
|
services.AddSingleton<ChatClient>();
|
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-09-22 00:29:51 -05:00
|
|
|
|
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|