Esempio n. 1
0
        private async void CountdownToNewGame()
        {
            await Clients.All.SendAsync("ReceiveMessage", "GAME_RESTARTING", "WE HAVE A WINNER, CORRECT ANSWER WAS: " + CurrentGame.currentEquation.GetResult());

            int seconds = 5;

            for (; seconds >= 0; seconds--)
            {
                await Clients.All.SendAsync("ReceiveMessage", "GAME", "SERVER: " + seconds);

                Thread.Sleep(1000);
            }
            CurrentGame.StartNewGame();

            await Clients.All.SendAsync("Equation", CurrentGame.GetCurrentEquation());
        }
Esempio n. 2
0
 public async Task GetCurrentGame()
 {
     await Clients.Caller.SendAsync("Equation", CurrentGame.GetCurrentEquation());
 }