Skip to content

Latest commit

 

History

History
279 lines (198 loc) · 11 KB

API.md

File metadata and controls

279 lines (198 loc) · 11 KB

LiveSplitClient

Node.js client for the LiveSplit Server running instance

Kind: global class

new LiveSplitClient(address)

Param Type Description
address string Connection address, like: 127.0.0.1:1234

liveSplitClient.connected : boolean

Client connection status.

Kind: instance property of LiveSplitClient

liveSplitClient.connect() ⇒ Promise

Performs connection attempt to the LiveSplit Server instance.

Kind: instance method of LiveSplitClient
Returns: Promise - Connection result or error.

liveSplitClient.disconnect() ⇒ boolean

Disconnect client from the sever.

Kind: instance method of LiveSplitClient
Returns: boolean - Disconnection result.

liveSplitClient.send(command, [expectResponse]) ⇒ Promise | boolean

Send command to the LiveSplit Server instance.

Kind: instance method of LiveSplitClient
Returns: Promise | boolean - - Promise if answer was expected, else true.

Param Type Default Description
command string Existing LiveSplit Server command without linebreaks.
[expectResponse] boolean true Expect response from the server.

liveSplitClient.startTimer() ⇒ boolean

Start timer

Kind: instance method of LiveSplitClient

liveSplitClient.startOrSplit() ⇒ boolean

Start or split

Kind: instance method of LiveSplitClient

liveSplitClient.split() ⇒ boolean

Split

Kind: instance method of LiveSplitClient

liveSplitClient.unsplit() ⇒ boolean

Unsplit

Kind: instance method of LiveSplitClient

liveSplitClient.skipSplit() ⇒ boolean

Skip split

Kind: instance method of LiveSplitClient

liveSplitClient.pause() ⇒ boolean

Pause

Kind: instance method of LiveSplitClient

liveSplitClient.resume() ⇒ boolean

Resume

Kind: instance method of LiveSplitClient

liveSplitClient.reset() ⇒ boolean

Reset

Kind: instance method of LiveSplitClient

liveSplitClient.initGameTime() ⇒ boolean

Init game time. Could be called only once according to LiveSplit Server documentation.

Kind: instance method of LiveSplitClient

liveSplitClient.setGameTime(time) ⇒ boolean

Set game time

Kind: instance method of LiveSplitClient

Param Type Description
time string Game time

liveSplitClient.setLoadingTimes(time) ⇒ boolean

Set loading times

Kind: instance method of LiveSplitClient

Param Type Description
time string Game time

liveSplitClient.pauseGameTime() ⇒ boolean

Pause game time

Kind: instance method of LiveSplitClient

liveSplitClient.unpauseGameTime() ⇒ boolean

Unpause game time

Kind: instance method of LiveSplitClient

liveSplitClient.setComparison(comparison) ⇒ boolean

Set comparison

Kind: instance method of LiveSplitClient

Param Type Description
comparison string Comparison

liveSplitClient.getDelta([comparison]) ⇒ Promise

Get delta

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

Param Type Description
[comparison] string Comparison

liveSplitClient.getLastSplitTime() ⇒ Promise

Get last split time

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getComparisonSplitTime() ⇒ Promise

Get comparison split time

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getCurrentTime() ⇒ Promise

Get current time

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getFinalTime([comparison]) ⇒ Promise

Get final time

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

Param Type Description
[comparison] string Comparison

liveSplitClient.getPredictedTime([comparison]) ⇒ Promise

Get predicted time

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

Param Type Description
[comparison] string Comparison

liveSplitClient.getBestPossibleTime() ⇒ Promise

Get best pssible time

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getSplitIndex() ⇒ Promise

Get split index

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getCurrentSplitName() ⇒ Promise

Get current split name

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getPreviousSplitName() ⇒ Promise

Get previous split name

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getCurrentTimerPhase() ⇒ Promise

Get current timer phase

Kind: instance method of LiveSplitClient
Returns: Promise - Command result or null on timeout.

liveSplitClient.getAll() ⇒ Promise

Get all available information. Synthetic method that calls every server getter command if possible.

Kind: instance method of LiveSplitClient
Returns: Promise - Commands execution result or false on timeout.