GameLib.NET
1.0.2
See the version list below for details.
dotnet add package GameLib.NET --version 1.0.2
NuGet\Install-Package GameLib.NET -Version 1.0.2
<PackageReference Include="GameLib.NET" Version="1.0.2" />
paket add GameLib.NET --version 1.0.2
#r "nuget: GameLib.NET, 1.0.2"
// Install GameLib.NET as a Cake Addin #addin nuget:?package=GameLib.NET&version=1.0.2 // Install GameLib.NET as a Cake Tool #tool nuget:?package=GameLib.NET&version=1.0.2
GameLib.NET
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.
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:
Install, using the Nuget Gallery
Install using the Package Manager Console:
Install-Package GameLib.NET
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.Launchers)
{
Console.WriteLine($"Launcher name: {launcher.Name}");
Console.WriteLine("Games:");
foreach (var game in launcher.GetGames())
{
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)}");
}
}
}
Also have a look at the Console Demo within the repository. It will run straight out of the box to give you a hint what the library can do for you.
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 ClearCache()
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.
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, feel free to buy me a coffee or see the Sponsor link at the top right of the GitHub page.
<a href="https://www.buymeacoffee.com/tekgator" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
Dependencies and Credits
Teneko's Teronis.DotNet which allows project reference content to be added to the NuGet-package during pack process
Thanks to Josef Nemec and contributers of Playnite for the inspiration of decoding the proprietary manifest and catalog data of each launcher
The team of SteamDB providing Valve's KeyValue for .NET for reading Steam's proprietary key value format files
protobuf-net for decoding Ubisoft's local catalog data
JSON deserializing by Json.NET
YAML deserializing by YamlDotNet
The main GameLib.NET icon is created by Flat Icons
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. |
-
net6.0-windows7.0
- Newtonsoft.Json (>= 13.0.1)
- protobuf-net (>= 3.1.17)
- System.ComponentModel.Composition (>= 6.0.0)
- ValveKeyValue (>= 0.8.0.139)
- YamlDotNet (>= 11.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on GameLib.NET:
Repository | Stars |
---|---|
project-sbc/Handheld-Control-Panel
|
Version | Downloads | Last updated |
---|---|---|
1.4.1 | 1,643 | 7/30/2023 |
1.3.3 | 1,694 | 3/18/2023 |
1.3.2 | 1,656 | 9/16/2022 |
1.3.1 | 1,663 | 9/11/2022 |
1.3.0 | 1,621 | 9/11/2022 |
1.2.1 | 1,658 | 9/4/2022 |
1.1.2 | 1,623 | 9/1/2022 |
1.1.1 | 1,628 | 8/27/2022 |
1.0.6 | 1,589 | 8/24/2022 |
1.0.5 | 1,599 | 8/13/2022 |
1.0.4 | 1,605 | 8/12/2022 |
1.0.3 | 1,558 | 8/10/2022 |
1.0.2 | 1,668 | 7/10/2022 |