npm.io
1.0.0 • Published 3 years ago

project-zomboid-rcon

Licence
MIT
Version
1.0.0
Deps
0
Size
9 kB
Vulns
0
Weekly
0
Stars
1

project-zomboid-rcon

Connect and interact with your Project Zomboid server using RCON capabilities

What you need

  • A Project Zomboid server w/ RCONPassword and RCONPort set
  • NodeJS

..and that's it!

Usage

import {ZomboidCommands, ZomboidRconClient} from 'project-zomboid-rcon'

Example

import * as Zomboid from 'project-zomboid-rcon'

// Initialize the client
const zomboid = new Zomboid({
    host: "1.2.3.4", // the IP address to your server
    port: 1234, // RCONPort in the server ini
    password: "bestpasswordevermade" // RCONPassword in the server ini
})

// Connect to the server (this will throw if connection was unsuccessful)
zomboid.connect()

// All valid commands are provided in the zomboid.ZomboidCommands enum
// Run commands using the .send() function on the zomboid class
zomboid.send(zomboid.ZomboidCommands.GRANT_ADMIN, "Alex") // granting admin to Alex

// More than 1 argument? Supply in the same string!
zomboid.send(zomboid.ZomboidCommands.ADD_ITEM, "Alex Base.Tshirt_CamoUrban")

// Disconnect using the .disconnect() function
zomboid.disconnect()

Keywords