Merge pull request #159 from Thomas-Smyth/beta-temp

Beta temp
This commit is contained in:
Thomas Smyth 2021-03-05 17:30:21 +00:00 committed by GitHub
commit 7fd4029aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 3907 additions and 383 deletions

587
README.md
View File

@ -38,6 +38,8 @@ SquadJS relies on being able to access the Squad server log directory in order t
3. Configure the `config.json` file. See below for more details.
4. Start SquadJS: `node index.js`.
**Note** - We use Yarn Workspaces so `npm install` will not work and will break stuff!
<br>
## **Configuring SquadJS**
@ -265,36 +267,6 @@ 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)
<details>
<summary>AutoTKWarn</summary>
<h2>AutoTKWarn</h2>
<p>The <code>AutoTkWarn</code> plugin will automatically warn players with a message when they teamkill.</p>
<h3>Options</h3>
<ul><li><h4>message</h4>
<h6>Description</h6>
<p>The message to warn players with.</p>
<h6>Default</h6>
<pre><code>Please apologise for ALL TKs in ALL chat!</code></pre></li></ul>
</details>
<details>
<summary>DiscordSubsystemRestarter</summary>
<h2>DiscordSubsystemRestarter</h2>
<p>The <code>DiscordSubSystemRestarter</code> plugin allows you to manually restart SquadJS subsystems in case an issues arises with them.<ul><li><code>!squadjs restartsubsystem rcon</code></li><li><code>!squadjs restartsubsystem logparser</code></li></ul></p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>role (Required)</h4>
<h6>Description</h6>
<p>ID of role required to run the sub system restart commands.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre></ul>
</details>
<details>
<summary>AutoKickUnassigned</summary>
<h2>AutoKickUnassigned</h2>
@ -342,6 +314,37 @@ Interested in creating your own plugin? [See more here](./squad-server/plugins/r
<pre><code>false</code></pre></li></ul>
</details>
<details>
<summary>AutoTKWarn</summary>
<h2>AutoTKWarn</h2>
<p>The <code>AutoTkWarn</code> plugin will automatically warn players with a message when they teamkill.</p>
<h3>Options</h3>
<ul><li><h4>message</h4>
<h6>Description</h6>
<p>The message to warn players with.</p>
<h6>Default</h6>
<pre><code>Please apologise for ALL TKs in ALL chat!</code></pre></li></ul>
</details>
<details>
<summary>ChatCommands</summary>
<h2>ChatCommands</h2>
<p>The <code>ChatCommands</code> plugin can be configured to make chat commands that broadcast or warn the caller with present messages.</p>
<h3>Options</h3>
<ul><li><h4>commands</h4>
<h6>Description</h6>
<p>An array of objects containing the following properties: <ul><li><code>command</code> - The command that initiates the message.</li><li><code>type</code> - Either <code>warn</code> or <code>broadcast</code>.</li><li><code>response</code> - The message to respond with.</li><li><code>ignoreChats</code> - A list of chats to ignore the commands in. Use this to limit it to admins.</li></ul></p>
<h6>Default</h6>
<pre><code>[
{
"command": "squadjs",
"type": "warn",
"response": "This server is powered by SquadJS.",
"ignoreChats": []
}
]</code></pre></li></ul>
</details>
<details>
<summary>DBLog</summary>
<h2>DBLog</h2>
@ -351,7 +354,7 @@ Grafana (NOT YET WORKING WITH V2):
<ul><li> <a href="https://grafana.com/">Grafana</a> is a cool way of viewing server statistics stored in the database.</li>
<li>Install Grafana.</li>
<li>Add your database as a datasource named <code>SquadJS</code>.</li>
<li>Import the <a href="https://github.com/Thomas-Smyth/SquadJS/blob/master/plugins/mysql-log/SquadJS-Dashboard.json">SquadJS Dashboard</a> to get a preconfigured MySQL only Grafana dashboard.</li>
<li>Import the <a href="https://github.com/Thomas-Smyth/SquadJS/blob/master/squad-server/templates/SquadJS-Dashboard-v2.json">SquadJS Dashboard</a> to get a preconfigured MySQL only Grafana dashboard.</li>
<li>Install any missing Grafana plugins.</li></ul></p>
<h3>Options</h3>
<ul><li><h4>database (Required)</h4>
@ -367,9 +370,9 @@ Grafana (NOT YET WORKING WITH V2):
</details>
<details>
<summary>DiscordTeamkill</summary>
<h2>DiscordTeamkill</h2>
<p>The <code>DiscordTeamkill</code> plugin logs teamkills and related information to a Discord channel for admins to review.</p>
<summary>DiscordAdminBroadcast</summary>
<h2>DiscordAdminBroadcast</h2>
<p>The <code>DiscordAdminBroadcast</code> plugin will send a copy of admin broadcasts made in game to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
@ -378,20 +381,38 @@ Grafana (NOT YET WORKING WITH V2):
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log teamkills to.</p>
<p>The ID of the channel to log admin broadcasts to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embeds.</p>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li>
<li><h4>disableSCBL</h4>
<pre><code>16761867</code></pre></li></ul>
</details>
<details>
<summary>DiscordAdminCamLogs</summary>
<h2>DiscordAdminCamLogs</h2>
<p>The <code>DiscordAdminCamLogs</code> plugin will log in game admin camera usage to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Disable Squad Community Ban List information.</p>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>false</code></pre></li></ul>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin camera usage to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li></ul>
</details>
<details>
@ -451,6 +472,244 @@ Grafana (NOT YET WORKING WITH V2):
<pre><code>16761867</code></pre></li></ul>
</details>
<details>
<summary>DiscordChat</summary>
<h2>DiscordChat</h2>
<p>The <code>DiscordChat</code> plugin will log in-game chat to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin broadcasts to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>chatColors</h4>
<h6>Description</h6>
<p>The color of the embed for each chat.</p>
<h6>Default</h6>
<pre><code>{}</code></pre></li><h6>Example</h6>
<pre><code>{
"ChatAll": 16761867
}</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li>
<li><h4>ignoreChats</h4>
<h6>Description</h6>
<p>A list of chat names to ignore.</p>
<h6>Default</h6>
<pre><code>[
"ChatSquad"
]</code></pre></li></ul>
</details>
<details>
<summary>DiscordDebug</summary>
<h2>DiscordDebug</h2>
<p>The <code>DiscordDebug</code> plugin can be used to help debug SquadJS by dumping SquadJS events to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log events to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>events (Required)</h4>
<h6>Description</h6>
<p>A list of events to dump.</p>
<h6>Default</h6>
<pre><code>[]</code></pre></li><h6>Example</h6>
<pre><code>[
"PLAYER_DIED"
]</code></pre></ul>
</details>
<details>
<summary>DiscordPlaceholder</summary>
<h2>DiscordPlaceholder</h2>
<p>The <code>DiscordPlaceholder</code> plugin allows you to make your bot create placeholder messages that can be used when configuring other plugins.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>command</h4>
<h6>Description</h6>
<p>Command to create Discord placeholder.</p>
<h6>Default</h6>
<pre><code>!placeholder</code></pre></li></ul>
</details>
<details>
<summary>DiscordRcon</summary>
<h2>DiscordRcon</h2>
<p>The <code>DiscordRcon</code> plugin allows a specified Discord channel to be used as a RCON console to run RCON commands.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>ID of channel to turn into RCON console.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>permissions</h4>
<h6>Description</h6>
<p><ul><li>Dictionary of roles and a list of the permissions they are allowed to use.<li>If dictionary is empty (<code>{}</code>) permissions will be disabled</li><li>A list of available RCON commands can be found here <a>https://squad.gamepedia.com/Server_Administration#Admin_Console_Commands</a>.</ul></p>
<h6>Default</h6>
<pre><code>{}</code></pre></li><h6>Example</h6>
<pre><code>{
"123456789123456789": [
"AdminBroadcast",
"AdminForceTeamChange",
"AdminDemoteCommander"
]
}</code></pre>
<li><h4>prependAdminNameInBroadcast</h4>
<h6>Description</h6>
<p>Prepend admin names when making announcements.</p>
<h6>Default</h6>
<pre><code>false</code></pre></li></ul>
</details>
<details>
<summary>DiscordRoundWinner</summary>
<h2>DiscordRoundWinner</h2>
<p>The <code>DiscordRoundWinner</code> plugin will send the round winner to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin broadcasts to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li></ul>
</details>
<details>
<summary>DiscordServerStatus</summary>
<h2>DiscordServerStatus</h2>
<p>The <code>DiscordServerStatus</code> plugin updates a message in Discord with current server information, e.g. player count.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>messageIDs (Required)</h4>
<h6>Description</h6>
<p>ID of messages to update.</p>
<h6>Default</h6>
<pre><code>[]</code></pre></li><h6>Example</h6>
<pre><code>[
{
"channelID": "667741905228136459",
"messageID": "766688383043895387"
}
]</code></pre>
<li><h4>updateInterval</h4>
<h6>Description</h6>
<p>How frequently to update the status in Discord.</p>
<h6>Default</h6>
<pre><code>60000</code></pre></li>
<li><h4>disableStatus</h4>
<h6>Description</h6>
<p>Disable the bot status.</p>
<h6>Default</h6>
<pre><code>false</code></pre></li></ul>
</details>
<details>
<summary>DiscordSubsystemRestarter</summary>
<h2>DiscordSubsystemRestarter</h2>
<p>The <code>DiscordSubSystemRestarter</code> plugin allows you to manually restart SquadJS subsystems in case an issues arises with them.<ul><li><code>!squadjs restartsubsystem rcon</code></li><li><code>!squadjs restartsubsystem logparser</code></li></ul></p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>role (Required)</h4>
<h6>Description</h6>
<p>ID of role required to run the sub system restart commands.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre></ul>
</details>
<details>
<summary>DiscordTeamkill</summary>
<h2>DiscordTeamkill</h2>
<p>The <code>DiscordTeamkill</code> plugin logs teamkills and related information to a Discord channel for admins to review.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log teamkills to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embeds.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li>
<li><h4>disableSCBL</h4>
<h6>Description</h6>
<p>Disable Squad Community Ban List information.</p>
<h6>Default</h6>
<pre><code>false</code></pre></li></ul>
</details>
<details>
<summary>IntervalledBroadcasts</summary>
<h2>IntervalledBroadcasts</h2>
<p>The <code>IntervalledBroadcasts</code> plugin allows you to set broadcasts, which will be broadcasted at preset intervals</p>
<h3>Options</h3>
<ul><li><h4>broadcasts</h4>
<h6>Description</h6>
<p>Messages to broadcast.</p>
<h6>Default</h6>
<pre><code>[]</code></pre></li><h6>Example</h6>
<pre><code>[
"This server is powered by SquadJS."
]</code></pre>
<li><h4>interval</h4>
<h6>Description</h6>
<p>Frequency of the broadcasts in milliseconds.</p>
<h6>Default</h6>
<pre><code>300000</code></pre></li></ul>
</details>
<details>
<summary>SCBLInfo</summary>
<h2>SCBLInfo</h2>
@ -511,86 +770,6 @@ Grafana (NOT YET WORKING WITH V2):
<pre><code>Live!</code></pre></li></ul>
</details>
<details>
<summary>DiscordAdminBroadcast</summary>
<h2>DiscordAdminBroadcast</h2>
<p>The <code>DiscordAdminBroadcast</code> plugin will send a copy of admin broadcasts made in game to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin broadcasts to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li></ul>
</details>
<details>
<summary>DiscordChat</summary>
<h2>DiscordChat</h2>
<p>The <code>DiscordChat</code> plugin will log in-game chat to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin broadcasts to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>chatColors</h4>
<h6>Description</h6>
<p>The color of the embed for each chat.</p>
<h6>Default</h6>
<pre><code>{}</code></pre></li><h6>Example</h6>
<pre><code>{
"ChatAll": 16761867
}</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li>
<li><h4>ignoreChats</h4>
<h6>Description</h6>
<p>A list of chat names to ignore.</p>
<h6>Default</h6>
<pre><code>[
"ChatSquad"
]</code></pre></li></ul>
</details>
<details>
<summary>ChatCommands</summary>
<h2>ChatCommands</h2>
<p>The <code>ChatCommands</code> plugin can be configured to make chat commands that broadcast or warn the caller with present messages.</p>
<h3>Options</h3>
<ul><li><h4>commands</h4>
<h6>Description</h6>
<p>An array of objects containing the following properties: <ul><li><code>command</code> - The command that initiates the message.</li><li><code>type</code> - Either <code>warn</code> or <code>broadcast</code>.</li><li><code>response</code> - The message to respond with.</li><li><code>ignoreChats</code> - A list of chats to ignore the commands in. Use this to limit it to admins.</li></ul></p>
<h6>Default</h6>
<pre><code>[
{
"command": "squadjs",
"type": "warn",
"response": "This server is powered by SquadJS.",
"ignoreChats": []
}
]</code></pre></li></ul>
</details>
<details>
<summary>TeamRandomizer</summary>
<h2>TeamRandomizer</h2>
@ -603,166 +782,6 @@ Grafana (NOT YET WORKING WITH V2):
<pre><code>randomize</code></pre></li></ul>
</details>
<details>
<summary>DiscordDebug</summary>
<h2>DiscordDebug</h2>
<p>The <code>DiscordDebug</code> plugin can be used to help debug SquadJS by dumping SquadJS events to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log events to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>events (Required)</h4>
<h6>Description</h6>
<p>A list of events to dump.</p>
<h6>Default</h6>
<pre><code>[]</code></pre></li><h6>Example</h6>
<pre><code>[
"PLAYER_DIED"
]</code></pre></ul>
</details>
<details>
<summary>DiscordRoundWinner</summary>
<h2>DiscordRoundWinner</h2>
<p>The <code>DiscordRoundWinner</code> plugin will send the round winner to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin broadcasts to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li></ul>
</details>
<details>
<summary>DiscordRcon</summary>
<h2>DiscordRcon</h2>
<p>The <code>DiscordRcon</code> plugin allows a specified Discord channel to be used as a RCON console to run RCON commands.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>ID of channel to turn into RCON console.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>permissions</h4>
<h6>Description</h6>
<p><ul><li>Dictionary of roles and a list of the permissions they are allowed to use.<li>If dictionary is empty (<code>{}</code>) permissions will be disabled</li><li>A list of available RCON commands can be found here <a>https://squad.gamepedia.com/Server_Administration#Admin_Console_Commands</a>.</ul></p>
<h6>Default</h6>
<pre><code>{}</code></pre></li><h6>Example</h6>
<pre><code>{
"123456789123456789": [
"AdminBroadcast",
"AdminForceTeamChange",
"AdminDemoteCommander"
]
}</code></pre>
<li><h4>prependAdminNameInBroadcast</h4>
<h6>Description</h6>
<p>Prepend admin names when making announcements.</p>
<h6>Default</h6>
<pre><code>false</code></pre></li></ul>
</details>
<details>
<summary>IntervalledBroadcasts</summary>
<h2>IntervalledBroadcasts</h2>
<p>The <code>IntervalledBroadcasts</code> plugin allows you to set broadcasts, which will be broadcasted at preset intervals</p>
<h3>Options</h3>
<ul><li><h4>broadcasts</h4>
<h6>Description</h6>
<p>Messages to broadcast.</p>
<h6>Default</h6>
<pre><code>[]</code></pre></li><h6>Example</h6>
<pre><code>[
"This server is powered by SquadJS."
]</code></pre>
<li><h4>interval</h4>
<h6>Description</h6>
<p>Frequency of the broadcasts in milliseconds.</p>
<h6>Default</h6>
<pre><code>300000</code></pre></li></ul>
</details>
<details>
<summary>DiscordServerStatus</summary>
<h2>DiscordServerStatus</h2>
<p>The <code>DiscordServerStatus</code> plugin updates a message in Discord with current server information, e.g. player count.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>messageIDs (Required)</h4>
<h6>Description</h6>
<p>ID of messages to update.</p>
<h6>Default</h6>
<pre><code>[]</code></pre></li><h6>Example</h6>
<pre><code>[
{
"channelID": "667741905228136459",
"messageID": "766688383043895387"
}
]</code></pre>
<li><h4>updateInterval</h4>
<h6>Description</h6>
<p>How frequently to update the status in Discord.</p>
<h6>Default</h6>
<pre><code>60000</code></pre></li>
<li><h4>disableStatus</h4>
<h6>Description</h6>
<p>Disable the bot status.</p>
<h6>Default</h6>
<pre><code>false</code></pre></li></ul>
</details>
<details>
<summary>DiscordAdminCamLogs</summary>
<h2>DiscordAdminCamLogs</h2>
<p>The <code>DiscordAdminCamLogs</code> plugin will log in game admin camera usage to a Discord channel.</p>
<h3>Options</h3>
<ul><li><h4>discordClient (Required)</h4>
<h6>Description</h6>
<p>Discord connector name.</p>
<h6>Default</h6>
<pre><code>discord</code></pre></li>
<li><h4>channelID (Required)</h4>
<h6>Description</h6>
<p>The ID of the channel to log admin camera usage to.</p>
<h6>Default</h6>
<pre><code></code></pre></li><h6>Example</h6>
<pre><code>667741905228136459</code></pre>
<li><h4>color</h4>
<h6>Description</h6>
<p>The color of the embed.</p>
<h6>Default</h6>
<pre><code>16761867</code></pre></li></ul>
</details>
<br>
## Statement on Accuracy
@ -776,11 +795,11 @@ Below is a list of scenarios we know may cause some information to be inaccurate
* Duplicated Player Names - If two or more players have the same name or suffix name (see above) then SquadJS will be unable to identify them in the logs. When this occurs event logs will show the player as `null`. Be on the watch for groups of players who try to abuse this in order to TK or complete other malicious actions without being detected by SquadJS plugins.
## Credits
SquadJS would not be possible without the support of so many individuals and organisations. My thanks goes out to:
* [SquadJS's contributors](https://github.com/Thomas-Smyth/SquadJS/graphs/contributors).
* [My GitHub sponsors](https://github.com/sponsors/Thomas-Smyth)!
SquadJS would not be possible without the support of so many individuals and organisations. Our thanks goes out to:
* [SquadJS's contributors](https://github.com/Thomas-Smyth/SquadJS/graphs/contributors)
* [Thomas Smyth's GitHub sponsors](https://github.com/sponsors/Thomas-Smyth)
* subtlerod for proposing the initial log parsing idea, helping to design the log parsing process and for providing multiple servers to test with.
* Fourleaf, Mex and various other members of ToG / ToG-L for helping to stage logs and participate in small scale tests.
* Fourleaf, Mex, various members of ToG / ToG-L and others that helped to stage logs and participate in small scale tests.
* Various Squad servers/communities for participating in larger scale tests and for providing feedback on plugins.
* Everyone in the Squad RCON Discord and others who have submitted bug reports, suggestions, feedback and provided logs.

View File

@ -32,17 +32,6 @@
}
},
"plugins": [
{
"plugin": "AutoTKWarn",
"enabled": true,
"message": "Please apologise for ALL TKs in ALL chat!"
},
{
"plugin": "DiscordSubsystemRestarter",
"enabled": false,
"discordClient": "discord",
"role": ""
},
{
"plugin": "AutoKickUnassigned",
"enabled": true,
@ -55,6 +44,23 @@
"ignoreAdmins": false,
"ignoreWhitelist": false
},
{
"plugin": "AutoTKWarn",
"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": []
}
]
},
{
"plugin": "DBLog",
"enabled": false,
@ -62,12 +68,18 @@
"overrideServerID": null
},
{
"plugin": "DiscordTeamkill",
"enabled": true,
"plugin": "DiscordAdminBroadcast",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"color": 16761867,
"disableSCBL": false
"color": 16761867
},
{
"plugin": "DiscordAdminCamLogs",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"color": 16761867
},
{
"plugin": "DiscordAdminRequest",
@ -81,6 +93,73 @@
"pingDelay": 60000,
"color": 16761867
},
{
"plugin": "DiscordChat",
"enabled": true,
"discordClient": "discord",
"channelID": "",
"chatColors": {},
"color": 16761867,
"ignoreChats": [
"ChatSquad"
]
},
{
"plugin": "DiscordDebug",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"events": []
},
{
"plugin": "DiscordPlaceholder",
"enabled": true,
"discordClient": "discord",
"command": "!placeholder"
},
{
"plugin": "DiscordRcon",
"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": ""
},
{
"plugin": "DiscordTeamkill",
"enabled": true,
"discordClient": "discord",
"channelID": "",
"color": 16761867,
"disableSCBL": false
},
{
"plugin": "IntervalledBroadcasts",
"enabled": false,
"broadcasts": [],
"interval": 300000
},
{
"plugin": "SCBLInfo",
"enabled": true,
@ -98,83 +177,10 @@
"liveThreshold": 52,
"liveMessage": "Live!"
},
{
"plugin": "DiscordAdminBroadcast",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"color": 16761867
},
{
"plugin": "DiscordChat",
"enabled": true,
"discordClient": "discord",
"channelID": "",
"chatColors": {},
"color": 16761867,
"ignoreChats": [
"ChatSquad"
]
},
{
"plugin": "ChatCommands",
"enabled": true,
"commands": [
{
"command": "squadjs",
"type": "warn",
"response": "This server is powered by SquadJS.",
"ignoreChats": []
}
]
},
{
"plugin": "TeamRandomizer",
"enabled": true,
"command": "randomize"
},
{
"plugin": "DiscordDebug",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"events": []
},
{
"plugin": "DiscordRoundWinner",
"enabled": true,
"discordClient": "discord",
"channelID": "",
"color": 16761867
},
{
"plugin": "DiscordRcon",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"permissions": {},
"prependAdminNameInBroadcast": false
},
{
"plugin": "IntervalledBroadcasts",
"enabled": false,
"broadcasts": [],
"interval": 300000
},
{
"plugin": "DiscordServerStatus",
"enabled": false,
"discordClient": "discord",
"messageIDs": [],
"updateInterval": 60000,
"disableStatus": false
},
{
"plugin": "DiscordAdminCamLogs",
"enabled": false,
"discordClient": "discord",
"channelID": "",
"color": 16761867
}
],
"logger": {

View File

@ -1,6 +1,6 @@
{
"name": "SquadJS",
"version": "2.0.2",
"version": "2.0.4",
"repository": "https://github.com/Thomas-Smyth/SquadJS.git",
"author": "Thomas Smyth <https://github.com/Thomas-Smyth>",
"license": "BSL-1.0",

View File

@ -438,7 +438,7 @@ export default class SquadServer extends EventEmitter {
queryPort: this.options.queryPort,
name: this.serverName,
playerCount: this.players.length
playerCount: this.a2sPlayerCount + this.publicQueue + this.reserveQueue
},
// Send information about SquadJS.
@ -470,7 +470,7 @@ export default class SquadServer extends EventEmitter {
`Successfully pinged the SquadJS API. Got back message: ${data.message}`
);
} catch (err) {
Logger.verbose('SquadServer', 1, 'Failed to ping the SquadJS API: ', err);
Logger.verbose('SquadServer', 1, 'Failed to ping the SquadJS API: ', err.message);
}
this.pingSquadJSAPITimeout = setTimeout(this.pingSquadJSAPI, this.pingSquadJSAPIInterval);

View File

@ -1,7 +1,7 @@
export default class Layer {
constructor(data) {
this.name = data.Name;
this.classname = data.rawName;
this.classname = data.levelName;
this.map = {
name: data.mapName
};

View File

@ -22,7 +22,7 @@ class Layers {
Logger.verbose('Layers', 1, 'Pulling layers...');
const response = await axios.get(
'https://raw.githubusercontent.com/Squad-Wiki-Editorial/squad-wiki-pipeline-map-data/dev/completed_output/2.0/finished_2.0.json'
'https://raw.githubusercontent.com/Squad-Wiki-Editorial/squad-wiki-pipeline-map-data/dev/completed_output/_Current%20Version/finished.json'
);
for (const layer of response.data.Maps) {

View File

@ -14,7 +14,7 @@ export default class DBLog extends BasePlugin {
'<ul><li> <a href="https://grafana.com/">Grafana</a> is a cool way of viewing server statistics stored in the database.</li>\n' +
'<li>Install Grafana.</li>\n' +
'<li>Add your database as a datasource named <code>SquadJS</code>.</li>\n' +
'<li>Import the <a href="https://github.com/Thomas-Smyth/SquadJS/blob/master/plugins/mysql-log/SquadJS-Dashboard.json">SquadJS Dashboard</a> to get a preconfigured MySQL only Grafana dashboard.</li>\n' +
'<li>Import the <a href="https://github.com/Thomas-Smyth/SquadJS/blob/master/squad-server/templates/SquadJS-Dashboard-v2.json">SquadJS Dashboard</a> to get a preconfigured MySQL only Grafana dashboard.</li>\n' +
'<li>Install any missing Grafana plugins.</li></ul>'
);
}

View File

@ -0,0 +1,49 @@
import BasePlugin from './base-plugin.js';
export default class DiscordPlaceholder extends BasePlugin {
static get description() {
return (
'The <code>DiscordPlaceholder</code> plugin allows you to make your bot create placeholder messages that ' +
'can be used when configuring other plugins.'
);
}
static get defaultEnabled() {
return true;
}
static get optionsSpecification() {
return {
discordClient: {
required: true,
description: 'Discord connector name.',
connector: 'discord',
default: 'discord'
},
command: {
required: false,
description: 'Command to create Discord placeholder.',
default: '!placeholder'
}
};
}
constructor(server, options, connectors) {
super(server, options, connectors);
this.onMessage = this.onMessage.bind(this);
}
async mount() {
this.options.discordClient.on('message', this.onMessage);
}
async unmount() {
this.options.discordClient.removeEventListener('message', this.onMessage);
}
async onMessage(message) {
if (message.author.bot) return;
await message.channel.send('Placeholder.');
}
}

View File

@ -69,7 +69,7 @@ export default class DiscordServerStatus extends BasePlugin {
await this.options.discordClient.user.setActivity(
`(${this.server.a2sPlayerCount}/${this.server.publicSlots}) ${
this.server.layerHistory[0].layer.name || 'Unknown'
this.server.currentLayer.name || 'Unknown'
}`,
{ type: 'WATCHING' }
);

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,8 @@ SquadJS relies on being able to access the Squad server log directory in order t
3. Configure the `config.json` file. See below for more details.
4. Start SquadJS: `node index.js`.
**Note** - We use Yarn Workspaces so `npm install` will not work and will break stuff!
<br>
## **Configuring SquadJS**
@ -280,11 +282,11 @@ Below is a list of scenarios we know may cause some information to be inaccurate
* Duplicated Player Names - If two or more players have the same name or suffix name (see above) then SquadJS will be unable to identify them in the logs. When this occurs event logs will show the player as `null`. Be on the watch for groups of players who try to abuse this in order to TK or complete other malicious actions without being detected by SquadJS plugins.
## Credits
SquadJS would not be possible without the support of so many individuals and organisations. My thanks goes out to:
* [SquadJS's contributors](https://github.com/Thomas-Smyth/SquadJS/graphs/contributors).
* [My GitHub sponsors](https://github.com/sponsors/Thomas-Smyth)!
SquadJS would not be possible without the support of so many individuals and organisations. Our thanks goes out to:
* [SquadJS's contributors](https://github.com/Thomas-Smyth/SquadJS/graphs/contributors)
* [Thomas Smyth's GitHub sponsors](https://github.com/sponsors/Thomas-Smyth)
* subtlerod for proposing the initial log parsing idea, helping to design the log parsing process and for providing multiple servers to test with.
* Fourleaf, Mex and various other members of ToG / ToG-L for helping to stage logs and participate in small scale tests.
* Fourleaf, Mex, various members of ToG / ToG-L and others that helped to stage logs and participate in small scale tests.
* Various Squad servers/communities for participating in larger scale tests and for providing feedback on plugins.
* Everyone in the Squad RCON Discord and others who have submitted bug reports, suggestions, feedback and provided logs.