Fixing BSON projection
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 47s
Deploy Promiscuity Character API / deploy (push) Successful in 1m1s
Deploy Promiscuity Inventory API / deploy (push) Successful in 46s
Deploy Promiscuity Locations API / deploy (push) Successful in 47s
k8s smoke test / test (push) Successful in 9s

This commit is contained in:
Zeeshaun 2026-03-23 18:45:52 -05:00
parent bca8e3374a
commit aa99788268

View File

@ -47,22 +47,25 @@ public class CharacterStore
return result.ModifiedCount > 0 || result.MatchedCount > 0; return result.ModifiedCount > 0 || result.MatchedCount > 0;
} }
public Task<List<VisibleCharacter>> GetVisibleOthersAsync(string characterId, int x, int y, int radius, DateTime onlineSinceUtc) => public async Task<List<VisibleCharacter>> GetVisibleOthersAsync(string characterId, int x, int y, int radius, DateTime onlineSinceUtc)
_col.Find(c => {
var characters = await _col.Find(c =>
c.Id != characterId && c.Id != characterId &&
c.Coord.X >= x - radius && c.Coord.X >= x - radius &&
c.Coord.X <= x + radius && c.Coord.X <= x + radius &&
c.Coord.Y >= y - radius && c.Coord.Y >= y - radius &&
c.Coord.Y <= y + radius && c.Coord.Y <= y + radius &&
c.LastSeenUtc >= onlineSinceUtc) c.LastSeenUtc >= onlineSinceUtc)
.Project(c => new VisibleCharacter .ToListAsync();
return characters.Select(c => new VisibleCharacter
{ {
Id = c.Id ?? string.Empty, Id = c.Id ?? string.Empty,
Name = c.Name, Name = c.Name,
Coord = c.Coord, Coord = c.Coord,
LastSeenUtc = c.LastSeenUtc LastSeenUtc = c.LastSeenUtc
}) }).ToList();
.ToListAsync(); }
public async Task<bool> DeleteForOwnerAsync(string id, string ownerUserId, bool allowAnyOwner) public async Task<bool> DeleteForOwnerAsync(string id, string ownerUserId, bool allowAnyOwner)
{ {