diff --git a/server/chat-plugins/auction.ts b/server/chat-plugins/auction.ts index 3cc2c7286132..224d2c9785b8 100644 --- a/server/chat-plugins/auction.ts +++ b/server/chat-plugins/auction.ts @@ -543,7 +543,13 @@ export class Auction extends Rooms.SimpleRoomGame { this.state = 'bid'; this.highestBid = this.minBid; this.highestBidder = this.nominatingTeam; - this.room.add(Utils.html`|notify|${this.room.title} Auction|${player.name} has been nominated!`); + + const notifyMsg = Utils.html`|notify|${this.room.title} Auction|${player.name} has been nominated!`; + for (const currManager of this.managers.values()) { + if (currManager.team === this.nominatingTeam) continue; + Users.getExact(currManager.id)?.sendTo(this.room, notifyMsg); + } + this.sendMessage(Utils.html`/html ${user.name} from team ${this.nominatingTeam.name} has nominated ${player.name} for auction. Use /bid or type a number to place a bid!`); if (this.type === 'auction') this.sendBidInfo(); this.sendTimer(); @@ -562,11 +568,13 @@ export class Auction extends Rooms.SimpleRoomGame { if (this.type === 'blind') { if (this.bidsPlaced.has(team)) throw new Chat.ErrorMessage(`Your team has already placed a bid.`); if (bid <= this.minBid) throw new Chat.ErrorMessage(`Your bid must be higher than the minimum bid.`); + + const msg = `|c:|${Math.floor(Date.now() / 1000)}|&|/html Your team placed a bid of ${bid} on ${Utils.escapeHTML(this.nominatedPlayer.name)}.`; for (const manager of this.managers.values()) { if (manager.team !== team) continue; - const msg = `|c:|${Math.floor(Date.now() / 1000)}|&|/html Your team placed a bid of ${bid} on ${Utils.escapeHTML(this.nominatedPlayer.name)}.`; Users.getExact(manager.id)?.sendTo(this.room, msg); } + if (bid > this.highestBid) { this.highestBid = bid; this.highestBidder = team; @@ -588,9 +596,10 @@ export class Auction extends Rooms.SimpleRoomGame { } onChatMessage(message: string, user: User) { - if (this.state !== 'bid' || !Number(message.replace(',', '.'))) return; - this.bid(user, parseCredits(message)); - return ''; + if (this.state === 'bid' && Number(message.replace(',', '.'))) { + this.bid(user, parseCredits(message)); + return ''; + } } skipNom() {