question

callemagnussandberg avatar image
callemagnussandberg asked

CreateMatchmakingTicket no event trigger.,s

    public void Start()
    {
        PlayFabMultiplayer.Initialize();
        PlayFabMultiplayer.OnMatchmakingTicketStatusChanged += OnMatchmakingTicketStatusChanged;
        PlayFabMultiplayer.OnMatchmakingTicketCompleted += OnMatchmakingTicketCompleted;
    }


    public void LoginAndMatch()
    {
        string id = username.text;
        var request = new LoginWithCustomIDRequest { CustomId = id, CreateAccount = true };
        PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailure);
    }


    private void OnLoginSuccess(LoginResult result)
    {
        Debug.Log("Logged in.");
        PlayFabMultiplayer.SetEntityToken(result.AuthenticationContext);
        string userAttributesJSON = "";
        MatchUser localUser = new MatchUser(result.AuthenticationContext, userAttributesJSON);
        PlayFabMultiplayer.CreateMatchmakingTicket(localUser, "QuickMatchQueue");
    }


    private void OnMatchmakingTicketStatusChanged(MatchmakingTicket ticket)
    {
        Debug.Log($"Matchmaking status changed: {ticket.Status}");
    }


    private void OnMatchmakingTicketCompleted(MatchmakingTicket ticket, int result)
    {
        Debug.Log($"Matchmaking ticket completed: {ticket.Status}, {result}");
    }



Running the following code I would expect OnMatchmakingTicketStatusChanged to trigger with WaitingForMatch status but nothing happens. However I can see in the queue dashboard that events seems to be coming in.

What could be the problem here?

,

unity3dsdksMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image
Gosen Gao answered

Please refer to Set up your scene to make sure you have everything set up, especially the PlayfabMultiplayerEventProcessor.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

callemagnussandberg avatar image
callemagnussandberg answered

Thanks a lot @Gosen Gao! Just as you pointed out, I had missed to include the PlayfabMultiplayerEventProcessor prefab. Now its working!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.