Skip to content

Commit

Permalink
Merge pull request #324 from Team-Silver-Sphere/322-fix
Browse files Browse the repository at this point in the history
Adds Support for #322
  • Loading branch information
werewolfboy13 committed Nov 18, 2023
2 parents 06c7e7f + 6a9b691 commit 652e651
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Interested in creating your own plugin? [See more here](./squad-server/plugins/r
<h6>Description</h6>
<p>Message SquadJS will send to players warning them they will be kicked</p>
<h6>Default</h6>
<pre><code>Join a squad, you are are unassigned and will be kicked</code></pre></li>
<pre><code>Join a squad, you are unassigned and will be kicked</code></pre></li>
<li><h4>kickMessage</h4>
<h6>Description</h6>
<p>Message to send to players when they are kicked</p>
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 11 additions & 11 deletions squad-server/log-parser/player-disconnected.js
Original file line number Diff line number Diff line change
@@ -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);
}
};
6 changes: 3 additions & 3 deletions squad-server/rcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 652e651

Please sign in to comment.