question

duartedd avatar image
duartedd asked

profile api in cloudscript javascript

hey i thought it might be profile but that appears to not be the right api but that didnt work

profile is not defined so i tried

server.GetProfile but i get back is not a function

what is the api for profile in javascript ?

10 |1200

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

duartedd avatar image
duartedd answered

GetPlayerCombinedInfo required the playfabid of the other player in which I would not have....the issue is that the matchmaker only provided the entity id and there is no easy way to convert that player title id to playfabid atleast without allowing the clients to use the get profile functionality through settings....I worked around the issue though by using the matchmaker attributes - i basically just said
when I look for a match - put in another attribute MYPLAYFABID

now when the ongetmatchresult i have both members of the match and then i can siphon out which is not my pfid easy - since its 2 player its automatically the other one.

thanks!

10 |1200

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

duartedd avatar image
duartedd answered

https://community.playfab.com/questions/55080/get-user-account-info-requires-playfabid.html

ahhh found this --- did i understand this right? im trying to get the opponents entityid converted into a playfabid to be able to do some other stuff within cloudscript....dont know if i want to allow another player - usually i would limit or put some constraints with server side logic

1 comment
10 |1200

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

duartedd avatar image duartedd commented ·

i tried to work around it by throwing the player's playfab id in the dataobject but i dont think that gets passed to the getmatchresult it seems - or maybe i missing something ?

any other thoughts to get around no profile option in cloudscript?

the debug returns null

  foreach (var member in result.Members) 
            if (member.Entity.Id != MenuPlayerData.PlayerEntity.Id)
            {
                Dictionary<string, string> attributeData = new Dictionary<string, string>();


                Debug.Log(member.Attributes.DataObject.ToString());
                attributeData = PluginManager.GetPlugin<ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject<Dictionary<string, string>>(member.Attributes.DataObject.ToString());


                opponentPFID = attributeData["PFID"];


            }



0 Likes 0 ·
duartedd avatar image
duartedd answered

oppp the trick was in the request - ReturnMemberAttributes is false by default - i set to true for return - so ill do this way

1 comment
10 |1200

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

Sarah Zhang avatar image Sarah Zhang commented ·

According to your description, you have found the way to get the member's attributes on the Cloud Script function, is it right? If so, thanks for the sharing.

As you said, the APIs such as GetProfile, etc. are not relevant to get the match member's attributes. If you want to retrieve the member's attributes when calling the API GetMatch, you need to as the field -- ReturnMemberAttributes of the request body as true.

0 Likes 0 ·
Dylan avatar image
Dylan answered

PlayFab REST API Server references.
This is the full set of server.<MethodName> functionality.
GetPlayerCombinedInfo is the one you are looking for I believe.

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.