Skip to content

GameLib.NET is a library to give .NET developers easy access to the users installed game launchers and installed games.

License

Notifications You must be signed in to change notification settings

tekgator/GameLib.NET

Repository files navigation

GameLib.NET GameLib.NET

Nuget GitHub Release Date GitHub last commit

GameLib.NET is a library to give .NET developers easy access to the users installed game launchers and installed games. The motivation for the library is a tool I'm currently working on which requires access to all game executables on a PC.

While this repository is providing already the plugins to gather the games from the most popular game launchers, it easily extendible via the MEF Framework. A developer guide will follow, but I'm pretty sure the geeks will find out themselfes on how to do it.

Support

I try to be responsive to Stack Overflow questions in the gamelib-net tag and issues logged on this GitHub repository.

If I've helped you and you like some of my work, feel free to buy me a coffee ☕ (or more likely a beer 🍺)

Buy Me a Coffee at ko-fi.com

Plugins

Following plugins are already bundled with GameLib.NET to detect the game launchers including their installed games:

Installing

Multiple options are available to install within your project:

  1. Install, using the Nuget Gallery

  2. Install using the Package Manager Console:

    Install-Package GameLib.NET 
  3. Install using .NET CLI

    dotnet add package GameLib.NET

Usage

GameLib.NET provides a LauncherManager class which has to be instantiated, optionally LauncherOptions can be supplied. Each Plugin will provide an interface instance for the launcher ILauncher as well an interface instance for IEnumerable<Game>.

using GameLib;

var launcherManager = new LauncherManager(new LauncherOptions() { QueryOnlineData = true });

foreach (var launcher in launcherManager.GetLaunchers())
{
    Console.WriteLine($"Launcher name: {launcher.Name}");
    Console.WriteLine("Games:");

    foreach (var game in launcher.Games)
    {
        Console.WriteLine($"Game ID: {game.GameId}");
        foreach (var item in game.GetType().GetProperties().Where(p => p.Name != "GameId"))
        {
            Console.WriteLine($"\t{item.Name}: {item.GetValue(game)}");
        }
    }
}

Please note: All values are cached within each launcher to save computing time on the next call. If you like to get refreshed values (e.g. new game installed while the lib is running) the Refresh() Method on the LauncherManager or on the actual ILauncher has to be called.

What launcher / game information is the library providing?

To make a long story short have a look at the ILauncher interface as well as the IGame interface to see what values are returned by default. Each plugin can provide more information, which can be found in the README.md the corresponding plugin.

Please note: Not all launchers will fill all properties in the IGame interface instance. Further information are provided in the README.md of each plugin.

Demo application

Have a look at the Console Demo as well as the WPF GUI Demo within the repository. Both will run straight out of the box to give you a hint what the library can do for you.

WPF GUI Demo Launchers Screenshot

WPF GUI Demo Games Screenshot

Dependencies and Credits