Skip to content

Commit

Permalink
Merge pull request #65 from cmu-sei/next
Browse files Browse the repository at this point in the history
Synchronize Unity challenge ID with TopoMojo gamespace
  • Loading branch information
sei-mkaar authored Nov 10, 2022
2 parents 082cbc3 + 2b2f23c commit 003613e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/Gameboard.Api/Features/UnityGames/UnityGameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace Gameboard.Api.Controllers;
[Authorize]
public class UnityGameController : _Controller
{
private readonly CoreOptions _appSettings;
private readonly ConsoleActorMap _actorMap;
private readonly GameService _gameService;
private readonly IHttpClientFactory _httpClientFactory;
Expand All @@ -41,7 +40,6 @@ public UnityGameController(
UnityGamesValidator validator,
// other stuff
ConsoleActorMap actorMap,
CoreOptions appSettings,
GameService gameService,
IHttpClientFactory httpClientFactory,
IUnityGameService unityGameService,
Expand All @@ -51,7 +49,6 @@ IMapper mapper
) : base(logger, cache, validator)
{
_actorMap = actorMap;
_appSettings = appSettings;
_gameService = gameService;
_httpClientFactory = httpClientFactory;
_hub = hub;
Expand All @@ -60,13 +57,6 @@ IMapper mapper
_unityGameService = unityGameService;
}

[HttpGet("/api/unity")]
[AllowAnonymous]
public IActionResult Hi()
{
return Ok(_appSettings.GameEngineUrl + " " + Request.GetTypedHeaders().Referer.ToString());
}

[HttpGet("/api/unity/{gid}/{tid}")]
[Authorize]
public async Task<IActionResult> GetGamespace([FromRoute] string gid, [FromRoute] string tid)
Expand Down Expand Up @@ -146,7 +136,7 @@ public async Task<string> UndeployUnitySpace([FromQuery] string gid, [FromRoute]

var vmData = model.Vms.Select(vm =>
{
var consoleHost = new UriBuilder(Request.Scheme, Request.Host.Host, Request.Host.Port ?? -1, "test/gb/mks");
var consoleHost = new UriBuilder(Request.Scheme, Request.Host.Host, Request.Host.Port ?? -1, $"{Request.PathBase}/mks");
consoleHost.Query = $"f=1&s={result.Id}&v={vm.Name}";
return new UnityGameVm
Expand Down
2 changes: 1 addition & 1 deletion src/Gameboard.Api/Features/UnityGames/UnityGameService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ConsoleActorMap actorMap

var newChallengeEntity = new Data.Challenge
{
Id = Guid.NewGuid().ToString("n"),
Id = newChallenge.GamespaceId,
Name = $"{teamCaptain.ApprovedName} vs. Cubespace",
GameId = challengeSpec.GameId,
TeamId = newChallenge.TeamId,
Expand Down

0 comments on commit 003613e

Please sign in to comment.