diff --git a/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs b/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs index 33a3c65f..85a04f24 100644 --- a/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs +++ b/src/Gameboard.Api/Features/UnityGames/UnityGameController.cs @@ -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; @@ -41,7 +40,6 @@ public UnityGameController( UnityGamesValidator validator, // other stuff ConsoleActorMap actorMap, - CoreOptions appSettings, GameService gameService, IHttpClientFactory httpClientFactory, IUnityGameService unityGameService, @@ -51,7 +49,6 @@ IMapper mapper ) : base(logger, cache, validator) { _actorMap = actorMap; - _appSettings = appSettings; _gameService = gameService; _httpClientFactory = httpClientFactory; _hub = hub; @@ -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 GetGamespace([FromRoute] string gid, [FromRoute] string tid) @@ -146,7 +136,7 @@ public async Task 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 diff --git a/src/Gameboard.Api/Features/UnityGames/UnityGameService.cs b/src/Gameboard.Api/Features/UnityGames/UnityGameService.cs index 4c5f6b5b..6b016279 100644 --- a/src/Gameboard.Api/Features/UnityGames/UnityGameService.cs +++ b/src/Gameboard.Api/Features/UnityGames/UnityGameService.cs @@ -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,