From 6a9b691bcd0aed2dd89c47e5e88cfed7023391e0 Mon Sep 17 00:00:00 2001 From: werewolfboy13 Date: Sat, 18 Nov 2023 17:40:18 -0600 Subject: [PATCH] Adds Support for #322 --- README.md | 2 +- config.json | 2 +- .../log-parser/player-disconnected.js | 22 +++++++++---------- squad-server/rcon.js | 6 ++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e1b720e3..b137e4f9 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,7 @@ Interested in creating your own plugin? [See more here](./squad-server/plugins/r
Description

Message SquadJS will send to players warning them they will be kicked

Default
-
Join a squad, you are are unassigned and will be kicked
+
Join a squad, you are unassigned and will be kicked
  • kickMessage

    Description

    Message to send to players when they are kicked

    diff --git a/config.json b/config.json index e68f5e58..c3e82bc6 100644 --- a/config.json +++ b/config.json @@ -43,7 +43,7 @@ { "plugin": "AutoKickUnassigned", "enabled": true, - "warningMessage": "Join a squad, you are are unassigned and will be kicked", + "warningMessage": "Join a squad, you are unassigned and will be kicked", "kickMessage": "Unassigned - automatically removed", "frequencyOfWarnings": 30, "unassignedTimer": 360, diff --git a/squad-server/log-parser/player-disconnected.js b/squad-server/log-parser/player-disconnected.js index 09976979..352a0124 100644 --- a/squad-server/log-parser/player-disconnected.js +++ b/squad-server/log-parser/player-disconnected.js @@ -1,16 +1,16 @@ export default { regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogNet: UChannel::Close: Sending CloseBunch\. ChIndex == [0-9]+\. Name: \[UChannel\] ChIndex: [0-9]+, Closing: [0-9]+ \[UNetConnection\] RemoteAddr: ([0-9]{17}):[0-9]+, Name: SteamNetConnection_[0-9]+, Driver: GameNetDriver SteamNetDriver_[0-9]+, IsServer: YES, PC: ([^ ]+PlayerController_C_[0-9]+), Owner: [^ ]+PlayerController_C_[0-9]+/, - onMatch: (args, logParser) => { - const data = { - raw: args[0], - time: args[1], - chainID: args[2], - steamID: args[3], - playerController: args[4] - }; + onMatch: (args, logParser) => { + const data = { + raw: args[0], + time: args[1], + chainID: args[2], + steamID: args[3], + playerController: args[4] + }; - logParser.eventStore.disconnected[data.steamID] = true; - logParser.emit('PLAYER_DISCONNECTED', data); - } + logParser.eventStore.disconnected[data.steamID] = true; + logParser.emit('PLAYER_DISCONNECTED', data); + } }; diff --git a/squad-server/rcon.js b/squad-server/rcon.js index b618ba49..7209d7a0 100644 --- a/squad-server/rcon.js +++ b/squad-server/rcon.js @@ -139,8 +139,8 @@ export default class SquadRcon extends Rcon { const players = []; - if(!response || response.length < 1) return players; - + if (!response || response.length < 1) return players; + for (const line of response.split('\n')) { const match = line.match( /ID: ([0-9]+) \| SteamID: ([0-9]{17}) \| Name: (.+) \| Team ID: ([0-9]+) \| Squad ID: ([0-9]+|N\/A) \| Is Leader: (True|False) \| Role: ([A-Za-z0-9_]*)\b/ @@ -168,7 +168,7 @@ export default class SquadRcon extends Rcon { let teamName; let teamID; - if(!responseSquad || responseSquad.length < 1) return squads; + if (!responseSquad || responseSquad.length < 1) return squads; for (const line of responseSquad.split('\n')) { const match = line.match(