discord-bot/Clients/CompatApiClient
2021-03-03 20:04:44 +05:00
..
Compression update CompatApiClient, remove unused junk, fix compiler issues 2020-11-11 16:09:46 +05:00
Formatters add workaround for invalid json value type in commit hash 2020-11-17 21:19:30 +05:00
POCOs replace object initialization with the new() 2020-11-14 14:33:29 +05:00
Utils use await using where appropriate 2020-11-14 15:25:20 +05:00
ApiConfig.cs replace object initialization with the new() 2020-11-14 14:33:29 +05:00
Client.cs add workaround for invalid json value type in commit hash 2020-11-17 21:19:30 +05:00
CompatApiClient.csproj update dependencies 2021-03-03 20:04:44 +05:00
readme.md some docs 2019-04-01 22:52:27 +05:00
RequestBuilder.cs use await using where appropriate 2020-11-14 15:25:20 +05:00

Compatibility API Client

There is no documentation, but the source code is available.

This project also contains all of the Web API infrastructure to facilitate the automatic serialization/deserialization of data.

Some terminology:

  • POCO - plain old C# object, is a barebones class with fields/properties only, that is used for automatic [de]serialization.

General advise on web client implementation and usage:

  • Do use HttpClientFactory.Create() instead of new HttpClient(), as every instance will reserve an outgoing port number, and factory keeps a pool.
  • Do reuse the same client instance whenever possible, it's thread-safe and there's no reason not to keep a single copy of it.

Compression contains handler implementation that provides support for transparent http request compression (Content-Encoding header), and implements standard gzip/deflate types.

Formatters contain JSON contract resolver that handles popular naming conventions for [de]serialization (dashed-style, underscore_style, and PascalStyle).

Utils have some handy Uri extension methods for easy query parameters manipulation.

Game Compatibility Status

Does game status lookup by product code, game title (English or using romaji for Japanese titles), or game title abbreviation. We use this for most embeds, including log parsing results, standalone game information embeds, compatibility lists, etc.

RPCS3 Update Information

Accepts current build commit hash as an argument. Provides information about the build requested, as well as information about the latest build available.