GithubHelp home page GithubHelp logo

tekgator / gamelib.net Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 3.0 1008 KB

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

License: MIT License

C# 100.00%
gamelib epic epic-games epicgames game-launcher gaming gog gog-galaxy launcher origin steam ubisoft ubisoft-connect battlenet blizzard dotnet riot riot-games

gamelib.net's Introduction

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

gamelib.net's People

Contributors

tekgator avatar zenmaxe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gamelib.net's Issues

If the directory does not exist, an exception is raised

GameLib.Core PathUtil.GetExecutables If the directory does not exist, an exception is raised
public static List<string> GetExecutables(string path) { if (!Directory.Exists(path)) return new List<string>(); return Directory.GetFiles(path, "*.exe", SearchOption.AllDirectories).ToList(); }

Broken Battle.net launch strings

Hi, I came across a bug when using .LaunchString with Battle.net games.

With the latest release, it currently returns --game=PRO instead of --exec="launch Pro", etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.