Page 1 of 1
Entire system data to MySQL database
Posted: Tue Nov 14, 2017 12:49 pm
by pleiadian
So I just finished what I wanted to do quite some time ago. I created a PHP script aiding you in the fantastic task of inserting Oolite's entire solar system information (planetinfo.plist) into a MySQL database of your choosing.
I'm sure this opens the door to quite some interesting 3rd party web-based tool creation possibilities.
Here it is:
https://github.com/thepleiadian/convert_planetinfo
The repo contains the current planetinfo.plist as well as a .sql file of the finished result.
Obviously open-sourced. Enjoy!
// EDIT:
I know the script is not perfect, but probably a good starting point. The defaults are - database: oolite_data, table: oolite_maps
Re: Entire system data to MySQL database
Posted: Wed Nov 15, 2017 12:44 pm
by pleiadian
Updated the script so that each solar system now has a unique ID. This might be useful for other tools such as trade, or item databases. GitHub includes updated script and new version of the SQL-file.
Re: Entire system data to MySQL database
Posted: Wed Nov 15, 2017 1:31 pm
by another_commander
I think that what might be useful here could be the ability to re-export the SQL file as a planetinfo.plist, after changes have been applied. This could help with changing large chunks of the plist or per-system-specific changes. One could use database software to make queries and maybe changes, then export back the result to a format understandable by Oolite. An example could be the relatively recent change where we reduced the default ambient light in all systems to 0.25. I had to write a quick'n'dirty little program to do it, but that could have been handled maybe as described above.
Possible?
Re: Entire system data to MySQL database
Posted: Wed Nov 15, 2017 2:09 pm
by pleiadian
That shouldn't present too much of a problem. Simply perform the changes in the SQL DB, and then hit the button... I think I can manage that
Re: Entire system data to MySQL database
Posted: Mon Nov 20, 2017 10:14 am
by pleiadian
I have added a script that does what you asked for. It pumps out a valid planetinfo.plist file inside your browser... just save it as that file and you're good to go.
https://github.com/thepleiadian/convert ... _plist.php
Re: Entire system data to MySQL database
Posted: Mon Nov 20, 2017 1:36 pm
by another_commander
Can't test it right now, but thanks for doing that. It should hopefully make editing of the tricky planetinfo datafile much easier.