EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
988 stars 155 forks source link

Incorrect horizons flag in EDDN messages from CAPI updates #2277

Open HansAcker opened 1 month ago

HansAcker commented 1 month ago

Please complete the following information:

Commodity market updates from CAPI in Live-Horizons in some cases produce messages with horizons: false, odyssey: false. Often seen at fleet carriers and planetary outposts, not at space stations.

It looks like capi_is_horizons() incorrectly returns false when a station offers no ships or modules and has no Colony economy? I don't quite follow the logic, tbh.

To Reproduce

  1. Log into Horizons (Live)
  2. Dock to a fleet carrier
  3. Often, this already produces a market message with horizons: false
  4. Re-log
  5. That reliably produces a Location message with horizons: true and a market update with horizons: false
  6. Updating market.json produces a message with the correct flags

Additional context

Messages after logging into Horizons while docked at a carrier. Location:

{
  "$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
  "header": {
    "gamebuild": "r303387/r0 ",
    "gameversion": "4.0.0.1807",
    "gatewayTimestamp": "2024-07-19T11:08:23.337637Z",
    "softwareName": "E:D Market Connector [Windows]",
    "softwareVersion": "5.11.2",
    "uploaderID": "a4b7fa87b574c8ec74ab6b0ac45ab9a6eebbebb3"
  },
  "message": {
...
    "StationEconomies": [
      {
        "Name": "$economy_Carrier;",
        "Proportion": 1
      }
    ],
...
    "StationName": "H7B-B1M",
    "StationServices": [
      "dock",
      "autodock",
      "commodities",
      "contacts",
      "exploration",
      "crewlounge",
      "rearm",
      "refuel",
      "repair",
      "engineer",
      "flightcontroller",
      "stationoperations",
      "stationMenu",
      "carriermanagement",
      "carrierfuel",
      "socialspace",
      "bartender",
      "vistagenomics"
    ],
    "StationType": "FleetCarrier",
...
    "Taxi": false,
    "event": "Location",
    "horizons": true,
    "odyssey": false,
    "timestamp": "2024-07-19T11:08:22Z"
  }
}

Market update from CAPI with both flags set to false:

{
  "$schemaRef": "https://eddn.edcd.io/schemas/commodity/3",
  "header": {
    "gamebuild": "",
    "gameversion": "CAPI-Live-market",
    "gatewayTimestamp": "2024-07-19T11:08:29.271407Z",
    "softwareName": "E:D Market Connector [Windows]",
    "softwareVersion": "5.11.2",
    "uploaderID": "a4b7fa87b574c8ec74ab6b0ac45ab9a6eebbebb3"
  },
  "message": {
... 
   "horizons": false,
    "odyssey": false,
    "timestamp": "2024-07-19T11:08:28Z"
  }
}

Correct flags on event from local file:

{
  "$schemaRef": "https://eddn.edcd.io/schemas/commodity/3",
  "header": {
    "gamebuild": "r303387/r0 ",
    "gameversion": "4.0.0.1807",
    "gatewayTimestamp": "2024-07-19T11:10:12.475493Z",
    "softwareName": "E:D Market Connector [Windows]",
    "softwareVersion": "5.11.2",
    "uploaderID": "a4b7fa87b574c8ec74ab6b0ac45ab9a6eebbebb3"
  },
  "message": {
...
    "horizons": true,
    "odyssey": false,
    "timestamp": "2024-07-19T11:10:11Z"
  }
}

Market update at a station with shipyard and outfitting:

{
  "$schemaRef": "https://eddn.edcd.io/schemas/commodity/3",
  "header": {
    "gamebuild": "",
    "gameversion": "CAPI-Live-market",
    "gatewayTimestamp": "2024-07-19T11:49:07.196899Z",
    "softwareName": "E:D Market Connector [Windows]",
    "softwareVersion": "5.11.2",
    "uploaderID": "07cb70c2ad8eb4f2b0d920bb71fff83341a0308d"
  },
  "message": {
    "horizons": true,
    "odyssey": false,
    "stationName": "Sharp Dock",
    "systemName": "Andel",
    "timestamp": "2024-07-19T11:49:06Z"
  }
}

Please Confirm the Following...

klightspeed commented 1 month ago

It looks like capi_is_horizons wasn't updated for the universe split or for carriers. I wonder if there are any cases even in the legacy universe where someone can have no access to Horizons?