mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-28 14:04:25 -05:00
commit
97ebbc149e
27
README.md
27
README.md
@ -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>
|
||||
@ -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>
|
||||
@ -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.
|
||||
|
||||
|
@ -32,6 +32,12 @@
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"plugin": "DiscordPlaceholder",
|
||||
"enabled": true,
|
||||
"discordClient": "discord",
|
||||
"command": "!placeholder"
|
||||
},
|
||||
{
|
||||
"plugin": "DiscordSubsystemRestarter",
|
||||
"enabled": false,
|
||||
|
@ -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",
|
||||
|
@ -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>'
|
||||
);
|
||||
}
|
||||
|
49
squad-server/plugins/discord-placeholder.js
Normal file
49
squad-server/plugins/discord-placeholder.js
Normal 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.');
|
||||
}
|
||||
}
|
3448
squad-server/templates/SquadJS-Dashboard-v2.json
Normal file
3448
squad-server/templates/SquadJS-Dashboard-v2.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -282,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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user