namespace DorkNet.Server.Compat; /// One client-version-family plugin. Each implementation /// declares which exact version it handles /// and which protocol-compatibility they map /// to. The plugin's job at registration time is to also wire any /// generation-specific strategy services into DI via /// so controllers / services /// downstream can resolve the right IWireFormat, /// IRouteOverride, etc. for the active request's generation. /// /// Adding a new version with the SAME wire shapes as an existing /// generation = just listing its key in that generation's plugin /// . Only a new generation needs new /// strategy classes. /// public interface IVersionPlugin { /// All client-build keys this plugin handles. Multiple /// keys can share one plugin when several Rec Room builds shipped /// the same wire format. Convention: lowercase, underscore-separated, /// matching the literal the client mod sends in /// X-DorkNet-Version. IReadOnlyCollection VersionKeys { get; } /// Wire-format-compatibility group this plugin implements. /// Multiple plugins can share a generation (rare, but allowed when /// e.g. a Quest build and a PC build of the same era are /// protocol-identical and we just want separate /// bookkeeping). string Generation { get; } /// Register any generation-specific strategy services /// into DI. Called once at startup by the bootstrap code in /// Program.cs. Use keyed registrations (keyed by /// ) so requests for other generations /// don't collide. void RegisterStrategies(IServiceCollection services); }