예제 #1
0
        private void RaiseGameEvent(string jsonString)
        {
            try
            {
                TimeOfLastRadarGameEventOrHeartbeat = DateTime.Now;
                bool         isHeartbeat  = jsonString.Contains("heartbeat");
                NbaGameEvent mlbGameEvent = null;

                if (isHeartbeat)
                {
#if DEBUG
                    Logger.Info("Radar heartbeat");
#endif
                }

                if (!isHeartbeat)
                {
                    Logger.Info(jsonString);
                    mlbGameEvent = NbaGameEvent.FromJson(jsonString);
                }

                bool isGameEvent = mlbGameEvent != null;

                if (isGameEvent)
                {
                    NbaGameEventEventArgs nbaGameEventEventArgs = new NbaGameEventEventArgs
                    {
                        GameEvent = mlbGameEvent
                    };
                    OnRadarGameEvent(nbaGameEventEventArgs);
                }
            }
            catch (Exception e)
            {
                Logger.Info(e);
            }
        }
예제 #2
0
 private void OnRadarGameEvent(NbaGameEventEventArgs nbaGameEventEventArgs)
 {
     RadarGameEvent?.Invoke(this, nbaGameEventEventArgs);
 }