Register to handle strings with given version character
Posted: Fri Jun 16, 2017 8:39 pm
Request spurred by the following IRC conversation:
I would like to be able to register for a callback when a data string is pasted in the blueprint import box with a given version character, with either the raw string or the data table it contains as data on the callback. This would simplify import/export of data for mods using item-with-tags, like my DISK mod. Ideally, game would handle the encoding/decoding, since that will result in more consistent data-string if more mods use this facility.IRC wrote: <KomanBryce> justarandomgeek: do you have a link to anything about the blueprint format?
<KomanBryce> e.g. utilities for read/writing it
<justarandomgeek> it's "0" + base64(deflate(json))
<justarandomgeek> older ones are base64(gzip(serpent))
<justarandomgeek> and disk uses a bastard mix of the two, base64(gzip(json))
<@HanziQ> y u no version byte
<justarandomgeek> what version byte should i use for it?
<justarandomgeek> other than not-"0"
<justarandomgeek> it seems wrong for me to use 1, because then you guys have to skip a number one day
<@HanziQ> just use something
<@HanziQ> d
<@HanziQ> j
<@HanziQ> whatever
<@HanziQ> make it distinguishable
<@HanziQ> that's why it's there
<justarandomgeek> and the lack of documentation around the string format makes the intent unclear
<justarandomgeek> i'll update it to use d or D then
<justarandomgeek> would be nice if a mod could register to handle strings pasted with a given version char
<@HanziQ> interesting idea
<justarandomgeek> and get either the string or the json object it contains in game-standard version+base64(deflate(data))
<justarandomgeek> i guess i need to talk to Rseding91|P about that, huh?
<@HanziQ> most likely