1.0.24 • Published 1 year ago
squad-logs v1.0.24
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-logsor
$ yarn add squad-logsQuick 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
| Event | Return | Type |
|---|---|---|
| ADMIN_BROADCAST | response | TAdminBroadcast |
| DEPLOYABLE_DAMAGED | response | TDeployableDamaged |
| NEW_GAME | response | TNewGame |
| PLAYER_CONNECTED | response | TPlayerConnected |
| PLAYER_DISCONNECTED | response | TPlayerDisconnected |
| PLAYER_DAMAGED | response | TPlayerDamaged |
| PLAYER_DIED | response | TPlayerDied |
| PLAYER_POSSESS | response | TPlayerPossess |
| PLAYER_UNPOSSESS | response | TPlayerUnpossess |
| PLAYER_REVIVED | response | TPlayerRevived |
| PLAYER_SUICIDE | response | TPlayerSuicide |
| PLAYER_WOUNDED | response | TPlayerWounded |
| ROUND_WINNER | response | TRoundWinner |
| ROUND_ENDED | response | TRoundEnded |
| ROUND_TICKETS | response | TRoundTickets |
| SQUAD_CREATED | response | TSquadCreated |
| VEHICLE_DAMAGED | response | TVehicleDamaged |
| TICK_RATE | response | TTickRate |
| connected | null | null |
| close | null | null |
1.0.24
1 year ago
1.0.23
2 years ago
1.0.19
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago