mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-24 01:23:52 -06:00
fix: vote end broadcast
This commit is contained in:
parent
bf2d7b093b
commit
bbb14936e9
10
mapvote.js
10
mapvote.js
@ -217,6 +217,7 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
this.restorePersistentData = this.restorePersistentData.bind(this);
|
this.restorePersistentData = this.restorePersistentData.bind(this);
|
||||||
this.endVotingGently = this.endVotingGently.bind(this);
|
this.endVotingGently = this.endVotingGently.bind(this);
|
||||||
this.formatChoice = this.formatChoice.bind(this);
|
this.formatChoice = this.formatChoice.bind(this);
|
||||||
|
this.updateNextMap = this.updateNextMap.bind(this);
|
||||||
|
|
||||||
this.broadcast = async (msg) => { await this.server.rcon.broadcast(msg); };
|
this.broadcast = async (msg) => { await this.server.rcon.broadcast(msg); };
|
||||||
this.warn = async (steamid, msg) => { await this.server.rcon.warn(steamid, msg); };
|
this.warn = async (steamid, msg) => { await this.server.rcon.warn(steamid, msg); };
|
||||||
@ -686,12 +687,15 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
|
|
||||||
if (steamID) await this.warn(steamID, "Voting terminated!");
|
if (steamID) await this.warn(steamID, "Voting terminated!");
|
||||||
|
|
||||||
const winnerLayer = Layers.layers.find((l) => l.layerid == this.updateNextMap());
|
const winningLayerId = this.updateNextMap();
|
||||||
|
if (!winningLayerId) return;
|
||||||
|
|
||||||
|
const winnerLayer = Layers.layers.find((l) => l.layerid == winningLayerId);
|
||||||
const fancyWinner = this.formatFancyLayer(winnerLayer);
|
const fancyWinner = this.formatFancyLayer(winnerLayer);
|
||||||
|
|
||||||
console.log("winning layer", winnerLayer, fancyWinner)
|
// this.verbose(1, "Winning layer", winnerLayer, fancyWinner)
|
||||||
|
|
||||||
if (this.showWinnerBroadcastMessage) this.broadcast(this.options.voteWinnerBroadcastMessage + fancyWinner);
|
if (this.options.showWinnerBroadcastMessage) this.broadcast(this.options.voteWinnerBroadcastMessage + fancyWinner);
|
||||||
|
|
||||||
if (this.options.logToDiscord) {
|
if (this.options.logToDiscord) {
|
||||||
await this.sendDiscordMessage({
|
await this.sendDiscordMessage({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user