eyeonus / Trade-Dangerous

Mozilla Public License 2.0
97 stars 31 forks source link

Additional Argument and Larger Capacity for the use of Fleet Carriers? #89

Closed Thecat8413 closed 1 year ago

Thecat8413 commented 3 years ago

Is there any way to make the following changes:

  1. Allow For Capacities of up to 25,000?

  2. Set a Restriction of non-permit locked systems?

I understand that the amount of data this would require has the potential to take an insane amount of time. That said, I would happily leave this running on my server for a while to come back to.

eyeonus commented 3 years ago
  1. Technically easy to fix. Practically... the test is still ongoing.
  2. Possible, would require adding the 'needs-permit' field to the System table in the sql template file, adding the variable to the relevant sub-commands including update plugins, and updating those commands to use it. It's basically the same thing I did to add the fleet-carrier option, so not hard, but time-consuming to implement. You're invited to PR this, as it's mostly copy/paste/rename for most of the work.
eyeonus commented 3 years ago
  1. You asked for it. It's a horrible idea, but you got it, fresh off the push.
Thecat8413 commented 3 years ago

Thank you! Seriously, this is awesome.

Regarding 2, I'll have some time to maybe take a look at it next week. Are there any other commits (or other resources) I should look at besides 339b2af before I start poking things?

eyeonus commented 3 years ago

As far as commits, not really.

The sql that needs to be edited to add the field (using this as copy-pasta) to the System table is in the templates folder.

After making the edit to the sql, reloadCache needs to be run so that the new field actually gets put into the table.

The import command and the import plugins need to have code added to import that field into the database. (To be honest, other than eddblink and possibly edmc_batch, it's unlikely any of the plugins are used often enough to matter if they aren't updated.)

For eddblink, the import file is [td]/data/eddb/systems_populated.jsonl, the importSystems method is the one that needs editing, permit = 'Y' if system['needs_permit'] else 'N' and then add ' permit,' wherever you see ' pos_z,' in that method.

For the other plugins, it depends on whether the source used by that plugin (,i.e. EDMC prices files for the edmc_batch plugin,) has the needed information.

Don't forget to test both importing and using the argument to make sure it works as expected, and then send me a Pull Request.