biqqles / flint

A parser and API for Freelancer and its formats
https://github.com/biqqles/flint/wiki
Mozilla Public License 2.0
8 stars 2 forks source link

Flint doesn't get commodity price info from installed plugins. #8

Open jmonty42 opened 1 year ago

jmonty42 commented 1 year ago

I'm using Discovery 4.91.0 and I noticed that Flint isn't aware of configurations set in installed plugins. For example, inspecting the base entity for LI09_08_base, it says the buy price of commodity_outcast is 10000. However, there is a server side plugin with a config file at EXE\flhook_plugins\prices.cfg that overrides that buy price for that station to 45000.

This can be easily reproduced with a local server running this version and checking in game that the station buys this commodity for the price in the prices.cfg file and not what Flint reports.

There's a lot of different files in the flhooks_plugins folder that I'm sure affect the game state that is likely not being picked up by Flint.

biqqles commented 1 year ago

Yes, I know of this issue. There are two ways it can be solved. One requires the cooperation of the server, specifically Alex would have to set up some method to allow programs to access to the server config (the local files that are installed in the plugins directory very much does not match it). The other way to do it is what FLCompanion does, and cleverly access the internal game structures to get exact price data. I worked on implementing this functionality in flair for a bit but don't remember how far I got (probably not very).

The code by which FLCompanion does the latter is here. In theory someone who is sufficiently motivated could pretty much translate that into Python code using flair (and my other library deconstruct to implement the structs) and it should™ work.

jmonty42 commented 1 year ago

Ah, my comment was mostly from the scenario of having access to the server side files like if you're running a private server. But for accessing information that you may not have direct access to as a client it would make sense to try to go the same route that FLCompanion does.