logo
pub trait HostFunctions {
    fn attach(&self, name: &str) -> Option<Process> { ... }
    fn start(&self) { ... }
    fn pause(&self) { ... }
    fn unpause(&self) { ... }
    fn split(&self) { ... }
    fn reset(&self) { ... }
    fn set_game_time(&self, time: Duration) { ... }
    fn set_tick_rate(&self, rate: f64) { ... }
    fn state(&self) -> TimerState { ... }
    fn set_variable(&self, key: &str, value: &str) { ... }
}
Expand description

The autosplitter’s interface for interacting with the LiveSpilit timer.

Provided Methods

Attach to a process running on the same machine as the autosplitter.

Start the timer for a run. Note that this will silently do nothing on subsequent calls. To start a new run, call reset() and then start().

Pause the game time counter. This is often used when entering a loading screen or end level screen for games that use in-game time rather than real time. It may be a good idea to call set_game_time() immediately after pausing so that LiveSplit’s game time counter shows the exact current time.

Resume the game time counter.

Mark the current split as finished and move to the next one.

Reset the run. Don’t do this automatically when a run has finished, and in general be conservative about resetting runs from the autosplitter. Common practice is to do so only if there’s an unambiguous signal that the player is done with this run.

Set the game time. Note that if the timer is not paused, the time shown will keep incrementing immediately after it is set to the given value.

Set the rate at which the update function will be called (in Hz).

Get the current state of the timer. This is how the autosplitter can detect if the player manually paused or reset a run.

Set a variable which can be displayed by LiveSplit. This is commonly used for features like death counters.

Implementors