fixes lol
All checks were successful
Build and Push / build-all (push) Successful in 3m28s

This commit is contained in:
doomtube 2026-01-08 23:28:04 -05:00
parent d6630ece24
commit b43c6210be
2 changed files with 56 additions and 0 deletions

View file

@ -720,6 +720,24 @@ func (m *ChessMatch) MatchSignal(ctx context.Context, logger runtime.Logger, db
if data == "cancel" {
logger.Info("Match cancelled via signal")
s.PendingCancel = true
// Broadcast cancellation to any connected clients
msg, _ := json.Marshal(map[string]interface{}{
"result": "cancelled",
"reason": "Challenge cancelled by creator",
})
dispatcher.BroadcastMessage(OpCodeGameOver, msg, nil, nil, true)
// Update match label to cancelled status so it's not detected as active
label := MatchLabel{
Game: "chess960",
Status: "cancelled",
White: s.WhiteName,
WhiteID: s.WhiteID,
PositionID: s.PositionID,
}
labelJSON, _ := json.Marshal(label)
dispatcher.MatchLabelUpdate(string(labelJSON))
}
return s, ""