vu-rcon
TypeScript icon, indicating that this package has built-in type declarations

1.5.5 • Public • Published

Battlefield 3 RCON Interface

npm

Example

import { Battlefield } from "./src/Battlefield"

Battlefield.connect({ 
  host: "127.0.0.1",
  port: 47200,
  password: "RCON_PASSWORD"
}).then(async bf3 => {

  //listen to different events
  bf3.on("playerJoin", ({ name }) => bf3.say(`${name} is joining the game...`))
  bf3.on("playerLeave", event => console.log({ event }))
  bf3.on("kill", ({ killed, weapon }) => killed.say(`You just got killed with ${weapon.name}`))

  //get a list of players and yell the name to them
  const players = await bf3.getPlayers()
  players.forEach(player => player.yell(`Hello ${player.name}`))

  //ban someone
  const player = bf3.getPlayerByName("foobar")
  await player.banGuid().reason("foo").permanent().send()

})

Readme

Keywords

none

Package Sidebar

Install

npm i vu-rcon

Weekly Downloads

613

Version

1.5.5

License

MIT

Unpacked Size

222 kB

Total Files

56

Last publish

Collaborators

  • multivitamin