Forcing side selection on matchmaking request

I’m trying to figure out how to enable the client to choose which side to go on when making a matchmaking request. We have attacker and defender teams in our game. By default I want the team to be random so I don’t want any forcing to be done, but if the client gets to same team twice in a row I want to force the team in the matchmaking request.

I tried this by simply setting the team in the playerdata that is attached in to the matchmakingrequest, but that didn’t work at all and the clients got into the teams in the order they start the matchmaking. Now I’m trying to solve how to make this happen with player attributes in the flexmatch rule set. I have ForceAttacker and ForceDefender number attributes that I can set in the matchmaking request.

But what kind of rules must I make so the player is placed on a team on random if ForceAttacker and ForceDefender values are both 0 or to be forced into a specific team if either of those values is 1?

Managed to solve this.

Instead of using a number attribute to force a side I am using a string list player attribute to store the preferencedTeams. It defaults to “none” and the client will decide to populate the array with the teams. Then in rules I fill the teams if the PreferencedTeams contains the team value.