LiveSplit / LiveSplitOne

A version of LiveSplit that works on a lot of platforms.
https://one.livesplit.org/
MIT License
251 stars 29 forks source link

Game Time doesn't show split times #545

Closed kimimaru4000 closed 3 years ago

kimimaru4000 commented 3 years ago

Environment

LiveSplitOne Version: 8b10bb8 (https://github.com/LiveSplit/LiveSplitOne/commit/8b10bb8)
OS: Linux Mint 20.1 Ulyssa
Browser: Firefox 88.0.1 (64-bit)

Issue When I make a split in Game Time, it just shows a dash on the total split time, the difference, and the previous segment: GameTime

On the other hand, Real Time works as expected, showing the split time and the difference: RealTime

This occurs regardless of my layout settings. I've set all timers in the layout to be Game Time and it still exhibits this behavior.

Expected Behavior I would expect Game Time to behave the same way as Real Time and correctly show the split. For my specific use-case, I run a Twitch Plays stream, and sometimes when the stream goes down I need to roll back the timer for accuracy. This can be done with the websocket interface to manipulate the Game Time, however, this isn't possible with Real Time.

CryZe commented 3 years ago

For each new run LiveSplit (both the original and LiveSplit One) assumes that nothing providing game time is connected. Instead you have to explicitly initialize game time each time: https://github.com/LiveSplit/livesplit-core/blob/17e36f700594fbe0e23df4eddc39333bc473f5ff/src/timing/timer/mod.rs#L565-L570

I'm not 100% sure how this is done with the WebSocket interface, but setting game time to some value (such as 0) also counts as initializing.

Update: It's called initgametime https://github.com/LiveSplit/LiveSplitOne/blob/6c7281e110449c07e53e3807fbde19a8beb7aa94/src/ui/TimerView.tsx#L262

kimimaru4000 commented 3 years ago

Thanks; this worked perfectly! I would like to see a config option for automatically initializing game time, but I'll create a new issue for that.