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
+9
View File
@@ -632,6 +632,15 @@ public class PlayerService(DorkNetDbContext db, RoomService rooms, ILogger<Playe
public async Task<PlayerEntity?> GetByIdAsync(long id) =>
await db.Players.Include(p => p.Avatar).FirstOrDefaultAsync(p => p.Id == id);
/// <summary>Bulk profile fetch for the 2018 client's batch resolvers
/// (api/players/v1/list, presence). Single query; order is not guaranteed.</summary>
public async Task<List<PlayerEntity>> GetByIdsAsync(IEnumerable<long> ids)
{
var idList = ids.Distinct().ToList();
if (idList.Count == 0) return [];
return await db.Players.Where(p => idList.Contains(p.Id)).ToListAsync();
}
/// <summary>
/// Stamp the calling platform onto an existing account so the
/// next boot's <c>/cachedlogin/forplatformid</c> query finds it.