Warning
Deprecation Notice: This project has been discontinued and as such some aspects may no longer function as intended. Your mileage may vary.
The Dragon6 API is the backbone of the website and apps with the same name, providing an easy-to-use platform for retrieving publicly-available data about other Ubisoft Accounts and their Rainbow Six | Siege Stats.
This API supports:
- Ubisoft Account Authentication
- Ubisoft Account Searches (by name and ubisoft id)
- Ubisoft Account Activity Tracking (for R6)
- Legacy Stats (lifetime account stats)
- Seasonal Stats (ranked and unranked/casual stats per-season)
- Modern Stats (the stats currently found on the official Ubisoft tracker) (coming soon)
- Ubisoft Toolkits (IP geolocation, Rainbow Six Server Status)
- Download the package from by clicking the NuGet badge at the top of this document, and follow the instructions there for your environment
- Create a class inside your project, naming it what you want to call your client type (for example
StatsClient
)using System; using System.IO; using System.Threading.Tasks; using DragonFruit.Data; using DragonFruit.Data.Serializers.Newtonsoft; using DragonFruit.Six.Api; using DragonFruit.Six.Api.Authentication; public class StatsClient : Dragon6Client { // change this to whatever you want private readonly string _tokenFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DragonFruit Network", "ubi.token"); static StatsClient() { Directory.CreateDirectory(Path.GetDirectoryName(_tokenFile)); } /// <summary> /// Tells the Dragon6 Client how to get a token in the case of a restart or expiration /// </summary> protected override IUbisoftToken GetToken() { if (File.Exists(_tokenFile)) { // if we have a file with some potentially valid keys, try that first var token = FileServices.ReadFile<UbisoftToken>(_tokenFile); if (!token.Expired) return token; } // store logins somewhere that is NOT in the code var username = "username"; var password = "password"; var newToken = this.GetUbiToken(username, password); // write new token to disk (non-blocking) _ = Task.Run(() => FileServices.WriteFile(_tokenFile, newToken)); // return to keep going return newToken; } }
- Create an instance of the class you just defined in either a
static
location or as aSingleton
(if you're using a dependency container) - Add some using statements where you want to consume the class:
using DragonFruit.Six.Api.Legacy;
using DragonFruit.Six.Api.Seasonal;
using DragonFruit.Six.Api.Accounts;
using DragonFruit.Six.Api.Modern;
- Check out the extension methods available to you using IntelliSense (type the client name followed by the dot and browse the extensions):
var myAccount = await statsClient.GetAccountAsync("PaPa.Curry", Platform.PC, IdentifierType.Name);
- Dragon6 Web: https://dragon6.dragonfruit.network
- Dragon6 Discord: Discord
- Dragon6 Mobile: https://play.google.com/store/apps/details?id=com.dragon.six
- Dragon6 PC: https://www.microsoft.com/en-us/p/dragon6/9n88cqpkgs15
Refer to CONTRIBUTING.md for more information