We are making random match making game by using Photon engine. We want to match players with different users in a certain amount of time. If PlayerA plays with PlayerB they cannot play again for 30 minutes. What is the best way of doing this kind of system ?
We try some algorithms but it doesn't fit well.
public override void OnJoinedRoom()
{
if(PhotonNetwork.isMasterClient)
StartCoroutine("StartWaiting");
theSameGame = false;
var photonPlayer = PhotonNetwork.Instantiate("PhotonPlayerKO", Vector3.zero, Quaternion.identity, 0) as GameObject;
photonPlayer.name = "Local Player";
if(PhotonNetwork.playerList.Count() > 1 && !PhotonNetwork.isMasterClient)
photonViewOfManager.RPC("MyNameIs", PhotonTargets.Others, PlayerInfos.thePlayersName);
//Sending player name to other player to check whether this name is playable or not ?
if(!PhotonNetwork.isMasterClient)
StartCoroutine("CheckError");
}
It works but there are some disadvantages such as time consuming vs.. Any ideas for better solutions ?