Add support for ironman runs
The idea is like this: on module start, generate a GUID and save it so that it identifies this module run uniquely. Every two heartbeats or so save to a campaign db info on the in-game time spent (I already track this in heartbeat for stat collection purposes to display at the end of the game for players). On load the module may detect if at least two campaign db stamps were made with a time higher than the one currently in the sav file. If so, it means that the player played at least 12 seconds after that save file, so we should flag this session as "with reloads". I do not want to use that detection mechanism to prevent players from continuing, I can use it to let them know their game run does not count as "without reloads" though, in the run summary screen at the end of the game as well as in the realm map window.
Implementation idea:
- flag run as "with reloads" if any save file is loaded more than once - this prevents the situation of reloading a file from before a few seconds ago to get a better roll on your spell/attack or get a worse roll an an enemy's.
- flag run as "with reloads" if a save file is loaded from a play time before the latest play time the run registered - this prevents going back to earlier save files
Nr 1 is easy enough: after loading a save file flag that playtime as having a save file "used up" in the campaign db. When a file is loaded and has a playtime equal to or lower (and perhaps also higher but only by a little) than one registered in the db, the run is flagged as "with reloads".
Nr 2 is a bit less clean, but still doable: flagging the run as "with reloads" upon load if at least two heartbeat ticks "from the future" are registered in the campaign db should work. That gives the player at least 6 seconds after saving before his save file is considered outdated, which should be enough. Easy enough to make that 12 seconds or any other duplicate of 6, though.