livesplit-core icon indicating copy to clipboard operation
livesplit-core copied to clipboard

Figure out a design for resuming runs when restarting the application

Open CryZe opened this issue 7 years ago • 1 comments

At some point we want to have the ability to close LiveSplit and then resuming the run as if LiveSplit was never closed. We need to figure out a design of how we want to support this.

CryZe avatar Dec 27 '18 23:12 CryZe

HI. I looked at this in a bit of detail and came up with a possible solution.

  • Convert Timer values that are TimeStamps into AtomicDateTime
    • TimeStamp is composed of Instant which plays badly with accessing its contents and serializing
    • I also have a suspicion that Instant is not consistent across reboots
  • Serialize this new Timer without Run but grabbing its Segment::split_times
    • I was able to use serde_json for to accomplish this with an intermediate representation of Timer
  • Deserialize Timer (through this intermediate form) and replace its values
    • This might be bad if the Timer is is not in the NotRunning state, but it may be ok

If the Timer was Serialized on user actions (split, undo, skip, ...), I would imagine this would help in cases where livesplit would close unexpectedly (usually the computer rebooting).

There are a number of runners who do very long runs and have had a) their computers reboot or b) livesplit get into an inoperable state.

I have a working version of this from the current repo.

savage13 avatar Dec 16 '22 17:12 savage13