예제 #1
0
        private void HandleUpdateRadarSettings(byte[] data)
        {
            try {
                Message <BlockAddress, RadarSettings> msg
                    = Message <BlockAddress, RadarSettings> .FromXML(data);

                if (msg == null)
                {
                    return;
                }

                _logger.debugLog($"Got radar settings update for {msg.Key}", "HandleUpdateRadarSettings");

                RadarController controller
                    = EWRegistry <RadarController> .Instance.Get(msg.Key);

                if (controller == null)
                {
                    return;                     // Controller not streamed to us
                }
                controller.UpdateRadarSettings(msg.Value);

                if (Helpers.IsServer)
                {
                    SendRadarSettings(msg.Key);
                }
            } catch (Exception e) {
                _logger.log(Logger.severity.ERROR, "HandleUpdateRadarSettings",
                            "Exception caught: " + e.ToString());
            }
        }