ETS - EOS Text Storage - Solution for large save data
Posted: Sun May 24, 2020 7:06 pm
Hello tease creators,
I have come up with a solution to go around the storage limitations of EOS. The idea is to use a text or word file to store the data. So the user has to save the data himself on his computer.
The data is not easily editable so it is not easy for the average user to manipulate the savegame, but of course it is far from impossible. There are improvements possible to prevent more experienced user from cheating like adding a CRC check or a hash, but if you can manipulate the current system the chances are very high that you could also do that if there is a hash present. I created a small test so you can try it and tell me any bugfixes or improvements I should make.
ETS - EOS Text Storage Test
I could create multiple megabytes of data with it. But depending on your hardware it will take some time to export a lot of data. 10.000 values works fine without a noticeable delay for me. 100.000 will take some time though.
I published the code below if you want to use it in your own tease. Just paste it into your init script to use it.
I also added the EOS test as attachment so you can import this into EOS and see with examples on how to use it.
Documentation
etsSaveValue(key, value)
Saves a key with a value. The value can also be an object.
Example: etsSaveValue("name", "alex")
etsLoadValue(key, defaultValue)
Loads the value of a given key and returns it. If the key does not exists the key is created with the default value and the default value is returned.
Example 1: etsLoadValue("teaseDurationSec", 120);
Example 2: etsLoadValue("name", null);
etsExport()
Returns the string to be saved by the user.
etsImport(importString)
Imports the previously exported string and initializes the etsJsonObject.
Warning: This will delete the current saved data!
Returns null on success. On error a message of the error is returned.
Example: etsImport("##01D6D0==")
ETS version 1 - 24.05.2020 :
I have come up with a solution to go around the storage limitations of EOS. The idea is to use a text or word file to store the data. So the user has to save the data himself on his computer.
The data is not easily editable so it is not easy for the average user to manipulate the savegame, but of course it is far from impossible. There are improvements possible to prevent more experienced user from cheating like adding a CRC check or a hash, but if you can manipulate the current system the chances are very high that you could also do that if there is a hash present. I created a small test so you can try it and tell me any bugfixes or improvements I should make.
ETS - EOS Text Storage Test
I could create multiple megabytes of data with it. But depending on your hardware it will take some time to export a lot of data. 10.000 values works fine without a noticeable delay for me. 100.000 will take some time though.
I published the code below if you want to use it in your own tease. Just paste it into your init script to use it.
I also added the EOS test as attachment so you can import this into EOS and see with examples on how to use it.
Documentation
etsSaveValue(key, value)
Saves a key with a value. The value can also be an object.
Example: etsSaveValue("name", "alex")
etsLoadValue(key, defaultValue)
Loads the value of a given key and returns it. If the key does not exists the key is created with the default value and the default value is returned.
Example 1: etsLoadValue("teaseDurationSec", 120);
Example 2: etsLoadValue("name", null);
etsExport()
Returns the string to be saved by the user.
etsImport(importString)
Imports the previously exported string and initializes the etsJsonObject.
Warning: This will delete the current saved data!
Returns null on success. On error a message of the error is returned.
Example: etsImport("##01D6D0==")
ETS version 1 - 24.05.2020 :
- Spoiler: show