EDCD / EDDI

Companion application for Elite Dangerous
Other
440 stars 81 forks source link

Enhance carrier tracking and event handling? #1828

Closed Tkael closed 1 year ago

Tkael commented 4 years ago

CAPI carrier output from the /fleetcarrier endpoint: https://paste.fuelrats.com/ocazikofab.py

{
    'name': {
        'callsign': 'F40-X5J',
        'vanityName': '414353204445534f4c4154494f4e',
        'filteredVanityName': '414353204445534f4c4154494f4e'
    },
    'currentStarSystem': 'Wredguia QR-N d6-48',
    'balance': '-5283094',
    'fuel': '380',
    'state': 'debtState',
    'theme': 'Explorer',
    'dockingAccess': 'all',
    'notoriousAccess': False,
    'capacity': {
        'shipPacks': 1850,
        'modulePacks': 155,
        'cargoForSale': 34,
        'cargoNotForSale': 4,
        'cargoSpaceReserved': 0,
        'crew': 5800,
        'freeSpace': 17157
    },
    'itinerary': {
        'completed': [{
            'departureTime': '2020-05-11 12:47:28',
            'arrivalTime': '2020-05-11 11:38:54',
            'state': 'success',
            'visitDurationSeconds': 4114,
            'starsystem': 'Skeggiko O'
        }, {
            'departureTime': '2020-05-11 17:57:19',
            'arrivalTime': '2020-05-11 12:47:28',
            'state': 'success',
            'visitDurationSeconds': 18591,
            'starsystem': 'Arexe'
        }, {
            'departureTime': '2020-05-12 12:43:57',
            'arrivalTime': '2020-05-11 17:57:19',
            'state': 'success',
            'visitDurationSeconds': 67598,
            'starsystem': 'Fuelum'
        }, {
            'departureTime': '2020-05-12 14:47:51',
            'arrivalTime': '2020-05-12 12:43:57',
            'state': 'success',
            'visitDurationSeconds': 7434,
            'starsystem': 'Wredguia HC-U b30-5'
        }, {
            'departureTime': None,
            'arrivalTime': '2020-05-12 14:47:51',
            'state': 'success',
            'visitDurationSeconds': 2073180,
            'starsystem': 'Wredguia QR-N d6-48'
        }],
        'totalDistanceJumpedLY': 712,
        'currentJump': None
    },
    'marketFinances': {
        'cargoTotalValue': 0,
        'allTimeProfit': 0,
        'numCommodsForSale': 4,
        'numCommodsPurchaseOrders': 0,
        'balanceAllocForPurchaseOrders': 0
    },
    'blackmarketFinances': {
        'cargoTotalValue': 0,
        'allTimeProfit': 0,
        'numCommodsForSale': 0,
        'numCommodsPurchaseOrders': 0,
        'balanceAllocForPurchaseOrders': 0
    },
    'finance': {
        'bankBalance': -5283094,
        'bankReservedBalance': 0,
        'taxation': 15,
        'numServices': 9,
        'numOptionalServices': 1,
        'debtThreshold': ,
        'maintenance': 11242911,
        'maintenanceToDate': 6171514,
        'coreCost': 5000000,
        'servicesCost': 6242911,
        'servicesCostToDate': 1171514,
        'jumpsCost': 0,
        'numJumps': 0
    },
    'servicesCrew': {
        'refuel': {
            'crewMember': {
                'name': 'Rachelle Cummings',
                'gender': 'F',
                'enabled': 'NO',
                'faction': 'federation',
                'salary': 750000,
                'avatarStr': None,
                'lastEdit': '2020-06-04 07:11:26'
            },
            'invoicesWeekToDate': [{
                'wages': 140581,
                'from': '2020-06-04 07:11:26',
                'until': '2020-06-05 14:40:50',
                'type': 'current'
            }, {
                'wages': 749149,
                'from': '2020-06-05 14:40:50',
                'until': '2020-06-11 07:00:00',
                'type': 'expected'
            }],
            'status': 'debtState'
        },
        'repair': {
            'crewMember': {
                'name': 'Raleigh Tucker',
                'gender': 'M',
                'enabled': 'NO',
                'faction': 'federation',
                'salary': 750000,
                'avatarStr': None,
                'lastEdit': '2020-06-04 07:11:26'
            },
            'invoicesWeekToDate': [{
                'wages': 140581,
                'from': '2020-06-04 07:11:26',
                'until': '2020-06-05 14:40:50',
                'type': 'current'
            }, {
                'wages': 749149,
                'from': '2020-06-05 14:40:50',
                'until': '2020-06-11 07:00:00',
                'type': 'expected'
            }],
            'status': 'debtState'
        },
        'rearm': {
            'crewMember': {
                'name': 'Caylee Waller',
                'gender': 'F',
                'enabled': 'NO',
                'faction': 'federation',
                'salary': 750000,
                'avatarStr': None,
                'lastEdit': '2020-06-04 07:11:26'
            },
            'invoicesWeekToDate': [{
                'wages': 140581,
                'from': '2020-06-04 07:11:26',
                'until': '2020-06-05 14:40:50',
                'type': 'current'
            }, {
                'wages': 749149,
                'from': '2020-06-05 14:40:50',
                'until': '2020-06-11 07:00:00',
                'type': 'expected'
            }],
            'status': 'debtState'
        },
        'shipyard': {
            'crewMember': {
                'name': 'Emilee Wilkinson',
                'gender': 'F',
                'enabled': 'NO',
                'faction': 'federation',
                'salary': 1800000,
                'avatarStr': None,
                'lastEdit': '2020-06-04 07:11:26'
            },
            'invoicesWeekToDate': [{
                'wages': 337395,
                'from': '2020-06-04 07:11:26',
                'until': '2020-06-05 14:40:50',
                'type': 'current'
            }, {
                'wages': 1797958,
                'from': '2020-06-05 14:40:50',
                'until': '2020-06-11 07:00:00',
                'type': 'expected'
            }],
            'status': 'debtState'
        },
        'outfitting': {
            'crewMember': {
                'name': 'Joshua Rojas',
                'gender': 'M',
                'enabled': 'NO',
                'faction': 'federation',
                'salary': 1500000,
                'avatarStr': None,
                'lastEdit': '2020-06-04 07:11:26'
            },
            'invoicesWeekToDate': [{
                'wages': 281163,
                'from': '2020-06-04 07:11:26',
                'until': '2020-06-05 14:40:50',
                'type': 'current'
            }, {
                'wages': 1498298,
                'from': '2020-06-05 14:40:50',
                'until': '2020-06-11 07:00:00',
                'type': 'expected'
            }],
            'status': 'debtState'
        },
        'exploration': {
            'crewMember': {
                'name': 'Sung Kemp',
                'gender': 'M',
                'enabled': 'NO',
                'faction': 'federation',
                'salary': 700000,
                'avatarStr': None,
                'lastEdit': '2020-06-04 07:11:26'
            },
            'invoicesWeekToDate': [{
                'wages': 131209,
                'from': '2020-06-04 07:11:26',
                'until': '2020-06-05 14:40:50',
                'type': 'current'
            }, {
                'wages': 699206,
                'from': '2020-06-05 14:40:50',
                'until': '2020-06-11 07:00:00',
                'type': 'expected'
            }],
            'status': 'debtState'
        }
    },
    'cargo': [{
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Lowtemperaturediamond',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Low Temperature Diamonds'
    }, {
        'commodity': 'Lowtemperaturediamond',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Low Temperature Diamonds'
    }, {
        'commodity': 'Hydrogenperoxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Hydrogen Peroxide'
    }, {
        'commodity': 'Hydrogenperoxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Hydrogen Peroxide'
    }, {
        'commodity': 'Bromellite',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Bromellite'
    }, {
        'commodity': 'Bromellite',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Bromellite'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Water',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Water'
    }, {
        'commodity': 'Hydrogenperoxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Hydrogen Peroxide'
    }, {
        'commodity': 'Hydrogenperoxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Hydrogen Peroxide'
    }, {
        'commodity': 'Bromellite',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Bromellite'
    }, {
        'commodity': 'Bromellite',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Bromellite'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }, {
        'commodity': 'Lithiumhydroxide',
        'mission': False,
        'qty': 1,
        'value': 0,
        'stolen': False,
        'locName': 'Lithium Hydroxide'
    }],
    'reputation': [{
        'majorFaction': 'empire',
        'score': 100
    }, {
        'majorFaction': 'federation',
        'score': 100
    }, {
        'majorFaction': 'independent',
        'score': 100
    }, {
        'majorFaction': 'alliance',
        'score': 100
    }],
    'market': {
        'id': 3700019200,
        'name': 'F40-X5J',
        'outpostType': 'fleetcarrier',
        'imported': [],
        'exported': [],
        'services': {
            'commodities': 'ok',
            'carrierfuel': 'ok',
            'refuel': 'debtState',
            'repair': 'debtState',
            'rearm': 'debtState',
            'shipyard': 'debtState',
            'outfitting': 'debtState',
            'blackmarket': 'unavailable',
            'voucherredemption': 'unavailable',
            'exploration': 'debtState',
            'carriermanagement': 'ok',
            'stationmenu': 'ok',
            'dock': 'ok',
            'crewlounge': 'ok',
            'contacts': 'ok',
            'engineer': 'ok'
        },
        'economies': {
            '136': {
                'name': 'Carrier',
                'proportion': 1
            }
        },
        'prohibited': [],
        'commodities': [{
            'id': 128049166,
            'categoryname': 'Chemicals',
            'name': 'Water',
            'stock': 12,
            'buyPrice': 1550,
            'sellPrice': 0,
            'demand': 0,
            'legality': '',
            'meanPrice': 0,
            'demandBracket': '',
            'stockBracket': 2,
            'locName': 'Water'
        }, {
            'id': 128673846,
            'categoryname': 'Minerals',
            'name': 'Bromellite',
            'stock': 4,
            'buyPrice': 39201,
            'sellPrice': 0,
            'demand': 0,
            'legality': '',
            'meanPrice': 0,
            'demandBracket': '',
            'stockBracket': 2,
            'locName': 'Bromellite'
        }, {
            'id': 128673853,
            'categoryname': 'Minerals',
            'name': 'LithiumHydroxide',
            'stock': 16,
            'buyPrice': 11304,
            'sellPrice': 0,
            'demand': 0,
            'legality': '',
            'meanPrice': 0,
            'demandBracket': '',
            'stockBracket': 2,
            'locName': 'Lithium Hydroxide'
        }, {
            'id': 128673848,
            'categoryname': 'Minerals',
            'name': 'LowTemperatureDiamond',
            'stock': 2,
            'buyPrice': 229893,
            'sellPrice': 0,
            'demand': 0,
            'legality': '',
            'meanPrice': 0,
            'demandBracket': '',
            'stockBracket': 2,
            'locName': 'Low Temperature Diamonds'
        }, {
            'id': 128066403,
            'categoryname': 'NonMarketable',
            'name': 'Drones',
            'stock': 999999,
            'buyPrice': 101,
            'sellPrice': 101,
            'demand': 9999999,
            'legality': '',
            'meanPrice': 101,
            'demandBracket': 2,
            'stockBracket': 2,
            'locName': 'Limpet'
        }]
    },
    'ships': {
        'shipyard_list': {
            'Hauler': {
                'id': 128049261,
                'name': 'Hauler',
                'basevalue': 52720,
                'sku': '',
                'stock': 15
            },
            'Adder': {
                'id': 128049267,
                'name': 'Adder',
                'basevalue': 87808,
                'sku': '',
                'stock': 10
            }
        }
    },
    'modules': {
        '128049526': {
            'id': 128049526,
            'category': 'utility',
            'name': 'Hpt_MiningLaser_Fixed_Medium',
            'cost': 22576,
            'sku': None,
            'stock': 20
        },
        '128740819': {
            'id': 128740819,
            'category': 'utility',
            'name': 'Hpt_MiningLaser_Turret_Small',
            'cost': 9400,
            'sku': None,
            'stock': 5
        },
        '128740820': {
            'id': 128740820,
            'category': 'utility',
            'name': 'Hpt_MiningLaser_Turret_Medium',
            'cost': 32576,
            'sku': None,
            'stock': 15
        },
        '128915456': {
            'id': 128915456,
            'category': 'utility',
            'name': 'Hpt_Mining_SubSurfDispMisle_Fixed_Medium',
            'cost': 122170,
            'sku': None,
            'stock': 10
        },
        '128915457': {
            'id': 128915457,
            'category': 'utility',
            'name': 'Hpt_Mining_SubSurfDispMisle_Turret_Medium',
            'cost': 381750,
            'sku': None,
            'stock': 5
        },
        '128915458': {
            'id': 128915458,
            'category': 'utility',
            'name': 'Hpt_Mining_AbrBlstr_Fixed_Small',
            'cost': 9700,
            'sku': None,
            'stock': 5
        },
        '128915459': {
            'id': 128915459,
            'category': 'utility',
            'name': 'Hpt_Mining_AbrBlstr_Turret_Small',
            'cost': 27480,
            'sku': None,
            'stock': 15
        },
        '128915460': {
            'id': 128915460,
            'category': 'utility',
            'name': 'Hpt_Mining_SeismChrgWarhd_Fixed_Medium',
            'cost': 153110,
            'sku': None,
            'stock': 5
        },
        '128915461': {
            'id': 128915461,
            'category': 'utility',
            'name': 'Hpt_Mining_SeismChrgWarhd_Turret_Medium',
            'cost': 445570,
            'sku': None,
            'stock': 10
        }
    }
}
Tkael commented 3 years ago

We can create a carrier object and update it from the events and CAPI endpoint to help carrier owners track their carrier.

Tkael commented 3 years ago

This endpoint also gives a ready reference for the current location of the carrier.

Tkael commented 1 year ago

This is a new feature that shall be included in version 4.0.2.

Tkael commented 1 year ago

Resolved by 70731c540a54c1d68f1d5cffd72b515f5615cd47