kldzj/rcon

Source 2 Support

Closed this issue · 2 comments

switz commented

does this work with source 2/cs2 servers?

kldzj commented

I don't think that there has been any protocol changes, so while my servers are not running CS2 yet I have to hazard a guess that it is working, yes.

Feedback is welcome and appreciated.

kldzj commented

I quickly rented a CS2 server and can confirm that it is indeed working.

import { createConnection, RconProtocol } from "@kldzj/rcon";

const rcon = createConnection({
  host: "...",
  port: 31015,
  password: "...",
  protocol: RconProtocol.TCP,
});

async function main() {
  await rcon.connect();

  const status = await rcon.send("status");
  console.log(status);

  await rcon.disconnect();
}

main().catch(console.error);