fix(multiplayer): bind allocation to accepted proposal

This commit is contained in:
Josh Creek
2026-09-01 21:41:44 +01:00
parent d3a457d8d0
commit 950e879861
3 changed files with 33 additions and 1 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ type Service struct {
// from allocating capacity for an OPEN/DECLINED proposal or for a request
// whose playlist does not match the proposal that produced it.
func (s Service) AllocateAcceptedProposal(ctx context.Context, proposal domain.Proposal, request domain.AllocationRequest, playlist domain.Playlist, labels map[string]string) (agones.AllocatedServer, error) {
if proposal.State != domain.Accepted || proposal.Playlist != playlist || len(proposal.Participants) == 0 {
if proposal.State != domain.Accepted || proposal.Playlist != playlist || len(proposal.Participants) == 0 || (request.Playlist != "" && request.Playlist != playlist) || (proposal.Region != "" && request.Region != proposal.Region) || (proposal.Protocol > 0 && request.Protocol != proposal.Protocol) || request.ArenaPath != proposal.ArenaPath {
return agones.AllocatedServer{}, domain.ErrAllocationInput
}
if proposal.Playlist == domain.Ranked && len(proposal.Participants) != 6 {