mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-25 18:39:47 +00:00
add ~30 second alliance request cooldown to prevent spam
This commit is contained in:
@@ -199,6 +199,9 @@ export class EventsDisplay implements Layer {
|
||||
if (other == null) {
|
||||
return
|
||||
}
|
||||
if (!myPlayer.isAlive() || !other.isAlive()) {
|
||||
return
|
||||
}
|
||||
this.addEvent({
|
||||
description: `Your alliance with ${other.name()} expired`,
|
||||
type: MessageType.WARN,
|
||||
|
||||
@@ -231,17 +231,13 @@ export class RadialMenu implements Layer {
|
||||
return
|
||||
}
|
||||
|
||||
if (myPlayer.pendingAllianceRequestWith(other)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (myPlayer.isAlliedWith(other)) {
|
||||
this.activateMenuElement(RadialElement.BreakAlliance, () => {
|
||||
this.eventBus.emit(
|
||||
new SendBreakAllianceIntentEvent(myPlayer, other)
|
||||
)
|
||||
})
|
||||
} else {
|
||||
} else if (!myPlayer.recentOrPendingAllianceRequestWith(other)) {
|
||||
this.activateMenuElement(RadialElement.RequestAlliance, () => {
|
||||
this.eventBus.emit(
|
||||
new SendAllianceRequestIntentEvent(myPlayer, other)
|
||||
|
||||
Reference in New Issue
Block a user