Skip to content

Release 3.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 09 May 09:35
· 116 commits to master since this release
7c2e64a

This is a major release with big changes featuring Wine, Bottles and Proton support for GOG, EGS and Origin. This release also replaces System.IO.Abstraction with NexusMods.Paths from the new Nexus Mods App, changes how results are handled and re-adds Xbox Game Pass support.

Breaking Changes:

  • Reworked the constructors of all handlers and removed most overloads. All handlers now have a single constructor with no default values.
  • Updated FindAllGames to return OneOf<TGame, ErrorMessage> instead of Result<TGame> (using the OneOf library).
  • Replaced System.IO.Abstraction with NexusMods.Path.IFileSystem.
    • Paths are now of type AbsolutePath instead of string.
  • Changed AHandler<TGame, TId> to require TId : notnull.
  • Added IGame interface and changed AHandler<TGame, TId> to require TGame : IGame.
  • Removed the extension functions OnlyGame and OnlyError.
  • Changed all game Ids to be value objects using Vogen.
  • Changed FindAllGamesById to return IReadOnlyDictionary<TGame, TId> instead of IDictionary<TGame, TId>.

(Hopefully) non-breaking changes:

  • Re-added Xbox Game Pass.
  • Added Func<TGame, TId> IdSelector and IEqualityComparer<TId>? IdEqualityComparer to AHandler<TGame, TId>. These can be used to construct key-value types like a dictionary.
  • Added WindowsRegistry.Shared for a shared instance of IRegistry.
  • Wine: added GetUserName, ProtonWinePrefix will now use steamuser.
  • Enabled Trimming.

How to upgrade:

The transition from Result<TGame> to OneOf<TGame, ErrorMessage> should be straight forward. You can use the provided helper methods for matching like result.Match(game => { }, error => { }) or result.Switch(game => { }, error => { }) depending on your needs. I've also added some extension methods to make the transition easier:

  • bool IsGame()
  • bool IsError()
  • TGame AsGame()
  • ErrorMessage AsError
  • bool TryGetGame(out TGame)
  • bool TryGetError(out ErrorMessage)

Store handlers, like GOGHandler, now require an implementation of NexusMods.Paths.IFileSystem, instead of System.IO.Abstraction.IFileSystem. You can use the shared instance at NexusMods.Path.FileSystem.Shared, if you want to use the real file system.

For testing, you can either mock NexusMods.Paths.IFileSystem, or use NexusMods.Paths.InMemoryFileSystem. If you need to do more in-depth testing, you can also use the NexusMods.Paths.TestingHelpers package.

Since AHandler<TGame, TId> has changed, you might need to update the constraints for TId, if you use generics. Simply add where TId : notnull to the constraints. All Ids have been replaced to using value objects. For example: instead of having long id for GOGGame, it's now GOGGameId id. You can still get the value using id.Value, which is still a long.

How to use with Wine on Linux:

See the updated README.