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

1.0.2 • Public • Published

Squad

Squad Client

The module enables you to easily perform certain actions by connecting to the game console through your Squad game server using RCON.

Installation

  npm install squadclient
  yarn add squadclient
  pnpm add squadclient

Features

  • Custom-designed RCON infrastructure.
  • Obtaining player, team, server, and squad information quickly and easily.
  • Using promises for asynchronous operations.

Methods

  • getTeams() - Get team names.
  • getServerInfo() - Get some info about server.
  • getLayers() - Get current and next layers.
  • getSquads() - Get squads and details.
  • getPlayers() - Get players.

Events

  • squadCreate - Emitted whenever a squad is created.
{
    time: Date,
    playerName: string,
    playerEOSID: string,
    playerSteamID: string,
    squadID: string,
    squadName: string,
    teamName: string
}
  • chatMessage - Emitted whenever a message is created.
{
    raw: string,
    chat: 'ChatAll' | 'ChatTeam' | 'ChatSquad',
    eosID: string,
    steamID: string,
    name: string,
    message: string,
    time: Date
}
  • playerKicked - Emitted whenever a player kicked from server.
{
    raw: string,
    playerID: string,
    steamID: string,
    name: string,
    time: Date
}
  • playerBanned - Emitted whenever a player banned from server.
{
    raw: string,
    playerID: string,
    steamID: string,
    name: string,
    interval: string,
    time: Date
}
  • playerWarned - Emitted whenever a player warned.
{
    raw: string,
    name: string,
    reason: string,
    time: Date
}

Usage / Examples

import { SquadClient } from 'squadclient';
// For CommonJS -> const { SquadClient } = require('squadclient');

const client = new SquadClient({ host: 'serverIp', port: rconPort, password: 'rconPassword' });

(async () => {
    await client.connect();

    const info = await client.getServerInfo();

    console.log(info);

    client.on('squadCreate', (squad) => {
        console.log('A squad has been created!', `Squad Name: ${squad.squadName} | Team Name: ${squad.teamName}`);
    });
})();

License

This project is licensed under the MIT License.

Authors

zédyN (Github - Discord)

Support

For support, DM me on Discord or create a ticket in discord.gg/luppux

Package Sidebar

Install

npm i squadclient

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

41.3 kB

Total Files

7

Last publish

Collaborators

  • zedyn