Skip to content

Latest commit

 

History

History

GameLib.Plugin.Ubisoft

GameLib.NET Ubisoft Connect Plugin for GameLib.NET

Ubisoft connect plugin for GameLib.NET GameLib.NET.

The plugin will deliver information about the installation status of the Ubisoft Connect launcher as well the installed games within the launcher.

Installing

The plugin is already bundled with the core library GameLib.NET GameLib.NET

Additional information the plugin is providing

To get the additonal information this plugin is providing just cast IGame to UbisoftGame.

using GameLib;
using GameLib.Plugin.Ubisoft;
using GameLib.Plugin.Ubisoft.Model;

var launcherManager = new LauncherManager();

// not required to cast here just to add to the documentation
var launcher = (UbisoftLauncher?)launcherManager.GetLaunchers()
    .Where(launcher => launcher.Name == "Ubisoft Connect")
    // Plugin ID could also be used instead of the name
    //.Where(launcher => launcher.Id == new Guid("CE276C05-6CD1-4D99-9A5A-2E03ECFB6028"))
    .FirstOrDefault();

if (launcher is not null)
{
    var games = (IEnumerable<UbisoftGame>)launcher.Games;
    foreach (var game in games)
    {
        // Write additional data Ubisoft Connect is providing for a game besides from the IGame interface
        Console.WriteLine($"\nGame");
        Console.WriteLine($"\tLanguage: {game.Language}");
        Console.WriteLine($"\tHelpUrl: {game.HelpUrl}");
        Console.WriteLine($"\tFacebookUrl: {game.FacebookUrl}");
        Console.WriteLine($"\tHomepageUrl: {game.HomepageUrl}");
        Console.WriteLine($"\tForumUrl: {game.ForumUrl}");
    }
}