Skip to content

Latest commit

 

History

History
executable file
·
85 lines (67 loc) · 2.55 KB

rcon-doc.md

File metadata and controls

executable file
·
85 lines (67 loc) · 2.55 KB

RconStats

push RCON stats to influx

Kind: global class

new RconStats(address, password, onStats)

run RCON stats and log response in influxdb to be graphed in grafana

Param Type
address String
password String
onStats function

Example (Example usage of RconStats Class.)

new RconStats('127.0.0.1', 'suspersecurepassword', stats => {
// stats object that was logged to database
});

rconStats._connect() ⇒ Promise.<Void>

connects to the game server rcon

Kind: instance method of RconStats
Returns: Promise.<Void> - nothing
Example (Example usage of _connect() function.)

RconStats._connect().then(_ => {
// connected
});

rconStats._getStats() ⇒ Promise.<String>

runs stats command

Kind: instance method of RconStats
Returns: Promise.<String> - rcon stats output
Example (Example usage of _getStats() function.)

RconStats._getStats().then(res => {
// res = stats output string
});

rconStats._parseStats(response) ⇒ CallableFunction.<Object>

get usable data from the response then loges it to database before passing it to the callback function

Kind: instance method of RconStats
Returns: CallableFunction.<Object> - fires when stats are processed

Param Type
response String

Example (Example usage of _parseStats() function.)

RconStats._parseStats(res);

rconStats._ping() ⇒ Void

loop to get data at a preset interval

Kind: instance method of RconStats
Returns: Void - nothing
Example (Example usage of _ping() function.)

RconStats._ping();