1.0.23 • Published 4 months ago

squad-logs v1.0.23

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

SquadLogs

This library is designed for the game Squad, it will give you the ability to easily parse game logs. It is possible to read the file locally or protocol SFTP. I hope this will be useful to you!

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the

$ npm install squad-logs

or

$ yarn add squad-logs

Quick Start

SFTP

import { LogsReader } from 'squad-logs';

(async () => {
  const logsReader = LogsReader({
    id: 1,
    autoReconnect: true,
    readType: 'remote',
    adminsFilePath: '/SquadGame/ServerConfig/Admins.cfg',
    filePath: '/SquadGame/Saved/Logs/SquadGame.log',
    host: '127.0.0.1',
    username: 'root',
    password: '123456',
  });

  await logsReader.init();

  const admins = await logsReader.getAdminsFile();

  logsReader.on('PLAYER_CONNECTED', (data) => {
    console.log(data);
  });
})();

LOCAL

import { LogsReader } from 'squad-logs';

(async () => {
  const logsReader = LogsReader({
    id: 1,
    autoReconnect: true,
    readType: 'local',
    adminsFilePath: '/SquadGame/ServerConfig/Admins.cfg',
    filePath: '/SquadGame/Saved/Logs/SquadGame.log',
  });

  await logsReader.init();

  const admins = await logsReader.getAdminsFile();

  logsReader.on('PLAYER_CONNECTED', (data) => {
    console.log(data);
  });
})();

Events

EventReturnType
ADMIN_BROADCASTresponseTAdminBroadcast
DEPLOYABLE_DAMAGEDresponseTDeployableDamaged
NEW_GAMEresponseTNewGame
PLAYER_CONNECTEDresponseTPlayerConnected
PLAYER_DISCONNECTEDresponseTPlayerDisconnected
PLAYER_DAMAGEDresponseTPlayerDamaged
PLAYER_DIEDresponseTPlayerDied
PLAYER_POSSESSresponseTPlayerPossess
PLAYER_UNPOSSESSresponseTPlayerUnpossess
PLAYER_REVIVEDresponseTPlayerRevived
PLAYER_SUICIDEresponseTPlayerSuicide
PLAYER_WOUNDEDresponseTPlayerWounded
ROUND_WINNERresponseTRoundWinner
ROUND_ENDEDresponseTRoundEnded
ROUND_TICKETSresponseTRoundTickets
SQUAD_CREATEDresponseTSquadCreated
VEHICLE_DAMAGEDresponseTVehicleDamaged
TICK_RATEresponseTTickRate
connectednullnull
closenullnull
1.0.23

4 months ago

1.0.19

5 months ago

1.0.22

5 months ago

1.0.21

5 months ago

1.0.20

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago