Adding Servers

You can add servers to interact with via your application by following the documentation on this page.

Example Code

import { RCEManager, RCEIntent } from "rce.js";

const rce = new RCEManager();
rce.addServer({
    identifier: "my-solo-duo-trio-3x",
    rcon: {
        host: "127.0.0.1",
        port: 1234,
        password: "testing123"
    },
    state: ["trio", "3x"]
});

Server Options

Below is a brief explanation of each option when defining new server(s).

Identifier

The identifier is a unique string which allows rce.js to identify the correct server(s) events are being received for or commands are being sent to. We suggest using a UUID for this!

Type: String

Required: Yes

State

The state is an array of anything you wish to implement. For example, you can add "pvp" in your state array and check later in your code is the state array includes "pvp" to make your application behave differently if the server is a PvP-only server. You can use the state for anything.

Type: Any[]

Required: Yes

Default: []

Last updated