mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-28 11:54:23 -05:00
Roll foward
This commit is contained in:
commit
6cce309bea
133
README.md
133
README.md
@ -114,74 +114,6 @@ Connectors should be named, for example the above is named `discord`, and should
|
||||
|
||||
See below for more details on connectors and their associated config.
|
||||
|
||||
##### Squad Layer Filter
|
||||
Connects to a filtered list of Squad layers and filters them either by an "initial filter" or an "active filter" that depends on current server information, e.g. player count.
|
||||
```js
|
||||
"layerFilter": {
|
||||
"type": "buildPoolFromFilter",
|
||||
"filter": {
|
||||
"whitelistedLayers": null,
|
||||
"blacklistedLayers": null,
|
||||
"whitelistedMaps": null,
|
||||
"blacklistedMaps": null,
|
||||
"whitelistedGamemodes": null,
|
||||
"blacklistedGamemodes": [
|
||||
"Training"
|
||||
],
|
||||
"flagCountMin": null,
|
||||
"flagCountMax": null,
|
||||
"hasCommander": null,
|
||||
"hasTanks": null,
|
||||
"hasHelicopters": null
|
||||
},
|
||||
"activeLayerFilter": {
|
||||
"historyResetTime": 18000000,
|
||||
"layerHistoryTolerance": 8,
|
||||
"mapHistoryTolerance": 4,
|
||||
"gamemodeHistoryTolerance": {
|
||||
"Invasion": 4
|
||||
},
|
||||
"gamemodeRepetitiveTolerance": {
|
||||
"Invasion": 4
|
||||
},
|
||||
"playerCountComplianceEnabled": true,
|
||||
"factionComplianceEnabled": true,
|
||||
"factionHistoryTolerance": {
|
||||
"RUS": 4
|
||||
},
|
||||
"factionRepetitiveTolerance": {
|
||||
"RUS": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
```
|
||||
* `type` - The type of filter builder to use. `filter` will depend on this type.
|
||||
- `buildPoolFromFilter` - Builds the Squad layers list from a list of filters. An example `filter` with default values for this type is show above.
|
||||
- `whitelistedLayers` - List of layers to consider.
|
||||
- `blacklistLayers` - List of layers to not consider.
|
||||
- `whitelistedMaps` - List of maps to consider.
|
||||
- `blacklistedMaps` - List of maps to not consider.
|
||||
- `whitelistedGamemodes` - List of gamemodes to consider.
|
||||
- `blacklistedGamemodes` - List of gamemodes to not consider.
|
||||
- `flagCountMin` - Minimum number of flags the layer may have.
|
||||
- `flagCountMax` - Maximum number of flags the layer may have.
|
||||
- `hasCommander` - Layer must/most not have a commander. `null` for either.
|
||||
- `hasTanks` - Layer must/most not have a tanks. `null` for either.
|
||||
- `hasHelicopters` - Layer must/most not have a helicopters. `null` for either.
|
||||
- `buildPoolFromFile` - Builds the Squad layers list from a Squad layer config file. `filter` should be the filename of the config file.
|
||||
- `buildPoolFromLayerNames` - Builds the Squad layers list from a list of layers. `filter` should be a list of layers, e.g. `"filter": ["Sumari AAS v1", "Fool's Road AAS v1"]`.
|
||||
* `filter` - Described above.
|
||||
* `activeLayerFilter` - Filters layers live as server information updates, e.g. if the player count exceeds a certain amount a layer may no longer be in the filter.
|
||||
- `historyResetTime` - After this number of milliseconds the layer history is no longer considered.
|
||||
- `layerHistoryTolerance` - A layer can only be played again after this number of layers.
|
||||
- `mapHistoryTolerance` - A map can only be played again after this number of layers.
|
||||
- `gamemodeHistoryTolerance` - A gamemode can only be played again after this number of layers. Gamemodes can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
- `gamemodeRepetitiveTolerance` - A gamemode can only be played this number of times in a row. Gamemodes can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
- `playerCountComplianceEnabled` - Filter layers by player count.
|
||||
- `factionComplianceEnabled` - Filter layers so that a team cannot play the same faction twice in a row.
|
||||
- `factionHistoryTolerance` - A faction can only be played again after this number of layers. Factions can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
- `factionRepetitiveTolerance` - A faction can only be played this number of times in a row. Factions can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
|
||||
##### Discord
|
||||
Connects to Discord via `discord.js`.
|
||||
```json
|
||||
@ -321,11 +253,39 @@ Interested in creating your own plugin? [See more here](./squad-server/plugins/r
|
||||
<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>
|
||||
<ul><li><h4>attackerMessage</h4>
|
||||
<h6>Description</h6>
|
||||
<p>The message to warn players with.</p>
|
||||
<p>The message to warn attacking players with.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>Please apologise for ALL TKs in ALL chat!</code></pre></li></ul>
|
||||
<pre><code>Please apologise for ALL TKs in ALL chat!</code></pre></li>
|
||||
<li><h4>victimMessage</h4>
|
||||
<h6>Description</h6>
|
||||
<p>The message that will be sent to the victim.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>null</code></pre></li></ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CBLInfo</summary>
|
||||
<h2>CBLInfo</h2>
|
||||
<p>The <code>CBLInfo</code> plugin alerts admins when a harmful player is detected joining their server based on data from the <a href="https://communitybanlist.com/">Community Ban List</a>.</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 alert admins through.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code></code></pre></li><h6>Example</h6>
|
||||
<pre><code>667741905228136459</code></pre>
|
||||
<li><h4>threshold</h4>
|
||||
<h6>Description</h6>
|
||||
<p>Admins will be alerted when a player has this or more reputation points. For more information on reputation points, see the <a href="https://communitybanlist.com/faq">Community Ban List's FAQ</a></p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>6</code></pre></li></ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
@ -592,9 +552,9 @@ Grafana:
|
||||
<p>The color of the embeds.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>16761867</code></pre></li>
|
||||
<li><h4>disableSCBL</h4>
|
||||
<li><h4>disableCBL</h4>
|
||||
<h6>Description</h6>
|
||||
<p>Disable Squad Community Ban List information.</p>
|
||||
<p>Disable Community Ban List information.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>false</code></pre></li></ul>
|
||||
</details>
|
||||
@ -783,9 +743,9 @@ Grafana:
|
||||
<p>The color of the embeds.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>16761867</code></pre></li>
|
||||
<li><h4>disableSCBL</h4>
|
||||
<li><h4>disableCBL</h4>
|
||||
<h6>Description</h6>
|
||||
<p>Disable Squad Community Ban List information.</p>
|
||||
<p>Disable Community Ban List information.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>false</code></pre></li></ul>
|
||||
</details>
|
||||
@ -827,29 +787,6 @@ Grafana:
|
||||
<pre><code>300000</code></pre></li></ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>SCBLInfo</summary>
|
||||
<h2>SCBLInfo</h2>
|
||||
<p>The <code>SCBLInfo</code> plugin alerts admins when a harmful player is detected joining their server based on data from the <a href="https://squad-community-ban-list.com/">Squad Community Ban List</a>.</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 alert admins through.</p>
|
||||
<h6>Default</h6>
|
||||
<pre><code></code></pre></li><h6>Example</h6>
|
||||
<pre><code>667741905228136459</code></pre>
|
||||
<li><h4>threshold</h4>
|
||||
<h6>Description</h6>
|
||||
<p>Admins will be alerted when a player has this or more reputation points. For more information on reputation points, see the <a href="https://squad-community-ban-list.com/faq">Squad Community Ban List's FAQ</a></p>
|
||||
<h6>Default</h6>
|
||||
<pre><code>6</code></pre></li></ul>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>SeedingMode</summary>
|
||||
<h2>SeedingMode</h2>
|
||||
|
21
config.json
21
config.json
@ -55,7 +55,15 @@
|
||||
{
|
||||
"plugin": "AutoTKWarn",
|
||||
"enabled": true,
|
||||
"message": "Please apologise for ALL TKs in ALL chat!"
|
||||
"attackerMessage": "Please apologise for ALL TKs in ALL chat!",
|
||||
"victimMessage": null
|
||||
},
|
||||
{
|
||||
"plugin": "CBLInfo",
|
||||
"enabled": true,
|
||||
"discordClient": "discord",
|
||||
"channelID": "",
|
||||
"threshold": 6
|
||||
},
|
||||
{
|
||||
"plugin": "ChatCommands",
|
||||
@ -134,7 +142,7 @@
|
||||
"discordClient": "discord",
|
||||
"channelID": "",
|
||||
"color": 16761867,
|
||||
"disableSCBL": false
|
||||
"disableCBL": false
|
||||
},
|
||||
{
|
||||
"plugin": "DiscordPlaceholder",
|
||||
@ -188,7 +196,7 @@
|
||||
"discordClient": "discord",
|
||||
"channelID": "",
|
||||
"color": 16761867,
|
||||
"disableSCBL": false
|
||||
"disableCBL": false
|
||||
},
|
||||
{
|
||||
"plugin": "FogOfWar",
|
||||
@ -202,13 +210,6 @@
|
||||
"broadcasts": [],
|
||||
"interval": 300000
|
||||
},
|
||||
{
|
||||
"plugin": "SCBLInfo",
|
||||
"enabled": true,
|
||||
"discordClient": "discord",
|
||||
"channelID": "",
|
||||
"threshold": 6
|
||||
},
|
||||
{
|
||||
"plugin": "SeedingMode",
|
||||
"enabled": true,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "SquadJS",
|
||||
"version": "3.1.0",
|
||||
"version": "3.6.1",
|
||||
"repository": "https://github.com/Team-Silver-Sphere/SquadJS.git",
|
||||
"author": "Thomas Smyth <https://github.com/Thomas-Smyth>",
|
||||
"license": "BSL-1.0",
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQDeployable::)?TakeDamage\(\): ([A-z0-9_]+)_C_[0-9]+: ([0-9.]+) damage attempt by causer ([A-z0-9_]+)_C_[0-9]+ instigator (.+) with damage type ([A-z0-9_]+)_C health remaining ([0-9.]+)/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQDeployable::)?TakeDamage\(\): ([A-z0-9_]+)_C_[0-9]+: ([0-9.]+) damage attempt by causer ([A-z0-9_]+)_C_[0-9]+ instigator (.+) with damage type ([A-z0-9_]+)_C health remaining ([0-9.]+)/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
raw: args[0],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquad: Player:(.+) ActualDamage=([0-9.]+) from (.+) caused by ([A-z_0-9]+)_C/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquad: Player:(.+) ActualDamage=([0-9.]+) from (.+) caused by ([A-z_0-9-]+)_C/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
raw: args[0],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQSoldier::)?Die\(\): Player:(.+) KillingDamage=(?:-)*([0-9.]+) from ([A-z_0-9]+) caused by ([A-z_0-9]+)_C/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQSoldier::)?Die\(\): Player:(.+) KillingDamage=(?:-)*([0-9.]+) from ([A-z_0-9]+) caused by ([A-z_0-9-]+)_C/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
...logParser.eventStore[args[3]],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogEasyAntiCheatServer: \[[0-9:]+] \[[A-z]+] \[EAC Server] \[Info] \[UnregisterClient] Client: ([A-z0-9]+) PlayerGUID: ([0-9]{17})/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogEasyAntiCheatServer: \[[0-9:]+] \[[A-z]+] \[EAC Server] \[Info] \[UnregisterClient] Client: ([A-z0-9]+) PlayerGUID: ([0-9]{17})/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
raw: args[0],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQPlayerController::)?OnPossess\(\): PC=(.+) Pawn=([A-z0-9_]+)_C/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQPlayerController::)?OnPossess\(\): PC=(.+) Pawn=([A-z0-9_]+)_C/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
raw: args[0],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQPlayerController::)?OnUnPossess\(\): PC=(.+)/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQPlayerController::)?OnUnPossess\(\): PC=(.+)/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
raw: args[0],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQSoldier::)?Wound\(\): Player:(.+) KillingDamage=(?:-)*([0-9.]+) from ([A-z_0-9]+) caused by ([A-z_0-9]+)_C/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQSoldier::)?Wound\(\): Player:(.+) KillingDamage=(?:-)*([0-9.]+) from ([A-z_0-9]+) caused by ([A-z_0-9-]+)_C/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
...logParser.eventStore[args[3]],
|
||||
|
@ -1,5 +1,6 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQGameMode::)?DetermineMatchWinner\(\): (.+) won on (.+)/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQGameMode::)?DetermineMatchWinner\(\): (.+) won on (.+)/,
|
||||
onMatch: (args, logParser) => {
|
||||
const data = {
|
||||
raw: args[0],
|
||||
|
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogEasyAntiCheatServer: \[[0-9:]+] \[[A-z]+] \[EAC Server] \[Info] \[RegisterClient] Client: ([A-z0-9]+) PlayerGUID: ([0-9]{17}) PlayerIP: [0-9]{17} OwnerGUID: [0-9]{17} PlayerName: (.+)/,
|
||||
regex:
|
||||
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogEasyAntiCheatServer: \[[0-9:]+] \[[A-z]+] \[EAC Server] \[Info] \[RegisterClient] Client: ([A-z0-9]+) PlayerGUID: ([0-9]{17}) PlayerIP: [0-9]{17} OwnerGUID: [0-9]{17} PlayerName: (.+)/,
|
||||
onMatch: async (args, logParser) => {
|
||||
logParser.eventStore['steamid-connected'] = args[4];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -11,10 +11,15 @@ export default class AutoTKWarn extends BasePlugin {
|
||||
|
||||
static get optionsSpecification() {
|
||||
return {
|
||||
message: {
|
||||
attackerMessage: {
|
||||
required: false,
|
||||
description: 'The message to warn players with.',
|
||||
description: 'The message to warn attacking players with.',
|
||||
default: 'Please apologise for ALL TKs in ALL chat!'
|
||||
},
|
||||
victimMessage: {
|
||||
required: false,
|
||||
description: 'The message that will be sent to the victim.',
|
||||
default: null // 'You were killed by your own team.'
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -34,8 +39,11 @@ export default class AutoTKWarn extends BasePlugin {
|
||||
}
|
||||
|
||||
async onTeamkill(info) {
|
||||
if (!info.attacker) return;
|
||||
|
||||
await this.server.rcon.warn(info.attacker.steamID, this.options.message);
|
||||
if (info.attacker && this.options.attackerMessage) {
|
||||
this.server.rcon.warn(info.attacker.steamID, this.options.attackerMessage);
|
||||
}
|
||||
if (info.victim && this.options.victimMessage) {
|
||||
this.server.rcon.warn(info.victim.steamID, this.options.victimMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@ import DiscordBasePlugin from './discord-base-plugin.js';
|
||||
|
||||
const { request, gql } = GraphQLRequest;
|
||||
|
||||
export default class SCBLInfo extends DiscordBasePlugin {
|
||||
export default class CBLInfo extends DiscordBasePlugin {
|
||||
static get description() {
|
||||
return (
|
||||
'The <code>SCBLInfo</code> plugin alerts admins when a harmful player is detected joining their server based ' +
|
||||
'on data from the <a href="https://squad-community-ban-list.com/">Squad Community Ban List</a>.'
|
||||
'The <code>CBLInfo</code> plugin alerts admins when a harmful player is detected joining their server based ' +
|
||||
'on data from the <a href="https://communitybanlist.com/">Community Ban List</a>.'
|
||||
);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ export default class SCBLInfo extends DiscordBasePlugin {
|
||||
description:
|
||||
'Admins will be alerted when a player has this or more reputation points. For more information on ' +
|
||||
'reputation points, see the ' +
|
||||
'<a href="https://squad-community-ban-list.com/faq">Squad Community Ban List\'s FAQ</a>',
|
||||
'<a href="https://communitybanlist.com/faq">Community Ban List\'s FAQ</a>',
|
||||
default: 6
|
||||
}
|
||||
};
|
||||
@ -53,7 +53,7 @@ export default class SCBLInfo extends DiscordBasePlugin {
|
||||
async onPlayerConnected(info) {
|
||||
try {
|
||||
const data = await request(
|
||||
'https://squad-community-ban-list.com/graphql',
|
||||
'https://communitybanlist.com/graphql',
|
||||
gql`
|
||||
query Search($id: String!) {
|
||||
steamUser(id: $id) {
|
||||
@ -91,7 +91,7 @@ export default class SCBLInfo extends DiscordBasePlugin {
|
||||
if (!data.steamUser) {
|
||||
this.verbose(
|
||||
2,
|
||||
`Player ${info.player.name} (Steam ID: ${info.player.steamID}) is not listed in the Squad Community Ban List.`
|
||||
`Player ${info.player.name} (Steam ID: ${info.player.steamID}) is not listed in the Community Ban List.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
@ -108,15 +108,14 @@ export default class SCBLInfo extends DiscordBasePlugin {
|
||||
embed: {
|
||||
title: `${info.player.name} is a potentially harmful player!`,
|
||||
author: {
|
||||
name: 'Squad Community Ban List',
|
||||
url: 'https://squad-community-ban-list.com/',
|
||||
icon_url:
|
||||
'https://cdn.jsdelivr.net/gh/Team-Silver-Sphere/Squad-Community-Ban-List@master/client/src/assets/img/brand/scbl-logo-square.png'
|
||||
name: 'Community Ban List',
|
||||
url: 'https://communitybanlist.com/',
|
||||
icon_url: 'https://communitybanlist.com/static/media/cbl-logo.caf6584e.png'
|
||||
},
|
||||
thumbnail: {
|
||||
url: data.steamUser.avatarFull
|
||||
},
|
||||
description: `[${info.player.name}](https://squad-community-ban-list.com/search/${info.player.steamID}) has ${data.steamUser.reputationPoints} reputation points on the Squad Community Ban List and is therefore a potentially harmful player.`,
|
||||
description: `[${info.player.name}](https://communitybanlist.com/search/${info.player.steamID}) has ${data.steamUser.reputationPoints} reputation points on the Community Ban List and is therefore a potentially harmful player.`,
|
||||
fields: [
|
||||
{
|
||||
name: 'Reputation Points',
|
||||
@ -149,14 +148,14 @@ export default class SCBLInfo extends DiscordBasePlugin {
|
||||
color: '#ffc40b',
|
||||
timestamp: info.time.toISOString(),
|
||||
footer: {
|
||||
text: 'Powered by SquadJS and the Squad Community Ban List'
|
||||
text: 'Powered by SquadJS and the Community Ban List'
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
this.verbose(
|
||||
1,
|
||||
`Failed to fetch Squad Community Ban List data for player ${info.name} (Steam ID: ${info.steamID}): `,
|
||||
`Failed to fetch Community Ban List data for player ${info.name} (Steam ID: ${info.steamID}): `,
|
||||
err
|
||||
);
|
||||
}
|
@ -26,9 +26,9 @@ export default class DiscordKillFeed extends DiscordBasePlugin {
|
||||
description: 'The color of the embeds.',
|
||||
default: 16761867
|
||||
},
|
||||
disableSCBL: {
|
||||
disableCBL: {
|
||||
required: false,
|
||||
description: 'Disable Squad Community Ban List information.',
|
||||
description: 'Disable Community Ban List information.',
|
||||
default: false
|
||||
}
|
||||
};
|
||||
@ -80,10 +80,10 @@ export default class DiscordKillFeed extends DiscordBasePlugin {
|
||||
}
|
||||
];
|
||||
|
||||
if (!this.options.disableSCBL)
|
||||
if (!this.options.disableCBL)
|
||||
fields.push({
|
||||
name: 'Squad Community Ban List',
|
||||
value: `[Attacker's Bans](https://squad-community-ban-list.com/search/${info.attacker.steamID})`
|
||||
name: 'Community Ban List',
|
||||
value: `[Attacker's Bans](https://communitybanlist.com/search/${info.attacker.steamID})`
|
||||
});
|
||||
|
||||
await this.sendDiscordMessage({
|
||||
|
@ -23,7 +23,7 @@ export default class DiscordSquadCreated extends DiscordBasePlugin {
|
||||
description: 'The color of the embed.',
|
||||
default: 16761867
|
||||
},
|
||||
useEmbed:{
|
||||
useEmbed: {
|
||||
required: false,
|
||||
description: `Send message as Embed`,
|
||||
default: true
|
||||
@ -46,36 +46,34 @@ export default class DiscordSquadCreated extends DiscordBasePlugin {
|
||||
}
|
||||
|
||||
async onSquadCreated(info) {
|
||||
|
||||
if(this.options.useEmbed){
|
||||
|
||||
await this.sendDiscordMessage({
|
||||
embed: {
|
||||
title: `Squad Created`,
|
||||
color: this.options.color,
|
||||
fields: [
|
||||
{
|
||||
name: 'Player',
|
||||
value: info.player.name,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Team',
|
||||
value: info.teamName,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Squad Number & Squad Name',
|
||||
value: `${info.player.squadID} : ${info.squadName}`
|
||||
}
|
||||
],
|
||||
timestamp: info.time.toISOString()
|
||||
if (this.options.useEmbed) {
|
||||
await this.sendDiscordMessage({
|
||||
embed: {
|
||||
title: `Squad Created`,
|
||||
color: this.options.color,
|
||||
fields: [
|
||||
{
|
||||
name: 'Player',
|
||||
value: info.player.name,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Team',
|
||||
value: info.teamName,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Squad Number & Squad Name',
|
||||
value: `${info.player.squadID} : ${info.squadName}`
|
||||
}
|
||||
});
|
||||
|
||||
],
|
||||
timestamp: info.time.toISOString()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
await this.sendDiscordMessage(` \`\`\`Player: ${info.player.name}\n created Squad ${info.player.squadID} : ${info.squadName}\n on ${info.teamName}\`\`\` `)
|
||||
await this.sendDiscordMessage(
|
||||
` \`\`\`Player: ${info.player.name}\n created Squad ${info.player.squadID} : ${info.squadName}\n on ${info.teamName}\`\`\` `
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ export default class DiscordTeamkill extends DiscordBasePlugin {
|
||||
description: 'The color of the embeds.',
|
||||
default: 16761867
|
||||
},
|
||||
disableSCBL: {
|
||||
disableCBL: {
|
||||
required: false,
|
||||
description: 'Disable Squad Community Ban List information.',
|
||||
description: 'Disable Community Ban List information.',
|
||||
default: false
|
||||
}
|
||||
};
|
||||
@ -78,10 +78,10 @@ export default class DiscordTeamkill extends DiscordBasePlugin {
|
||||
}
|
||||
];
|
||||
|
||||
if (!this.options.disableSCBL)
|
||||
if (!this.options.disableCBL)
|
||||
fields.push({
|
||||
name: 'Squad Community Ban List',
|
||||
value: `[Attacker's Bans](https://squad-community-ban-list.com/search/${info.attacker.steamID})`
|
||||
name: 'Community Ban List',
|
||||
value: `[Attacker's Bans](https://communitybanlist.com/search/${info.attacker.steamID})`
|
||||
});
|
||||
|
||||
await this.sendDiscordMessage({
|
||||
|
3636
squad-server/templates/SquadJS-Dashboard-v3.json
Normal file
3636
squad-server/templates/SquadJS-Dashboard-v3.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -114,74 +114,6 @@ Connectors should be named, for example the above is named `discord`, and should
|
||||
|
||||
See below for more details on connectors and their associated config.
|
||||
|
||||
##### Squad Layer Filter
|
||||
Connects to a filtered list of Squad layers and filters them either by an "initial filter" or an "active filter" that depends on current server information, e.g. player count.
|
||||
```js
|
||||
"layerFilter": {
|
||||
"type": "buildPoolFromFilter",
|
||||
"filter": {
|
||||
"whitelistedLayers": null,
|
||||
"blacklistedLayers": null,
|
||||
"whitelistedMaps": null,
|
||||
"blacklistedMaps": null,
|
||||
"whitelistedGamemodes": null,
|
||||
"blacklistedGamemodes": [
|
||||
"Training"
|
||||
],
|
||||
"flagCountMin": null,
|
||||
"flagCountMax": null,
|
||||
"hasCommander": null,
|
||||
"hasTanks": null,
|
||||
"hasHelicopters": null
|
||||
},
|
||||
"activeLayerFilter": {
|
||||
"historyResetTime": 18000000,
|
||||
"layerHistoryTolerance": 8,
|
||||
"mapHistoryTolerance": 4,
|
||||
"gamemodeHistoryTolerance": {
|
||||
"Invasion": 4
|
||||
},
|
||||
"gamemodeRepetitiveTolerance": {
|
||||
"Invasion": 4
|
||||
},
|
||||
"playerCountComplianceEnabled": true,
|
||||
"factionComplianceEnabled": true,
|
||||
"factionHistoryTolerance": {
|
||||
"RUS": 4
|
||||
},
|
||||
"factionRepetitiveTolerance": {
|
||||
"RUS": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
```
|
||||
* `type` - The type of filter builder to use. `filter` will depend on this type.
|
||||
- `buildPoolFromFilter` - Builds the Squad layers list from a list of filters. An example `filter` with default values for this type is show above.
|
||||
- `whitelistedLayers` - List of layers to consider.
|
||||
- `blacklistLayers` - List of layers to not consider.
|
||||
- `whitelistedMaps` - List of maps to consider.
|
||||
- `blacklistedMaps` - List of maps to not consider.
|
||||
- `whitelistedGamemodes` - List of gamemodes to consider.
|
||||
- `blacklistedGamemodes` - List of gamemodes to not consider.
|
||||
- `flagCountMin` - Minimum number of flags the layer may have.
|
||||
- `flagCountMax` - Maximum number of flags the layer may have.
|
||||
- `hasCommander` - Layer must/most not have a commander. `null` for either.
|
||||
- `hasTanks` - Layer must/most not have a tanks. `null` for either.
|
||||
- `hasHelicopters` - Layer must/most not have a helicopters. `null` for either.
|
||||
- `buildPoolFromFile` - Builds the Squad layers list from a Squad layer config file. `filter` should be the filename of the config file.
|
||||
- `buildPoolFromLayerNames` - Builds the Squad layers list from a list of layers. `filter` should be a list of layers, e.g. `"filter": ["Sumari AAS v1", "Fool's Road AAS v1"]`.
|
||||
* `filter` - Described above.
|
||||
* `activeLayerFilter` - Filters layers live as server information updates, e.g. if the player count exceeds a certain amount a layer may no longer be in the filter.
|
||||
- `historyResetTime` - After this number of milliseconds the layer history is no longer considered.
|
||||
- `layerHistoryTolerance` - A layer can only be played again after this number of layers.
|
||||
- `mapHistoryTolerance` - A map can only be played again after this number of layers.
|
||||
- `gamemodeHistoryTolerance` - A gamemode can only be played again after this number of layers. Gamemodes can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
- `gamemodeRepetitiveTolerance` - A gamemode can only be played this number of times in a row. Gamemodes can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
- `playerCountComplianceEnabled` - Filter layers by player count.
|
||||
- `factionComplianceEnabled` - Filter layers so that a team cannot play the same faction twice in a row.
|
||||
- `factionHistoryTolerance` - A faction can only be played again after this number of layers. Factions can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
- `factionRepetitiveTolerance` - A faction can only be played this number of times in a row. Factions can be specified individually inside the object. If they are not listed then the filter is not applied.
|
||||
|
||||
##### Discord
|
||||
Connects to Discord via `discord.js`.
|
||||
```json
|
||||
|
@ -48,7 +48,7 @@ ${
|
||||
}\x1b[0m
|
||||
|
||||
\x1b[33mLooking for ways to help protect your server from harmful players?
|
||||
Checkout the Squad Community Ban List: https://squad-community-ban-list.com/\x1b[0m
|
||||
Checkout the Squad Community Ban List: https://communitybanlist.com/\x1b[0m
|
||||
`
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user