@ohd-tools/ohd-config
TypeScript icon, indicating that this package has built-in type declarations

0.11.2 • Public • Published

Operation: Harsh Doorstop RCON Interface

npm GitHub Sponsors GitHub issues GitHub npm bundle size (scoped) Codacy grade GitHub GitHub commit activity

GitHub package.json version GitHub release (latest SemVer)

Installation

NPM

npm install @afocommunity/ohd-rcon

YARN

yarn add @afocommunity/ohd-rcon

Documentation

Documentation can be found HERE

Docs

Usage

// Example Usage that bans all players with a given word or phrase in their name.
import { OHD } from '@afocommunity/ohd-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', () => {
  myServer.variables.HD.Game.DisableKitRestrictionsOverride.write('1');
  myServer.variables.HD.Game.MinRespawnDelayOverride.write('0.00');
});
// Alternatively
myServer.onReady.then(() => {
  let restrictions =
    myServer.variables.HD.Game.DisableKitRestrictionsOverride.read();

  let respawnDelayInfo =
    myServer.variables.HD.Game.MinRespawnDelayOverride.readDetailed();
});

Development

To run tests locally, place a copy of steamcmd.exe 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)

Package Sidebar

Install

npm i @ohd-tools/ohd-config

Weekly Downloads

1

Version

0.11.2

License

MIT

Unpacked Size

27.8 kB

Total Files

16

Last publish

Collaborators

  • bombitmanbomb