@ohd-tools/rcon
Version:
An RCON Interface for Operation: Harsh Doorstop
59 lines (40 loc) • 2.67 kB
Markdown
<p align="center">
<img src="https://github.com/afocommunity/OHD-RCON/raw/main/.github/assets/logo.png" />
</p>
# Operation: Harsh Doorstop RCON Interface
  [](https://github.com/afocommunity/OHD-RCON/issues)   [](https://www.codacy.com/gh/afocommunity/OHD-RCON/dashboard?utm_source=github.com&utm_medium=referral&utm_content=afocommunity/OHD-RCON&utm_campaign=Badge_Grade)  
 
# Installation
NPM
```bash
npm install @ohd-tools/rcon
```
YARN
```bash
yarn add @ohd-tools/rcon
```
# Documentation
Documentation can be found [HERE](https://ohd-tools.github.io/OHD-RCON/)

# Usage
```ts
// Example Usage that bans all players with a given word or phrase in their name.
import { OHD } from '@ohd-tools/rcon';
const myServer = new OHD('127.0.0.1', 8000, 'mypassword');
myServer.on('PLAYER_JOINED', (player) => {
if (!player.isBot && player.name.includes('Naughty Word')) {
player.ban(0, 'Bad Words in Name');
}
});
myServer.on('READY', async () => {
await myServer.variables.HD.Game.DisableKitRestrictionsOverride.write('1');
await myServer.variables.HD.Game.MinRespawnDelayOverride.write('0.00');
const restrictions =
await myServer.variables.HD.Game.DisableKitRestrictionsOverride.read();
const respawnDelayInfo =
await myServer.variables.HD.Game.MinRespawnDelayOverride.readDetailed();
});
```
# Development
To run tests locally, place a copy of [steamcmd.exe](https://developer.valvesoftware.com/wiki/SteamCMD#Windows) in the `steamcmd` folder.
This is used to download OHD and boot a local server for testing purposes. You **MUST** port forward `7777, 7778, 7779, 27005` (Default)