mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): bind allocation to accepted proposal
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user