Addon Property Storage API
Pheotis opened this issue ยท 3 comments
An API to allow add-ons to save and load their own gate properties to/from SG's database.
Possibly a new table?
This might be the harder option as it modifies existing tables, but we could add a data column in the Portal and PortalPosition table. So that would be a text type column, where other data is stored like a json string. This would behave very similarly to minecrafts metadata storage
It might also be a good idea to add the ability to add flags using the API, and to add a portalpositiontype. Don't know how necessary it is to remove stuff in this case, but if it's easy to implement, why not
So probably run statements like this:
ALTER TABLE PortalPosition
ADD data TEXT;
And
ALTER TABLE Portal
ADD data TEXT;
And have them inside a try/catch statement. This data should also be retrievable, and modifiable. Also does not matter if it's null.
Note that this has to take interserver databases into consideration as well
Format of those text should be like:
{DyeColor:"WHITE", AnimationsFile:"/plugins/StargateExtraColors/animations/animation1", textColor:"#000000", higlightColor:"#FFFFFF"}