Viewed 12 times
0I'm new to PlayFab & PlayFab API, I'm trying to do matchmaking for my P2P multiplayer game, I created a match tikect successfully, but now I want to get the IP attribute of the other player when the match starts, how can do that ?
public void StartMatchmaking()
{
cancelMatchButton.SetActive(false);
queueStatusText.text = "Searching For Player...";
randomMatchMakingPanel.SetActive(true);
mainPanel.SetActive(false);
PlayFabMultiplayerAPI.CreateMatchmakingTicket(
new CreateMatchmakingTicketRequest
{
Creator = new MatchmakingPlayer
{
Entity = new EntityKey
{
Id = authentication.id,
Type = "title_player_account",
},
Attributes = new MatchmakingPlayerAttributes
{
DataObject = new { IP = playerID }
}
},
GiveUpAfterSeconds = 120,
QueueName = queueName
},
OnMatchmakingTicketCreated,
OnMatchmakingError
);
}
private void OnGetMatch(GetMatchResult result)
{
//storing the players IDs on the PlayersIDSaver two join them
idSaver.ManageIDs(result.GetMatch.ReturnMemberAttributes[0].IP, result.GetMatch.ReturnMemberAttributes[1].IP);
SceneManager.LoadScene(multiplayerSceneName);
}```