Esempio n. 1
0
        public MatchPatternPresentation GetMatchFor(Match match)
        {
            var request = new NewMatchRequest {
                DataToMatch = match, UserKey = _baseServiceFacade.UserKey
            };

            return(GetAMatchFor(match, _demoClientProxy.GetData(request)));
        }
Esempio n. 2
0
        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 }));
        }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 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));
 }
Esempio n. 9
0
 public NewMatchResponse GetData(NewMatchRequest usePatternRequest)
 {
     return(Channel.GetData(usePatternRequest));
 }