Roll foward

This commit is contained in:
ect0s 2023-01-01 19:25:02 -05:00
commit 6cce309bea
20 changed files with 3764 additions and 245 deletions

133
README.md
View File

@ -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. 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 ##### Discord
Connects to Discord via `discord.js`. Connects to Discord via `discord.js`.
```json ```json
@ -321,11 +253,39 @@ Interested in creating your own plugin? [See more here](./squad-server/plugins/r
<h2>AutoTKWarn</h2> <h2>AutoTKWarn</h2>
<p>The <code>AutoTkWarn</code> plugin will automatically warn players with a message when they teamkill.</p> <p>The <code>AutoTkWarn</code> plugin will automatically warn players with a message when they teamkill.</p>
<h3>Options</h3> <h3>Options</h3>
<ul><li><h4>message</h4> <ul><li><h4>attackerMessage</h4>
<h6>Description</h6> <h6>Description</h6>
<p>The message to warn players with.</p> <p>The message to warn attacking players with.</p>
<h6>Default</h6> <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>
<details> <details>
@ -592,9 +552,9 @@ Grafana:
<p>The color of the embeds.</p> <p>The color of the embeds.</p>
<h6>Default</h6> <h6>Default</h6>
<pre><code>16761867</code></pre></li> <pre><code>16761867</code></pre></li>
<li><h4>disableSCBL</h4> <li><h4>disableCBL</h4>
<h6>Description</h6> <h6>Description</h6>
<p>Disable Squad Community Ban List information.</p> <p>Disable Community Ban List information.</p>
<h6>Default</h6> <h6>Default</h6>
<pre><code>false</code></pre></li></ul> <pre><code>false</code></pre></li></ul>
</details> </details>
@ -783,9 +743,9 @@ Grafana:
<p>The color of the embeds.</p> <p>The color of the embeds.</p>
<h6>Default</h6> <h6>Default</h6>
<pre><code>16761867</code></pre></li> <pre><code>16761867</code></pre></li>
<li><h4>disableSCBL</h4> <li><h4>disableCBL</h4>
<h6>Description</h6> <h6>Description</h6>
<p>Disable Squad Community Ban List information.</p> <p>Disable Community Ban List information.</p>
<h6>Default</h6> <h6>Default</h6>
<pre><code>false</code></pre></li></ul> <pre><code>false</code></pre></li></ul>
</details> </details>
@ -827,29 +787,6 @@ Grafana:
<pre><code>300000</code></pre></li></ul> <pre><code>300000</code></pre></li></ul>
</details> </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> <details>
<summary>SeedingMode</summary> <summary>SeedingMode</summary>
<h2>SeedingMode</h2> <h2>SeedingMode</h2>

View File

@ -55,7 +55,15 @@
{ {
"plugin": "AutoTKWarn", "plugin": "AutoTKWarn",
"enabled": true, "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", "plugin": "ChatCommands",
@ -134,7 +142,7 @@
"discordClient": "discord", "discordClient": "discord",
"channelID": "", "channelID": "",
"color": 16761867, "color": 16761867,
"disableSCBL": false "disableCBL": false
}, },
{ {
"plugin": "DiscordPlaceholder", "plugin": "DiscordPlaceholder",
@ -188,7 +196,7 @@
"discordClient": "discord", "discordClient": "discord",
"channelID": "", "channelID": "",
"color": 16761867, "color": 16761867,
"disableSCBL": false "disableCBL": false
}, },
{ {
"plugin": "FogOfWar", "plugin": "FogOfWar",
@ -202,13 +210,6 @@
"broadcasts": [], "broadcasts": [],
"interval": 300000 "interval": 300000
}, },
{
"plugin": "SCBLInfo",
"enabled": true,
"discordClient": "discord",
"channelID": "",
"threshold": 6
},
{ {
"plugin": "SeedingMode", "plugin": "SeedingMode",
"enabled": true, "enabled": true,

View File

@ -1,6 +1,6 @@
{ {
"name": "SquadJS", "name": "SquadJS",
"version": "3.1.0", "version": "3.6.1",
"repository": "https://github.com/Team-Silver-Sphere/SquadJS.git", "repository": "https://github.com/Team-Silver-Sphere/SquadJS.git",
"author": "Thomas Smyth <https://github.com/Thomas-Smyth>", "author": "Thomas Smyth <https://github.com/Thomas-Smyth>",
"license": "BSL-1.0", "license": "BSL-1.0",

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
raw: args[0], raw: args[0],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
raw: args[0], raw: args[0],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
...logParser.eventStore[args[3]], ...logParser.eventStore[args[3]],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
raw: args[0], raw: args[0],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
raw: args[0], raw: args[0],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
raw: args[0], raw: args[0],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
...logParser.eventStore[args[3]], ...logParser.eventStore[args[3]],

View File

@ -1,5 +1,6 @@
export default { 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) => { onMatch: (args, logParser) => {
const data = { const data = {
raw: args[0], raw: args[0],

View File

@ -1,7 +1,7 @@
export default { 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) => { onMatch: async (args, logParser) => {
logParser.eventStore['steamid-connected'] = args[4]; logParser.eventStore['steamid-connected'] = args[4];
} }
}; };

View File

@ -11,10 +11,15 @@ export default class AutoTKWarn extends BasePlugin {
static get optionsSpecification() { static get optionsSpecification() {
return { return {
message: { attackerMessage: {
required: false, 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!' 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) { async onTeamkill(info) {
if (!info.attacker) return; if (info.attacker && this.options.attackerMessage) {
this.server.rcon.warn(info.attacker.steamID, this.options.attackerMessage);
await this.server.rcon.warn(info.attacker.steamID, this.options.message); }
if (info.victim && this.options.victimMessage) {
this.server.rcon.warn(info.victim.steamID, this.options.victimMessage);
}
} }
} }

View File

@ -4,11 +4,11 @@ import DiscordBasePlugin from './discord-base-plugin.js';
const { request, gql } = GraphQLRequest; const { request, gql } = GraphQLRequest;
export default class SCBLInfo extends DiscordBasePlugin { export default class CBLInfo extends DiscordBasePlugin {
static get description() { static get description() {
return ( return (
'The <code>SCBLInfo</code> plugin alerts admins when a harmful player is detected joining their server based ' + 'The <code>CBLInfo</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>.' 'on data from the <a href="https://communitybanlist.com/">Community Ban List</a>.'
); );
} }
@ -30,7 +30,7 @@ export default class SCBLInfo extends DiscordBasePlugin {
description: description:
'Admins will be alerted when a player has this or more reputation points. For more information on ' + 'Admins will be alerted when a player has this or more reputation points. For more information on ' +
'reputation points, see the ' + '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 default: 6
} }
}; };
@ -53,7 +53,7 @@ export default class SCBLInfo extends DiscordBasePlugin {
async onPlayerConnected(info) { async onPlayerConnected(info) {
try { try {
const data = await request( const data = await request(
'https://squad-community-ban-list.com/graphql', 'https://communitybanlist.com/graphql',
gql` gql`
query Search($id: String!) { query Search($id: String!) {
steamUser(id: $id) { steamUser(id: $id) {
@ -91,7 +91,7 @@ export default class SCBLInfo extends DiscordBasePlugin {
if (!data.steamUser) { if (!data.steamUser) {
this.verbose( this.verbose(
2, 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; return;
} }
@ -108,15 +108,14 @@ export default class SCBLInfo extends DiscordBasePlugin {
embed: { embed: {
title: `${info.player.name} is a potentially harmful player!`, title: `${info.player.name} is a potentially harmful player!`,
author: { author: {
name: 'Squad Community Ban List', name: 'Community Ban List',
url: 'https://squad-community-ban-list.com/', url: 'https://communitybanlist.com/',
icon_url: icon_url: 'https://communitybanlist.com/static/media/cbl-logo.caf6584e.png'
'https://cdn.jsdelivr.net/gh/Team-Silver-Sphere/Squad-Community-Ban-List@master/client/src/assets/img/brand/scbl-logo-square.png'
}, },
thumbnail: { thumbnail: {
url: data.steamUser.avatarFull 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: [ fields: [
{ {
name: 'Reputation Points', name: 'Reputation Points',
@ -149,14 +148,14 @@ export default class SCBLInfo extends DiscordBasePlugin {
color: '#ffc40b', color: '#ffc40b',
timestamp: info.time.toISOString(), timestamp: info.time.toISOString(),
footer: { footer: {
text: 'Powered by SquadJS and the Squad Community Ban List' text: 'Powered by SquadJS and the Community Ban List'
} }
} }
}); });
} catch (err) { } catch (err) {
this.verbose( this.verbose(
1, 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 err
); );
} }

View File

@ -26,9 +26,9 @@ export default class DiscordKillFeed extends DiscordBasePlugin {
description: 'The color of the embeds.', description: 'The color of the embeds.',
default: 16761867 default: 16761867
}, },
disableSCBL: { disableCBL: {
required: false, required: false,
description: 'Disable Squad Community Ban List information.', description: 'Disable Community Ban List information.',
default: false default: false
} }
}; };
@ -80,10 +80,10 @@ export default class DiscordKillFeed extends DiscordBasePlugin {
} }
]; ];
if (!this.options.disableSCBL) if (!this.options.disableCBL)
fields.push({ fields.push({
name: 'Squad Community Ban List', name: 'Community Ban List',
value: `[Attacker's Bans](https://squad-community-ban-list.com/search/${info.attacker.steamID})` value: `[Attacker's Bans](https://communitybanlist.com/search/${info.attacker.steamID})`
}); });
await this.sendDiscordMessage({ await this.sendDiscordMessage({

View File

@ -23,7 +23,7 @@ export default class DiscordSquadCreated extends DiscordBasePlugin {
description: 'The color of the embed.', description: 'The color of the embed.',
default: 16761867 default: 16761867
}, },
useEmbed:{ useEmbed: {
required: false, required: false,
description: `Send message as Embed`, description: `Send message as Embed`,
default: true default: true
@ -46,36 +46,34 @@ export default class DiscordSquadCreated extends DiscordBasePlugin {
} }
async onSquadCreated(info) { async onSquadCreated(info) {
if (this.options.useEmbed) {
if(this.options.useEmbed){ await this.sendDiscordMessage({
embed: {
await this.sendDiscordMessage({ title: `Squad Created`,
embed: { color: this.options.color,
title: `Squad Created`, fields: [
color: this.options.color, {
fields: [ name: 'Player',
{ value: info.player.name,
name: 'Player', inline: true
value: info.player.name, },
inline: true {
}, name: 'Team',
{ value: info.teamName,
name: 'Team', inline: true
value: info.teamName, },
inline: true {
}, name: 'Squad Number & Squad Name',
{ value: `${info.player.squadID} : ${info.squadName}`
name: 'Squad Number & Squad Name',
value: `${info.player.squadID} : ${info.squadName}`
}
],
timestamp: info.time.toISOString()
} }
}); ],
timestamp: info.time.toISOString()
}
});
} else { } else {
await this.sendDiscordMessage(
await this.sendDiscordMessage(` \`\`\`Player: ${info.player.name}\n created Squad ${info.player.squadID} : ${info.squadName}\n on ${info.teamName}\`\`\` `) ` \`\`\`Player: ${info.player.name}\n created Squad ${info.player.squadID} : ${info.squadName}\n on ${info.teamName}\`\`\` `
);
} }
} }
} }

View File

@ -26,9 +26,9 @@ export default class DiscordTeamkill extends DiscordBasePlugin {
description: 'The color of the embeds.', description: 'The color of the embeds.',
default: 16761867 default: 16761867
}, },
disableSCBL: { disableCBL: {
required: false, required: false,
description: 'Disable Squad Community Ban List information.', description: 'Disable Community Ban List information.',
default: false default: false
} }
}; };
@ -78,10 +78,10 @@ export default class DiscordTeamkill extends DiscordBasePlugin {
} }
]; ];
if (!this.options.disableSCBL) if (!this.options.disableCBL)
fields.push({ fields.push({
name: 'Squad Community Ban List', name: 'Community Ban List',
value: `[Attacker's Bans](https://squad-community-ban-list.com/search/${info.attacker.steamID})` value: `[Attacker's Bans](https://communitybanlist.com/search/${info.attacker.steamID})`
}); });
await this.sendDiscordMessage({ await this.sendDiscordMessage({

File diff suppressed because it is too large Load Diff

View File

@ -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. 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 ##### Discord
Connects to Discord via `discord.js`. Connects to Discord via `discord.js`.
```json ```json

View File

@ -48,7 +48,7 @@ ${
}\x1b[0m }\x1b[0m
\x1b[33mLooking for ways to help protect your server from harmful players? \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
` `
); );
} }