From 736388628c7f420adc19d53baa727c0eac6d66ba Mon Sep 17 00:00:00 2001 From: Ben Stein Date: Wed, 7 Dec 2022 14:24:53 -0500 Subject: [PATCH 1/2] Correct how day 1 score is computed in the Cubescore endpoint. --- .../Features/CubespaceScoreboard/CubespaceScoreboardService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gameboard.Api/Features/CubespaceScoreboard/CubespaceScoreboardService.cs b/src/Gameboard.Api/Features/CubespaceScoreboard/CubespaceScoreboardService.cs index 9b982202..f316ad4a 100644 --- a/src/Gameboard.Api/Features/CubespaceScoreboard/CubespaceScoreboardService.cs +++ b/src/Gameboard.Api/Features/CubespaceScoreboard/CubespaceScoreboardService.cs @@ -66,7 +66,7 @@ public async Task GetScoreboard(CubespaceScoreboardReq { Id = p.TeamId, // ignore name for now - we'll resolve it later - Day1Score = Math.Floor(p.Challenges.Sum(c => c.Score)), + Day1Score = p.Score, Day1Playtime = p.Time }) .DistinctBy(team => team.Id) From 807c3b57e5d64e87c65c0a65de48566f934f822b Mon Sep 17 00:00:00 2001 From: Ben Stein Date: Wed, 7 Dec 2022 15:59:04 -0500 Subject: [PATCH 2/2] Remove unnecessary data sent to client. --- .../Features/UnityGames/UnityGameController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs b/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs index faa9cf84..88eed4e0 100644 --- a/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs +++ b/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs @@ -123,7 +123,7 @@ public async Task UndeployUnitySpace([FromQuery] string gid, [FromRoute] /// ChallengeEvent [Authorize] [HttpPost("api/unity/challenge")] - public async Task CreateChallenge([FromBody] NewUnityChallenge model) + public async Task CreateChallenge([FromBody] NewUnityChallenge model) { AuthorizeAny( () => _gameService.UserIsTeamPlayer(Actor.Id, model.GameId, model.TeamId).Result @@ -144,7 +144,7 @@ public async Task UndeployUnitySpace([FromQuery] string gid, [FromRoute] challengeData = await _unityGameService.HasChallengeData(model); if (challengeData != null) { - return challengeData; + return Accepted(); } // otherwise, add new challenge data and send gamebrain the ids of the consoles (which are based on the challenge id) @@ -190,8 +190,8 @@ public async Task UndeployUnitySpace([FromQuery] string gid, [FromRoute] await _hub.Clients .Group(model.TeamId) .ChallengeEvent(new HubEvent(_mapper.Map(challengeData), EventAction.Updated)); - - return challengeData; + + return Ok(); } [HttpPost("api/unity/mission-update")]