ArgentPonyWarcraftClient.Extensions.DependencyInjection

Extensions of Microsoft.Extensions.DependencyInjection for the Argent Pony .NET client.


Keywords
Warcraft, World-of-Warcraft, WoW, Blizzard, Dependency-Injection, DI
License
MIT
Install
Install-Package ArgentPonyWarcraftClient.Extensions.DependencyInjection -Version 8.1.8

Documentation

Argent Pony Warcraft Client

The Argent Pony Warcraft Client is a .NET client for the Blizzard World of Warcraft APIs. It lets .NET applications easily access information about World of Warcraft characters, guilds, items, spells, and more. It is a .NET Standard 2.0 library, which means it supports a broad range of platforms, including .NET 6 (long term support), .NET 7 (standard term support), and .NET Framework 4.6.2+.

NuGet version build CodeQL

Documentation

Documentation is available at https://blizzard-net.github.io/warcraft/

Quick Start

Create a new Console Application in Visual Studio or via dotnet new.

dotnet new console --name QuickStart

Add the ArgentPonyWarcraftClient NuGet package to the project:

dotnet add QuickStart package ArgentPonyWarcraftClient

Update Program.cs in the new project as follows, subsituting your own client ID and secret from Blizzard's Getting Started instructions:

using System;
using System.Threading.Tasks;
using ArgentPonyWarcraftClient;

namespace QuickStart
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // Secrets from https://develop.battle.net/documentation/guides/getting-started.
            string clientId = "MY-CLIENT-ID-GOES-HERE";
            string clientSecret = "MY-CLIENT-SECRET-GOES-HERE";
            var warcraftClient = new WarcraftClient(clientId, clientSecret);

            // Retrieve the character profile for Drinian of realm Norgannon.
            RequestResult<CharacterProfileSummary> result =
                await warcraftClient.GetCharacterProfileSummaryAsync("norgannon", "drinian", "profile-us");

            // If we got it, display the level.
            if (result.Success)
            {
                CharacterProfileSummary profile = result.Value;
                Console.WriteLine($"Level for {profile.Name}: {profile.Level}");
            }
        }
    }
}

Build and run the console application.

cd QuickStart
dotnet run

The console output displays the profile data that was retrieved from the Blizzard Character Profile API. The library supports many other APIs, too.

Level for Drinian: 70