mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
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:
@@ -50,13 +50,34 @@ public class RecRoomConfig
|
||||
[JsonPropertyName("DailyObjectives")]
|
||||
public List<List<DailyObjective>> DailyObjectives { get; set; } = DailyObjective.DefaultSets();
|
||||
|
||||
[JsonPropertyName("ConfigTable")]
|
||||
// 2018.06 client (RecNet.OPOHNGAOCCD.Deserialize, RecNet.cs:9062-9068) reads
|
||||
// ConfigTable as an ARRAY of {Key,Value} objects, NOT a JSON object map:
|
||||
// foreach elem in dict["ConfigTable"]: table[elem["Key"]] = elem["Value"]
|
||||
// The 2020 client read it as an object — but this branch targets 2018, so we
|
||||
// emit the array form. Keep the settable Dictionary for existing call sites
|
||||
// (ConfigService.GetConfig populates it) and project to the wire array.
|
||||
[JsonIgnore]
|
||||
public Dictionary<string, string> ConfigTable { get; set; } = [];
|
||||
|
||||
[JsonPropertyName("ConfigTable")]
|
||||
public List<ConfigTableEntry> ConfigTableWire =>
|
||||
ConfigTable.Select(kv => new ConfigTableEntry { Key = kv.Key, Value = kv.Value }).ToList();
|
||||
|
||||
[JsonPropertyName("ServiceUrls")]
|
||||
public Dictionary<string, string> ServiceUrls { get; set; } = [];
|
||||
}
|
||||
|
||||
// 2018 ConfigTable element shape: {"Key": "...", "Value": "..."} (PascalCase,
|
||||
// LitJson Util.GetKey<string>("Key"/"Value")).
|
||||
public class ConfigTableEntry
|
||||
{
|
||||
[JsonPropertyName("Key")]
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("Value")]
|
||||
public string Value { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class PhotonConfig
|
||||
{
|
||||
[JsonPropertyName("AppId")]
|
||||
|
||||
Reference in New Issue
Block a user