예제 #1
0
        public async Task <string> CreateGameSession(string nickName)
        {
            var sessionKey = _sessionService.CreateNewGameSession();

            _sessionService.GameSessions[sessionKey].AddPlayer(nickName);

            await Groups.AddToGroupAsync(this.Context.ConnectionId, sessionKey);

            return(sessionKey);
        }
예제 #2
0
        public async Task <string> CreateGameSession(string nickName)
        {
            var sessionKey = _sessionService.CreateNewGameSession();

            _sessionService.GameSessions[sessionKey].AddPlayer(nickName);

            _logger.LogInformation("STRESSEVENT: Game session created by '{0}'. Key '{1}'.", nickName, sessionKey);

            await Groups.AddToGroupAsync(this.Context.ConnectionId, sessionKey);

            return(sessionKey);
        }