1.2.0 • Published 7 years ago

node-be v1.2.0

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

npm JavaScript Style Guide

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

1.2.0

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago