mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 23:22:08 +00:00
feat: add participant-scoped proposal recovery
This commit is contained in:
@@ -135,6 +135,13 @@ func (p *Proposal) participantIndex(playerID string) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
// HasParticipant is the read-side authorization check for proposal recovery.
|
||||
// A proposal contains private matchmaking state, so non-participants must not
|
||||
// be able to enumerate or observe it through the control plane.
|
||||
func (p *Proposal) HasParticipant(playerID string) bool {
|
||||
return p != nil && playerID != "" && p.participantIndex(playerID) >= 0
|
||||
}
|
||||
|
||||
func (p *Proposal) allAccepted() bool {
|
||||
for _, participant := range p.Participants {
|
||||
if participant.Response != AcceptedResponse {
|
||||
|
||||
Reference in New Issue
Block a user