BUGLE: B**t-Ugly Game Launcher for Exiles

Since you can retrieve the serverlist and info from playfab, I wonder if it’s possible to retrieve the current player count and show how many total players play on online servers.

I wrote some C# code for that, but I lost interest when I tried to figure out what the different values mean that you get from a bucket. :smiley:

using Test;
using System.Net.Http;
using System.Net;
using System.Text.Json.Serialization;
using System.Text.Json;

var handler = new HttpClientHandler()
{
    AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
};

using (var httpClient = new HttpClient(handler))
{
    httpClient.BaseAddress = new Uri("https://ce-fcsd-winoff-ams.funcom.com");
    httpClient.DefaultRequestHeaders.Add("X-API-Key", "aWAWirTCDr49G569tL8Cgv5D7WyvfCzFTHMcCGvbXeHY08i3G64uv1TWKkiHMFDE");


    var result = await httpClient.GetAsync("/buckets/index_Windows.json");
    if(result.IsSuccessStatusCode)
    {
        var jsonString = await result.Content.ReadAsStringAsync();
        var list = JsonSerializer.Deserialize<BucketList>(jsonString, new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });

        foreach(var bucketName in list.Buckets)
        {
            result = await httpClient.GetAsync($"/buckets/{bucketName}");
            if(result.IsSuccessStatusCode)
            {
                jsonString = await result.Content.ReadAsStringAsync();
                Console.WriteLine(jsonString);
            }
        }
    }
}

Console.ReadKey();
2 Likes