fix(multiplayer): terminate proposal offenders atomically

This commit is contained in:
Josh Creek
2026-09-03 00:09:07 +01:00
parent aa446cfbfe
commit f8af212e3f
6 changed files with 206 additions and 67 deletions
+2 -1
View File
@@ -182,7 +182,8 @@ func CooldownUntil(events []CooldownEvent, playlist Playlist, now time.Time) tim
cutoff := now.Add(-window)
filtered := make([]CooldownEvent, 0, len(events))
for _, event := range events {
if event.Playlist == playlist && !event.At.Before(cutoff) {
validKind := event.Kind == DeclinedResponse || event.Kind == TimedOutResponse
if event.Playlist == playlist && validKind && !event.At.Before(cutoff) && !event.At.After(now) {
filtered = append(filtered, event)
}
}