PDA

View Full Version : DB.import, how safe is it?



SilentRuin
June 25th, 2020, 18:39
DB.Import (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4063529/DB), how safe is it to use? I for sure would have no qualms just using it myself in an extension I used for myself.

But how safe is it to use in an extension sent out into the masses? My worries are how to validate the data - or my responsibility in validating the data that is pushed into a record of the DB.

Whats the accepted practice when filling in data from an external source into the DB?

Granted its only one node - I just don't want to provide a tool to put endless garbage in or something. Or is that just a risk in the game?

I only see character sheets being imported - way more complex than what I need to import.

SilentRuin
June 25th, 2020, 21:57
Well as I've finished implementing it fully - I suppose I'll just assume they are loading relevant data, like I know I do.

Moon Wizard
June 26th, 2020, 01:18
If the data is not in a FG data format (i.e. "root" node; and data fields defined as FG expects); then any other XML would be ignored. So, there is always the caveat that you should provide with any extension that you share with people, which format the XML data must be in to be imported and used.

Regards,
JPG

Moon Wizard
June 26th, 2020, 01:20
Also, DB.import does not require any specific format; so technically you could import a NPC record into the PC record area (as an example). This means that if you want to provide validation, you would need to do that in your scripts after the import completes.

Regards,
JPG

SilentRuin
June 26th, 2020, 01:26
Also, DB.import does not require any specific format; so technically you could import a NPC record into the PC record area (as an example). This means that if you want to provide validation, you would need to do that in your scripts after the import completes.

Regards,
JPG

Eek - after the import has imported? I'll just play the game everyone else does and assume the XML file limitation and the expected nodes are all that is required. Seemed clean and simple when I used the Interface to open/save generate me a chosen file to import or export so will stick with that. Thanks for the explanation.