Ejemplo n.º 1
0
        private void ReceiveGameState(IAsyncResult result)
        {
            try
            {
                HttpListenerContext context = portListener.EndGetContext(result);
                HttpListenerRequest request = context.Request;
                string JSON;

                waitForConnection.Set();

                using (Stream inputStream = request.InputStream)
                {
                    using (StreamReader sr = new StreamReader(inputStream))
                        JSON = sr.ReadToEnd();
                }
                using (HttpListenerResponse response = context.Response)
                {
                    response.StatusCode        = (int)HttpStatusCode.OK;
                    response.StatusDescription = "OK";
                    response.Close();
                }
                CurrentGameState = new CurrentGameStateService(JSON);
            }
            catch (ObjectDisposedException)
            {
                // Intentionally left blank, when the Listener is closed.
            }
        }
Ejemplo n.º 2
0
        private void OnNewGameState(CurrentGameStateService gs)
        {
            CurrentGameViewModel currentGameViewModel = new CurrentGameViewModel(gs);

            CurrentMatchInfo = currentGameViewModel.CurrentMatchInfo;
        }
Ejemplo n.º 3
0
 private void OnNewGameState(CurrentGameStateService gs)
 {
     PreGameViewModel = new PreGameViewModel(cache, gs);
     check            = true;
 }