コード例 #1
0
ファイル: GamesHub.cs プロジェクト: thedevpunk/der-kartograph
        public async Task CreateGame(string playerId)
        {
            _connectionStore.Add(playerId, Context.ConnectionId);

            Game game = _gameRepo.Create();

            _gameRepo.AddPlayer(game.Id, playerId);

            var options = new JsonSerializerOptions {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            };

            await Clients.Caller.ReceiveGameIsCreated(game);
        }
コード例 #2
0
        public async Task Subscribe(string userId)
        {
            _connectionStore.Add(userId, Context.ConnectionId);

            await Clients.Caller.ReiveiceConnected(userId);
        }