JJM152 / Queen

Queen of the Seas Game
GNU General Public License v2.0
12 stars 13 forks source link

Limit save scumming #200

Open JJM152 opened 5 years ago

JJM152 commented 5 years ago

There are probably three main approaches to this:

The prime candidates for things like this are not just shops, but also some of the mini games, particularly things like the slots which actually break if the user reloads their browser. Reloading on any kind of gambling is just plain lame. Lets see what we can do about it.

ezsh commented 5 years ago

Use the Web Storage API, particularly sessionStorage to serialize variables to.

Does it mean simply bypassing the SugarCube serialisation layer? As far as I am aware, it uses Web Storage too.

JJM152 commented 5 years ago

It does, but it ties the save/load to the display of the passage as part of the state history in regards to a passage, which is very limiting.

There's no problem with also using the WEB API to store data, just give the keys unique or hashed names and for my purposes, the session storage is enough. We don't need to persist between browser sessions.