Skip to content

Commit

Permalink
Merge pull request #152 from Thomas-Smyth/beta
Browse files Browse the repository at this point in the history
SquadJS v2.0.4 Release
  • Loading branch information
Thomas-Smyth authored Feb 28, 2021
2 parents 140c3c3 + a60392a commit 97ebbc1
Show file tree
Hide file tree
Showing 7 changed files with 3,531 additions and 11 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,23 @@ 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>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>DiscordSubsystemRestarter</summary>
<h2>DiscordSubsystemRestarter</h2>
Expand Down Expand Up @@ -615,7 +632,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>
Expand Down Expand Up @@ -778,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.

Expand Down
6 changes: 6 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
}
},
"plugins": [
{
"plugin": "DiscordPlaceholder",
"enabled": true,
"discordClient": "discord",
"command": "!placeholder"
},
{
"plugin": "DiscordSubsystemRestarter",
"enabled": false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SquadJS",
"version": "2.0.3",
"version": "2.0.4",
"repository": "https://github.com/Thomas-Smyth/SquadJS.git",
"author": "Thomas Smyth <https://github.com/Thomas-Smyth>",
"license": "BSL-1.0",
Expand Down
2 changes: 1 addition & 1 deletion squad-server/plugins/db-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>'
);
}
Expand Down
49 changes: 49 additions & 0 deletions squad-server/plugins/discord-placeholder.js
Original file line number Diff line number Diff line change
@@ -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.');
}
}
Loading

0 comments on commit 97ebbc1

Please sign in to comment.