public MatchPatternPresentation GetMatchFor(Match match) { var request = new NewMatchRequest { DataToMatch = match, UserKey = _baseServiceFacade.UserKey }; return(GetAMatchFor(match, _demoClientProxy.GetData(request))); }
public async Task <IActionResult> NewMatch([FromBody] NewMatchRequest request) { var accountId = long.Parse(HttpContext.User.Claims.FirstOrDefault(x => x.Type == "sub")?.Value); var matchId = Guid.NewGuid().ToString(); var playerGrain = _clusterClient.GetGrain <IPlayerGrain>(accountId); var playerInfo = await playerGrain.GetPlayerInfo(); await _matchRoomService.NewMatchRoom( matchId, accountId, GetFullName(playerInfo.FirstName, playerInfo.LastName)); return(Ok(new { Id = matchId })); }
public void RestartConversation(Match match) { var request = new NewMatchRequest { UserKey = _baseServiceFacade.UserKey, DataToMatch = match }; var response = _converseClientProxy.RestartConversation(request); if (response.UserKey != _baseServiceFacade.UserKey) { HttpContext.Current.Session["UserKey"] = response.UserKey; } }
public ConversationData UpdateConversation(Match match) { var request = new NewMatchRequest { UserKey = _baseServiceFacade.UserKey, DataToMatch = match }; var response = _converseClientProxy.GetConversationData(request); if (response.UserKey != _baseServiceFacade.UserKey) { HttpContext.Current.Session["UserKey"] = response.UserKey; } return(response.Conversation); }
public NewMatchResponse PostNew(NewMatchRequest newMatchRequest) { return(new NewMatchResponse { Gameboard = new Gameboard( ), MatchId = Guid.NewGuid( ), CurrentPlayer = PlayerNumber.PlayerOne, GameMode = newMatchRequest.GameMode, Players = new List <Player> { new Player(1, newMatchRequest.PlayerOneName), new Player(2, newMatchRequest.PlayerTwoName) } }); }
public ConverseResponse RestartConversation(NewMatchRequest request) { return(Channel.RestartConversation(request)); }
public ConverseResponse GetContext(NewMatchRequest request) { return(Channel.GetContext(request)); }
public ConverseResponse GetConversationData(NewMatchRequest request) { return(Channel.GetConversationData(request)); }
public NewMatchResponse GetData(NewMatchRequest usePatternRequest) { return(Channel.GetData(usePatternRequest)); }