discord-bot/Clients/CompatApiClient
2019-12-06 16:04:47 +05:00
..
Compression use RecyclableMemoryStream to reduce GC pressure 2019-12-06 16:04:47 +05:00
Formatters organize clients in filesystem similar to solution structure 2019-01-30 16:20:26 +05:00
POCOs add support for online-only flag in compatibility api 2019-08-23 16:53:50 +05:00
Utils update to c# 8.0 syntax, mostly for .Substring() 2019-11-06 03:45:31 +05:00
ApiConfig.cs use RecyclableMemoryStream to reduce GC pressure 2019-12-06 16:04:47 +05:00
Client.cs refactor to use using statement whenever it makes sense 2019-11-25 18:07:01 +05:00
CompatApiClient.csproj use RecyclableMemoryStream to reduce GC pressure 2019-12-06 16:04:47 +05:00
readme.md some docs 2019-04-01 22:52:27 +05:00
RequestBuilder.cs organize clients in filesystem similar to solution structure 2019-01-30 16:20:26 +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.