Unverified Commit bae97484 authored by Simon Esposito's avatar Simon Esposito Committed by GitHub
Browse files

Respect max count param when matchmaking with parties. (#793)

parent 0f1a1f5a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import (
	"go.uber.org/zap"
)


type MatchmakerPresence struct {
	UserId    string    `json:"user_id"`
	SessionId string    `json:"session_id"`
@@ -366,7 +365,7 @@ func (m *LocalMatchmaker) process(batch *index.Batch) {
				foundComboIdx = len(entryCombos) - 1
			}

			if l := len(foundCombo) + index.Count; l == index.MaxCount || (lastInterval && l >= index.MinCount) {
			if l := len(foundCombo) + index.Count; l == index.MaxCount || (lastInterval && l >= index.MinCount && l <= index.MaxCount) {
				// Check that the minimum count that satisfies the current index is also good enough for all matched entries.
				var minCountFailed bool
				for _, e := range foundCombo {