feat: Add support for 2018 client API endpoints and data models

- Implemented new search endpoints for rooms to accommodate the 2018 client.
- Added support for retrieving room details and featured rooms in a format compatible with the 2018 client.
- Introduced new data models for login responses and player presence specific to the 2018 client.
- Created mappers to convert between internal entities and the 2018 wire formats for players and rooms.
- Updated existing storefront APIs to include versioned endpoints for the 2018 client.
- Enhanced the version controller to return dual-format responses for compatibility with both 2018 and 2020 clients.
- Refactored the configuration service to ensure trailing slashes in URLs for the 2018 client.
This commit is contained in:
Alexa
2026-06-07 15:32:52 +03:00
parent 955246c6e4
commit 579071858a
21 changed files with 770 additions and 94 deletions
+12 -3
View File
@@ -102,7 +102,7 @@ public class ConfigService(IConfiguration config, DomainConfig domain)
foreach (var (service, sub) in ServiceSubdomains)
{
var host = string.IsNullOrEmpty(sub) ? apex : $"{sub}.{apex}";
map[service] = $"https://{host}";
map[service] = $"https://{host}/";
}
return map;
}
@@ -115,12 +115,21 @@ public class ConfigService(IConfiguration config, DomainConfig domain)
if (domain.SingleOriginEnabled)
{
var prefix = string.IsNullOrEmpty(sub) ? "www" : sub;
map[service] = $"{domain.SingleOriginBaseUrl}/__dn/{prefix}";
map[service] = $"{domain.SingleOriginBaseUrl}/__dn/{prefix}/";
continue;
}
var host = string.IsNullOrEmpty(sub) ? domain.Apex : domain.Sub(sub);
map[service] = domain.Url(host);
map[service] = EnsureTrailingSlash(domain.Url(host));
}
return map;
}
// The 2018.06 client builds every API URL by RAW string concat —
// new Uri(string.Concat(serviceBase, "api/config/v2")) — so each service
// base MUST be an absolute origin ending in '/', else the host glues to
// the path ("https://api.apexapi/config/v2") and every call 404s. The
// 2020 client runs EnsureEndsWith('/') on these values itself, so the
// trailing slash is idempotent there — safe for both eras.
private static string EnsureTrailingSlash(string url)
=> url.EndsWith('/') ? url : url + "/";
}