node-be
v1.2.0
Published
Node Battleye lib for Arma 2/3
Downloads
24
Readme
About
Battleye lib for Arma 2/3
Install
npm install node-be
Example
const NodeBe = require("node-be")
let client = new NodeBe("IP", 2306, "Password")
//Event: 'message'
//RCon messages and command responses will be emitted
client.on('message', function (message) {
console.log(message)
})
//Event: 'error'
//Errors while connecting/login or socket errors will be emitted
client.on('err', function (err) {
console.log(err)
})
//Event: 'close'
//Will be emitted when the server shuts down, becomes unresponsive or the connection is lost
client.on('close', function () {
console.log('Connection closed.')
})
//Event: 'listening'
//Will be emitted when the connection is successfully established and login has succeeded
client.on('listening', function () {
console.log('Connected!')
//send rcon/server commands
client.sendCommand("players")
client.sendCommand("say -1 Hello World")
})
//Attempt to connect with given host:port and password
client.connect()
Dependencies
buffer-crc32
License
MIT