Open lythro opened 4 years ago
Thanks. I'll take a look at it.
The saveCreated variable is set only when the save is first created, not when it is saved in future. It is a timestamp of when the player first started playing the game and should never change.
In the case where someone has a cloud save but starts playing on a new PC, I check to see if the cloud save began before the local save, and then overwrite it. So I'm pretty sure that if clause is correct.
I had to put the spawnedSavedCreatures = false into the importFile function, since it was possible to exploit by repeatedly importing the save file which would spawn golems every time and couldn't check to see if they were already spawned. I suppose it would make more sense to just destroy any active golems before spawning saved ones, but that was the quick fix I put in to fix the exploit at the time.
Thanks for the fast reply! :)
Sounds totally reasonable, both the saveCreated and the spawnedSavedCreatures variables. Just on a side note: I think if you really worry about exploits/hacks, javascript was probably not the best choice of language, since all modern webbrowsers give you access to a console. :wink:
Yea, a fix for this might be a better idea than worrying about exploits which is apparently super easy in that game anyways. I constantly lose all my golems with cloud save which now forces me to also use save files, just had it that the golems, with parts I accumulated over 3 days, just vanished through a random browser crash before I could make any use of them => lost 3 days, no fun
Hey there,
someone on kong talked about his golems vanishing while being offline over night. I didn't try to reproduce this myself, but I looked at the loading-code and see two (or three) possible issues:
savegame.saveCreated < model.persistentData.saveCreated
part -- shouldn't that be the other way round? https://github.com/jamesmgittins/incremancer/blob/e30693af6df4ba6ad39f428ac39918b700d17baf/js/gamemodel.js#L801-L810importFile
function you reset the creature factoriesspawnedSavedCreatures
flag tofalse
beforesetupLevel
, but this is not done in eitherloadData
nor inloadFromPlayFab
. So if both are executed, the first will set the flag to true, and the second will reset the golems but not respawn them? https://github.com/jamesmgittins/incremancer/blob/e30693af6df4ba6ad39f428ac39918b700d17baf/js/gamemodel.js#L636-L642My best guess is that (1) and (3) together cause this problem. Should be an easy fix, right? 🙂