From 31164c4bae70f2bc81d81d358e91600fd89c8507 Mon Sep 17 00:00:00 2001 From: Thomas Smyth Date: Thu, 25 Feb 2021 13:04:14 +0000 Subject: [PATCH 1/2] ESLint & README Generation --- README.md | 556 ++++++++++++++++++++++++++-------------------------- config.json | 166 ++++++++-------- 2 files changed, 361 insertions(+), 361 deletions(-) diff --git a/README.md b/README.md index c2c767b..d92ad97 100644 --- a/README.md +++ b/README.md @@ -266,107 +266,61 @@ The following is a list of plugins built into SquadJS, you can click their title Interested in creating your own plugin? [See more here](./squad-server/plugins/readme.md)
- AutoKickUnassigned -

AutoKickUnassigned

-

The AutoKickUnassigned plugin will automatically kick players that are not in a squad after a specified ammount of time.

+ DiscordSubsystemRestarter +

DiscordSubsystemRestarter

+

The DiscordSubSystemRestarter plugin allows you to manually restart SquadJS subsystems in case an issues arises with them.

Options

-
- AutoTKWarn -

AutoTKWarn

-

The AutoTkWarn plugin will automatically warn players with a message when they teamkill.

+ DiscordChat +

DiscordChat

+

The DiscordChat plugin will log in-game chat to a Discord channel.

Options

-
- -
- ChatCommands -

ChatCommands

-

The ChatCommands plugin can be configured to make chat commands that broadcast or warn the caller with present messages.

-

Options

-
-
- DBLog -

DBLog

-

The mysql-log plugin will log various server statistics and events to a database. This is great for server performance monitoring and/or player stat tracking. - -Grafana (NOT YET WORKING WITH V2): -

-

Options

- -
-
DiscordAdminBroadcast

DiscordAdminBroadcast

@@ -390,29 +344,6 @@ Grafana (NOT YET WORKING WITH V2):
16761867
-
- DiscordAdminCamLogs -

DiscordAdminCamLogs

-

The DiscordAdminCamLogs plugin will log in game admin camera usage to a Discord channel.

-

Options

- -
-
DiscordAdminRequest

DiscordAdminRequest

@@ -470,128 +401,6 @@ Grafana (NOT YET WORKING WITH V2):
16761867
-
- DiscordChat -

DiscordChat

-

The DiscordChat plugin will log in-game chat to a Discord channel.

-

Options

- -
- -
- DiscordDebug -

DiscordDebug

-

The DiscordDebug plugin can be used to help debug SquadJS by dumping SquadJS events to a Discord channel.

-

Options

- -
- -
- DiscordRcon -

DiscordRcon

-

The DiscordRcon plugin allows a specified Discord channel to be used as a RCON console to run RCON commands.

-

Options

- -
- -
- DiscordRoundWinner -

DiscordRoundWinner

-

The DiscordRoundWinner plugin will send the round winner to a Discord channel.

-

Options

- -
-
DiscordServerStatus

DiscordServerStatus

@@ -626,21 +435,96 @@ Grafana (NOT YET WORKING WITH V2):
- DiscordSubsystemRestarter -

DiscordSubsystemRestarter

-

The DiscordSubSystemRestarter plugin allows you to manually restart SquadJS subsystems in case an issues arises with them.

+ AutoKickUnassigned +

AutoKickUnassigned

+

The AutoKickUnassigned plugin will automatically kick players that are not in a squad after a specified ammount of time.

+

Options

+ +
+ +
+ DiscordDebug +

DiscordDebug

+

The DiscordDebug plugin can be used to help debug SquadJS by dumping SquadJS events to a Discord channel.

Options

+
667741905228136459
+
  • events (Required)

    +
    Description
    +

    A list of events to dump.

    +
    Default
    +
    []
  • Example
    +
    [
    +  "PLAYER_DIED"
    +]
    +
    + +
    + IntervalledBroadcasts +

    IntervalledBroadcasts

    +

    The IntervalledBroadcasts plugin allows you to set broadcasts, which will be broadcasted at preset intervals

    +

    Options

    +
    @@ -671,49 +555,6 @@ Grafana (NOT YET WORKING WITH V2):
    false
    -
    - IntervalledBroadcasts -

    IntervalledBroadcasts

    -

    The IntervalledBroadcasts plugin allows you to set broadcasts, which will be broadcasted at preset intervals

    -

    Options

    - -
    - -
    - SCBLInfo -

    SCBLInfo

    -

    The SCBLInfo plugin alerts admins when a harmful player is detected joining their server based on data from the Squad Community Ban List.

    -

    Options

    - -
    -
    SeedingMode

    SeedingMode

    @@ -751,6 +592,142 @@ Grafana (NOT YET WORKING WITH V2):
    Live!
    +
    + AutoTKWarn +

    AutoTKWarn

    +

    The AutoTkWarn plugin will automatically warn players with a message when they teamkill.

    +

    Options

    + +
    + +
    + DBLog +

    DBLog

    +

    The mysql-log plugin will log various server statistics and events to a database. This is great for server performance monitoring and/or player stat tracking. + +Grafana (NOT YET WORKING WITH V2): +

    +

    Options

    + +
    + +
    + DiscordRoundWinner +

    DiscordRoundWinner

    +

    The DiscordRoundWinner plugin will send the round winner to a Discord channel.

    +

    Options

    + +
    + +
    + ChatCommands +

    ChatCommands

    +

    The ChatCommands plugin can be configured to make chat commands that broadcast or warn the caller with present messages.

    +

    Options

    + +
    + +
    + DiscordAdminCamLogs +

    DiscordAdminCamLogs

    +

    The DiscordAdminCamLogs plugin will log in game admin camera usage to a Discord channel.

    +

    Options

    + +
    + +
    + DiscordRcon +

    DiscordRcon

    +

    The DiscordRcon plugin allows a specified Discord channel to be used as a RCON console to run RCON commands.

    +

    Options

    + +
    +
    TeamRandomizer

    TeamRandomizer

    @@ -763,6 +740,29 @@ Grafana (NOT YET WORKING WITH V2):
    randomize
    +
    + SCBLInfo +

    SCBLInfo

    +

    The SCBLInfo plugin alerts admins when a harmful player is detected joining their server based on data from the Squad Community Ban List.

    +

    Options

    + +
    +
    ## Statement on Accuracy diff --git a/config.json b/config.json index 05aba60..9043cc9 100644 --- a/config.json +++ b/config.json @@ -33,40 +33,22 @@ }, "plugins": [ { - "plugin": "AutoKickUnassigned", - "enabled": true, - "warningMessage": "Join a squad, you are are unassigned and will be kicked", - "kickMessage": "Unassigned - automatically removed", - "frequencyOfWarnings": 30, - "unassignedTimer": 360, - "playerThreshold": 93, - "roundStartDelay": 900, - "ignoreAdmins": false, - "ignoreWhitelist": false + "plugin": "DiscordSubsystemRestarter", + "enabled": false, + "discordClient": "discord", + "role": "" }, { - "plugin": "AutoTKWarn", + "plugin": "DiscordChat", "enabled": true, - "message": "Please apologise for ALL TKs in ALL chat!" - }, - { - "plugin": "ChatCommands", - "enabled": true, - "commands": [ - { - "command": "squadjs", - "type": "warn", - "response": "This server is powered by SquadJS.", - "ignoreChats": [] - } + "discordClient": "discord", + "channelID": "", + "chatColors": {}, + "color": 16761867, + "ignoreChats": [ + "ChatSquad" ] }, - { - "plugin": "DBLog", - "enabled": false, - "database": "mysql", - "overrideServerID": null - }, { "plugin": "DiscordAdminBroadcast", "enabled": false, @@ -74,13 +56,6 @@ "channelID": "", "color": 16761867 }, - { - "plugin": "DiscordAdminCamLogs", - "enabled": false, - "discordClient": "discord", - "channelID": "", - "color": 16761867 - }, { "plugin": "DiscordAdminRequest", "enabled": true, @@ -94,15 +69,24 @@ "color": 16761867 }, { - "plugin": "DiscordChat", - "enabled": true, + "plugin": "DiscordServerStatus", + "enabled": false, "discordClient": "discord", - "channelID": "", - "chatColors": {}, - "color": 16761867, - "ignoreChats": [ - "ChatSquad" - ] + "messageIDs": [], + "updateInterval": 60000, + "disableStatus": false + }, + { + "plugin": "AutoKickUnassigned", + "enabled": true, + "warningMessage": "Join a squad, you are are unassigned and will be kicked", + "kickMessage": "Unassigned - automatically removed", + "frequencyOfWarnings": 30, + "unassignedTimer": 360, + "playerThreshold": 93, + "roundStartDelay": 900, + "ignoreAdmins": false, + "ignoreWhitelist": false }, { "plugin": "DiscordDebug", @@ -112,33 +96,10 @@ "events": [] }, { - "plugin": "DiscordRcon", + "plugin": "IntervalledBroadcasts", "enabled": false, - "discordClient": "discord", - "channelID": "", - "permissions": {}, - "prependAdminNameInBroadcast": false - }, - { - "plugin": "DiscordRoundWinner", - "enabled": true, - "discordClient": "discord", - "channelID": "", - "color": 16761867 - }, - { - "plugin": "DiscordServerStatus", - "enabled": false, - "discordClient": "discord", - "messageIDs": [], - "updateInterval": 60000, - "disableStatus": false - }, - { - "plugin": "DiscordSubsystemRestarter", - "enabled": false, - "discordClient": "discord", - "role": "" + "broadcasts": [], + "interval": 300000 }, { "plugin": "DiscordTeamkill", @@ -148,19 +109,6 @@ "color": 16761867, "disableSCBL": false }, - { - "plugin": "IntervalledBroadcasts", - "enabled": false, - "broadcasts": [], - "interval": 300000 - }, - { - "plugin": "SCBLInfo", - "enabled": true, - "discordClient": "discord", - "channelID": "", - "threshold": 6 - }, { "plugin": "SeedingMode", "enabled": true, @@ -171,10 +119,62 @@ "liveThreshold": 52, "liveMessage": "Live!" }, + { + "plugin": "AutoTKWarn", + "enabled": true, + "message": "Please apologise for ALL TKs in ALL chat!" + }, + { + "plugin": "DBLog", + "enabled": false, + "database": "mysql", + "overrideServerID": null + }, + { + "plugin": "DiscordRoundWinner", + "enabled": true, + "discordClient": "discord", + "channelID": "", + "color": 16761867 + }, + { + "plugin": "ChatCommands", + "enabled": true, + "commands": [ + { + "command": "squadjs", + "type": "warn", + "response": "This server is powered by SquadJS.", + "ignoreChats": [] + } + ] + }, + { + "plugin": "DiscordAdminCamLogs", + "enabled": false, + "discordClient": "discord", + "channelID": "", + "color": 16761867 + }, + { + "plugin": "DiscordRcon", + "enabled": false, + "discordClient": "discord", + "channelID": "", + "permissions": {}, + "prependAdminNameInBroadcast": false + }, { "plugin": "TeamRandomizer", "enabled": true, "command": "randomize" + }, + { + "plugin": "SCBLInfo", + "enabled": true, + "discordClient": "discord", + "channelID": "", + "threshold": 6 } ], "logger": { From 7f050e19092b24a133d9619816af40a2781851ac Mon Sep 17 00:00:00 2001 From: Dusan Milutinovic Date: Thu, 25 Feb 2021 21:26:40 +0100 Subject: [PATCH 2/2] Intervalled Broadcasts on the line 47 causes a crash because of undefined. The code should have been this.options.broadcasts instead of this.broadcasts --- squad-server/plugins/intervalled-broadcasts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squad-server/plugins/intervalled-broadcasts.js b/squad-server/plugins/intervalled-broadcasts.js index 71e5bf7..bb47f87 100644 --- a/squad-server/plugins/intervalled-broadcasts.js +++ b/squad-server/plugins/intervalled-broadcasts.js @@ -44,6 +44,6 @@ export default class IntervalledBroadcasts extends BasePlugin { async broadcast() { await this.server.rcon.broadcast(this.options.broadcasts[0]); - this.broadcasts.push(this.options.broadcasts.shift()); + this.options.broadcasts.push(this.options.broadcasts.shift()); } }