0

我是 PlayFab 和 PlayFab API 的新手,我正在尝试为我的 P2P 多人游戏进行匹配,我成功创建了一个匹配 tikect,但现在我想在匹配开始时获取其他玩家的 IP 属性,如何去做 ?

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);
    }```
 
4

0 回答 0