1.1.9-dev26 • Published 1 year ago

sa-simple-rcon v1.1.9-dev26

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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

1 year 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

1 year ago

1.1.9-dev15

1 year ago

1.1.9-dev12

1 year ago

1.1.9-dev13

1 year ago

1.1.9-dev18

1 year ago

1.1.9-dev19

1 year ago

1.1.9-dev16

1 year ago

1.1.9-dev17

1 year ago

1.1.9-dev10

1 year ago

1.1.9-dev11

1 year ago

1.1.9-dev9

1 year ago

1.1.9-dev8

1 year ago

1.1.9-dev7

1 year ago

1.1.9-dev6

1 year ago

1.1.9-dev26

1 year ago

1.1.9-dev5

1 year ago

1.1.9-dev23

1 year ago

1.1.9-dev4

1 year ago

1.1.9-dev24

1 year ago

1.1.9-dev3

1 year ago

1.1.9-dev2

1 year ago

1.1.9-dev1

1 year ago

1.1.9-dev21

1 year ago

1.1.9-dev22

1 year ago

1.1.9-dev20

1 year 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