1.1.9-dev26 • Published 11 months ago

sa-simple-rcon v1.1.9-dev26

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

RconClient

Overview

RconClient is a flexible remote console client that supports multiple connection types (WebSocket and NetSocket) for game server management. It leverages event-driven architecture to handle RCON commands and responses efficiently.

Features

  • Supports both WebSocket and TCP connections.
  • Event-driven approach for robust and scalable server command handling.
  • Easy to integrate with various game servers by configuring the gameId.

Installation

To install RconClient, run the following npm command:

npm install sa-simple-rcon

For more details, visit the npm package page.

Usage

Creating an Instance

Instantiate RconClient by providing a configuration object which includes gameId and other connection-specific options.

import { RconClient } from 'sa-simple-rcon';

const options = {
  host: 'localhost',
  port: 25575,
  password: 'your_password',
  timeout: 5000,
  gameId: 252490 // Use 346110 for ARK
};

const rcon = new RconClient(options);

Connecting to the Server

rcon.login();

Sending Commands

rcon.send('status', 'ServerStatus', 1);

Handling Responses

RconClient inherits from EventEmitter, allowing you to listen to various events.

rcon.on('message', (data) => {
  console.log('Received:', data);
});

Closing Connection

rcon.close(); // Gracefully closes the connection

API

login()

Initiates the connection based on the provided options.

send(message: string, name: string, identifier: string | number)

Sends a message/command to the server. name and identifier can be used to handle responses.

close()

Closes the connection gracefully.

terminate()

Forcibly closes the connection.

1.1.1

1 year ago

1.1.0

1 year ago

1.1.9

11 months ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.9-dev14

11 months ago

1.1.9-dev15

11 months ago

1.1.9-dev12

11 months ago

1.1.9-dev13

11 months ago

1.1.9-dev18

11 months ago

1.1.9-dev19

11 months ago

1.1.9-dev16

11 months ago

1.1.9-dev17

11 months ago

1.1.9-dev10

11 months ago

1.1.9-dev11

11 months ago

1.1.9-dev9

11 months ago

1.1.9-dev8

11 months ago

1.1.9-dev7

11 months ago

1.1.9-dev6

11 months ago

1.1.9-dev26

11 months ago

1.1.9-dev5

11 months ago

1.1.9-dev23

11 months ago

1.1.9-dev4

11 months ago

1.1.9-dev24

11 months ago

1.1.9-dev3

11 months ago

1.1.9-dev2

11 months ago

1.1.9-dev1

11 months ago

1.1.9-dev21

11 months ago

1.1.9-dev22

11 months ago

1.1.9-dev20

11 months ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago