I think I found the reason. After I commented out the added MatchmakerFilter, it became normal. But I want to know what is the real reason? Previously, this function MatchmakerFilter was added for the 2v2v2 situation. https://forum.heroiclabs.com/t/suppose-my-game-is-a-3v3-3-parties-use-partymatchmakeradd-each-party-has-2-people-can-they-match-together/ 3808
//if err := initializer.RegisterMatchmakerOverride(logic.MatchmakerFilter); err != nil {
// logger.Error("Unable to register: %v", err)
// return err
//}
func MatchmakerFilter(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, candidateMatches [][]runtime.MatchmakerEntry) (matches [][]runtime.MatchmakerEntry) {
for index, entries := range candidateMatches {
totalNum := len(entries)
logger.Debug("MatchmakerFilter entry group:%d", totalNum)
if totalNum%2 == 1 {
matches = append(matches, candidateMatches[index])
continue
}
tickets := make(map[string]int, totalNum)
for _, entry := range entries {
logger.Debug("MatchmakerFilter single entry:%v ", entry, "ticket: %v ", entry.GetTicket(), "GetProperties: %v", entry.GetProperties(), "GetPartyId: %v ", entry.GetPartyId())
tickets[entry.GetTicket()] += 1
}
numArr := make([]int, 0, len(tickets))
for _, num := range tickets {
numArr = append(numArr, num)
}
if internal.FindPairWithSum(numArr, totalNum/2) == nil {
logger.Debug("MatchmakerFilter entry group not match,numArr is %v", numArr)
} else {
matches = append(matches, candidateMatches[index])
}
}
return matches
}
I want to know what’s wrong with MatchmakerFilter @ftkg @sesposito