Files
sor/Server/src/SOR.Collection/ServiceRegistration.cs
T
2a15bd2eb3 Fix crashes, add ModifyAttackRange effects, ArchSpirit swap in deck editor
- Bazaar Deck tab crash: null-safe float conversion for usdPrice in store_item_row.gd
- Leaderboard crash: freed-object guard in _on_leaderboard_ok (is_instance_valid check)
- Add ModifyMinAttackRangeEffect / ModifyMaxAttackRangeEffect with clamp-to-0 and correct reversal tracking
- AbilityBuilder: add new range effects to Stat Modification group + _amountOnlyTypes
- collection.set_arch_spirit: new handler, request record, and service registration
- Deck editor: show Tier-1 commander row with Change button + ArchSpirit picker panel

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-25 11:25:44 -04:00

43 lines
2.0 KiB
C#

namespace SOR.Collection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SOR.Collection.Handlers;
using SOR.Database;
using SOR.Networking.Abstractions.Messaging;
/// <summary>
/// Registers all collection service components into the DI container.
/// Called from SOR.Host/Program.cs when ENABLED_SERVICES includes "collection".
/// </summary>
public static class ServiceRegistration
{
public static IServiceCollection AddCollectionService(
this IServiceCollection services,
IConfiguration configuration)
{
// Database contexts the collection service needs.
services.AddCollectionDatabase(configuration);
services.AddCatalogDatabase(configuration);
services.AddBazaarDatabase(configuration); // needed by starter deck handlers
services.AddIdentityDatabase(configuration); // needed by starter deck handlers
// Message handlers — one per message type, Transient lifetime.
// MessageDispatcher collects all IMessageHandler registrations at startup.
services.AddTransient<IMessageHandler, CollectionGetCardsHandler>();
services.AddTransient<IMessageHandler, CollectionGetDecksHandler>();
services.AddTransient<IMessageHandler, CollectionGetDeckHandler>();
services.AddTransient<IMessageHandler, CollectionCreateDeckHandler>();
services.AddTransient<IMessageHandler, CollectionRenameDeckHandler>();
services.AddTransient<IMessageHandler, CollectionSetArchSpiritHandler>();
services.AddTransient<IMessageHandler, CollectionDeleteDeckHandler>();
services.AddTransient<IMessageHandler, CollectionAddCardHandler>();
services.AddTransient<IMessageHandler, CollectionRemoveCardHandler>();
services.AddTransient<IMessageHandler, CollectionCloneDeckHandler>();
services.AddTransient<IMessageHandler, CollectionGetStarterDecksHandler>();
services.AddTransient<IMessageHandler, CollectionSelectStarterDeckHandler>();
return services;
}
}