A node.js driver for the SRCDS RCON
Node.JS high-level wrapper for SRCDS's remote console (RCON) https://developer.valvesoftware.com/wiki/RCON
npm install srcds-rcon
If you think the npm version is outdated, you may install from github
npm install randunel/node-srcds-rcon
This is a node driver for SRCDS's RCON. While it should work on all SRCDS versions, it has only been tested against the Source 2009 (orangebox) protocol.
var Rcon = require'srcds-rcon';var rcon = '127.0.1.1:27015' 'mySecretRconPassword';rconconnectrconsv_airaccelerate6console.log'sv_airaccelerate set to 6' res;rconchangelevel'de_dust2'console.log'Changed map to de_dust2';;;;
- Don't keep the SRCDS console open when initializing the service. The internal watchdog timer detects a timeout due to the console's slow display speed and aborts, dumps the core and restarts the server. You may open the SRCDS console afterwards. There are two workarounds, setting watchdog's timeout to a higher value which may not be accesible, or disabling logging to console which may hinder debugging.
- Rcon's internal cvar state is not maintained, the settings in
rcon.commandsare only valid after initialization, and must be considered outdated afterwards. That goes down as work in progress, feel free to assist.
- Error handling - mostly works, haven't encountered that many during tests