Skip to content

Commit

Permalink
v3.19.4 (#468)
Browse files Browse the repository at this point in the history
* Misc cleanup and add snippets (for fun)

* Make site usage report sponsors sort by count descending

* minor cleanup

* Perf optimizations for site usage report.

* Add server-side validation for game start/end, registration start/end, and team size. Resolves #250.

* Don't show plaintext host API key in response (and only optionally update during upsert operation).

* Initial work on game center.

* Add batch creation of users by ID through the API. Corrected a bug that could cause the app to attempt to deploy resources for all teams when predeployment was issued from admin -> game -> players.

* Finish batch user create

* Add featured games, improvements to game center, and challenge question breakdown.

* Fix compiler warning

* Fix team game calculation for game center landing.

* Order game center players by rank. Expose time remaining in session to support tickets.
  • Loading branch information
sei-bstein authored Jun 13, 2024
1 parent aba8808 commit 2e86002
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public async Task<GameCenterTeamsResults> Handle(GetGameCenterTeamsQuery request

break;
}
case GetGameCenterTeamsSort.TimeStart:
case GetGameCenterTeamsSort.TimeSinceStart:
{
sortedTeamIds = matchingTeams
.Sort(t => t.Value.TimeSinceStart, request.Args.SortDirection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum GetGameCenterTeamsSort
Rank,
TeamName,
TimeRemaining,
TimeStart
TimeSinceStart
}

public sealed class GetGameCenterTeamsArgs
Expand Down
1 change: 1 addition & 0 deletions src/Gameboard.Api/Features/Ticket/Ticket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Ticket
public string Status { get; set; }
public string Label { get; set; }
public bool StaffCreated { get; set; }
public double? TimeTilSessionEndMs { get; set; }

public DateTimeOffset Created { get; set; }
public DateTimeOffset LastUpdated { get; set; }
Expand Down
4 changes: 4 additions & 0 deletions src/Gameboard.Api/Features/Ticket/TicketService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public async Task<Ticket> Retrieve(int id)
if (entity.PlayerId.IsNotEmpty() && entity.TeamId.IsNotEmpty())
{
var team = await _teamService.GetTeam(entity.TeamId);
var nowish = _now.Get();

ticket.TimeTilSessionEndMs = entity?.Player?.SessionEnd is null ? default(double?) : (entity.Player.SessionEnd - nowish).TotalMilliseconds;
ticket.TeamName = team.ApprovedName;
}

Expand Down Expand Up @@ -266,6 +269,7 @@ public async Task<IEnumerable<TicketSummary>> List(TicketSearchFilter model, str
var userTeams = await TicketStore.DbContext.Players
.Where(p => p.UserId == userId && p.TeamId != null && p.TeamId != "")
.Select(p => p.TeamId)
.Distinct()
.ToListAsync();

q = q.Where(t => t.RequesterId == userId ||
Expand Down

0 comments on commit 2e86002

Please sign in to comment.