Skip to content

Instantly share code, notes, and snippets.

@314pies
Last active August 3, 2019 08:16
Show Gist options
  • Save 314pies/02734314289f4ceb50f3cb01c206ce73 to your computer and use it in GitHub Desktop.
Save 314pies/02734314289f4ceb50f3cb01c206ce73 to your computer and use it in GitHub Desktop.
Server side PlayFabMultiplayerAPI.GetMatch() example
//Unity C#
PlayFabSettings.TitleId = "Your Title Id";
PlayFabSettings.DeveloperSecretKey = "Your Developer Secret Key";
PlayFabAuthenticationAPI.GetEntityToken(new GetEntityTokenRequest { },
res =>
{
Debug.Log(res);
Debug.Log(res.Entity.Id);//Should be the title id
Debug.Log(res.EntityToken);
Debug.Log(res.Entity.Type);//Should be "title"
//Invoke PlayFabMultiplayerAPI.GetMatch() after getting EntityToken
PlayFabMultiplayerAPI.GetMatch(
new GetMatchRequest
{
MatchId = "YourMatchId",
QueueName = "YourQueueName",
ReturnMemberAttributes = true
},
res2 => { Debug.Log(res2); }, err2 => { Debug.Log(err2); }
);
},
err => { Debug.Log(err); }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment