Ejemplo n.º 1
0
        private void GetGameVersionData(string eventType, IDictionary <string, object> data)
        {
            try
            {
                if (string.Equals("FileHeader", eventType, StringComparison.InvariantCultureIgnoreCase))
                {
                    gameVersion = JsonParsing.getString(data, "gameversion") ?? gameVersion;
                    gameBuild   = JsonParsing.getString(data, "build") ?? gameBuild;
                }

                if (string.Equals("LoadGame", eventType, StringComparison.InvariantCultureIgnoreCase) ||
                    string.Equals("Outfitting", eventType, StringComparison.InvariantCultureIgnoreCase) ||
                    string.Equals("Shipyard", eventType, StringComparison.InvariantCultureIgnoreCase))
                {
                    inHorizons = JsonParsing.getOptionalBool(data, "Horizons") ?? false;
                    inOdyssey  = JsonParsing.getOptionalBool(data, "Odyssey") ?? false;
                }
            }
            catch (Exception ex)
            {
                Logging.Error("Failed to parse Elite Dangerous version data for EDDN", ex);
            }
        }