question

Maarten Brouwer avatar image
Maarten Brouwer asked

Backfill without server

Hi!

I'm busy with a 2-4 player peer-to-peer multiplayer game port. On other platforms the quickmatch works like this:

  • as soon as two players are matched, they are put in a lobby together (one of them secretly becomes the host)
  • a countdown starts, during which they can select a character etc; if both want to, they can skip the countdown and start the game
  • while the lobby is still open, other players can be matched into the lobby - so if the two players want to have a game of 3 or 4 players they can choose to wait out the countdown and have a chance of more players getting matched

With PlayFab I don't know how to do this. Having the host create a backfill ticket seemed logical, but apparently that's only reserved for a server (for reasons that don't apply in this scenario, as the backfilling happens in the pre-game lobby instead of the game itself). Based on another thread I tried to get a "title" token to be able to call the server backfill ticket function, but I get an error ('claim was not allowed to perform the requested action based on the entity's access policy') and I'm not sure if that would be even possible.

I could do something with gradually lowering the minimum number of players during matchmaking itself, but as the number of active players is not huge, that would mean a much longer wait to get in the lobby with two players (if there are not more available).

What would be the best way to do this somehow?

Matchmaking
6 comments
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

I don't think you have a proper entity token as a title-level entity token should have the permission to create a backfill ticket. Make sure you are using secret key in the header of get entity token instead of a session ticket. What's the launguage you are using in the server?

0 Likes 0 ·
Maarten Brouwer avatar image Maarten Brouwer Seth Du ♦ commented ·

"What's the launguage you are using in the server?"

I use Unity (but not on a server)

I tried this:

PlayFab.AuthenticationModels.GetEntityTokenRequest token_request = new PlayFab.AuthenticationModels.GetEntityTokenRequest()
{
    Entity = new PlayFab.AuthenticationModels.EntityKey
    {
        Id = TITLE_ID,
        Type = "title",
    }
};
PlayFabAuthenticationAPI.GetEntityToken(token_request, response =>
{
}, error =>
{
    // here I get "The claim was not allowed to perform the requested action based on the entity's access policy. Policy comment: By default, all requests are denied. If you expected this request to succeed, you may be missing a policy. See the permissions APIs in PlayFab's Admin Api to add a permission."
})

So it may be that I have to set something in the PlayFab settings, but couldn't find anything matching (with the basic understanding that I have)

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Maarten Brouwer commented ·

May I ask have you manually set up the secret key via code?

0 Likes 0 ·
Show more comments
Maarten Brouwer avatar image Maarten Brouwer commented ·

I don't get a token, as shown in the code snippet I get the error callback. And I'm aware that everything is asynchronous :)

I don't think I'm able to spend more time on this anymore, I've gone the lesser route with gradually lowering the minimum amount of players in the ticket match rule.

Perhaps it would be nice if PlayFab gave a bit more options for multiplayer setups without servers; the current API practically assumes that the caller is either a server or a client and withholds rights for the latter, which is a problem for for instance peer to peer solutions.

0 Likes 0 ·

0 Answers

·

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.