The Argent Pony Warcraft Classic Client is a .NET client for the Blizzard World of Warcraft Classic APIs. It lets .NET applications easily access information about World of Warcraft characters, items, creatures, and more. It is a .NET Standard 2.0 library, which means it supports a broad range of platforms, including .NET Core 2.0+ and .NET Framework 4.6.1+.
Documentation is available at https://blizzard-net.github.io/warcraft-classic/
Create a new Console Application in Visual Studio or via dotnet new.
dotnet new console --name QuickStart
Add the ArgentPonyWarcraftClassicClient NuGet package to the project:
dotnet add QuickStart package ArgentPonyWarcraftClassicClient
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 ArgentPonyWarcraftClassicClient;
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 Westfall realm.
RequestResult<Realm> result = await warcraftClient.GetRealmAsync("westfall", "dynamic-classic-us");
// If we got it, display the realm slug.
if (result.Success)
{
Realm realm = result.Value;
Console.WriteLine($"Slug for {realm.Name}: {realm.Slug}");
}
}
}
}
Build and run the console application.
cd QuickStart
dotnet run
The console output displays the profile data that was retrieved from the Blizzard Realm API. The library supports many other APIs, too.
Slug for Westfall: westfall