Example #1
0
        public GameDescriptor PutOneGame([FromBody] GameDescriptor descriptor)
        {
            GameDescriptor validatedDescriptor = new GameDescriptor(descriptor);

            lobbyHub.Clients.All.SendAsync("InformGameCreated", validatedDescriptor);
            return(GameAccessor.SaveGame(validatedDescriptor).Result);
        }
Example #2
0
 public async Task RequestGameCreation(GameDescriptor descriptor)
 {
     GameDescriptor validatedDescriptor = new GameDescriptor(descriptor);
     await Task.WhenAll(
         GameAccessor.SaveGame(validatedDescriptor),
         InformGameCreated(validatedDescriptor));
 }