question

adevill20 avatar image
adevill20 asked

UE4 Blueprint decodeGetMatchmakerGameInfoResult

Hey guys.

For reference I'm using the "PlayFabAllSDK" version 0.0.170828

While developing my game i found that decodeGetMatchmakerGameInfoResult is not available to the clientapi, only in the adminapi. Is this the intended use ? I cannot see how as the client is allowed to see what servers are available ("get current games") ? I've managed to fix this quite easily by adding it to the clientapi in source (can upload to Git if required). Secondly, the decodeGetMatchmakerGameInfoResult function is not working as intended and causes a crash. This was fixed by removing "data" JsonObj field as it doesnt exists at that point anymore (see attached screen shot).

apissdks
playfab1.jpg (199.8 KiB)
10 |1200

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

1807605288 avatar image
1807605288 answered

Alright, I'm unable to reproduce the set of blocks that you have in your picture.

I also don't have a game server handy, so I can't test this rigorously, but I believe I have decoded a GameInfo object and fetched some useful values:

I'll be the first to admit that this is obviously not optimal. These objects don't seem to be decoded properly into the expected types, but rather just as arbitrary JsonObjects, which you must decode yourself. The number of Blueprint Nodes is fairly similar, but the process is not straightforward.

I'll investigate an improvement to this but for now, I think this will be useful.


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.

1807605288 avatar image 1807605288 ♦ commented ·

I can now confirm my statement in the code:

    /** array of games found */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models")
        TArray<UPlayFabJsonObject*> Games;

The list of games are just UPlayFabJsonObjects, and not properly typed GameInfo objects.

All of our Unreal SDKs have some gaps that need fixing, and this is clearly one of them.

For now, I believe you will need to use my workaround above

0 Likes 0 ·
adevill20 avatar image adevill20 commented ·

Ok great, no problem. I have created a work around by editing the source, for now it's working good. Thanks for the effort.

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ adevill20 commented ·

I would very much like to see those changes if you would. I will likely make them a permanent improvement to the SDK.

Thanks.

0 Likes 0 ·
adevill20 avatar image adevill20 1807605288 ♦ commented ·

Sure no problem. Github ?

0 Likes 0 ·
Show more comments
Show more comments
brendan avatar image
brendan answered

Yes, GetMatchmakerGameInfo was specifically provided to allow developers to access information on completed games to investigate any errors that may have occurred. It returns info for completed games.

You should indeed switch to using GetCurrentGames, as that is the API call used to request info on currently active game sessions.

2 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.

adevill20 avatar image adevill20 commented ·

Good day Brendan


I apologize, I wrongly described the error.

On a client machine, we can call "Get Current Games" and the results we can decode and break in order to get an array of "GameInfo" objects. However there is no option for the client to decode/break this "GameInfo" object in order to read the game details.

0 Likes 0 ·
nodecode.png (190.5 KiB)
1807605288 avatar image 1807605288 ♦ commented ·

Sorry for the delay. I'm going to try to build a blueprint that does this correctly as soon as I can. I think there's a way to loop the list, and cast the list-objects to the proper PlayFab object, which can then be broken into individual fields. I haven't done this anytime recently though, so I can't remember the exact process. I will try to get an example to you as soon as I can.

Likewise, I'll tell you if I fail, but I apologize, I haven't had the chance to actually load Unreal and try this yet. Stay tuned.

0 Likes 0 ·
Andrea avatar image
Andrea answered

I have some problem, the result is always 0.0 when it is 50, has anyone solved it? thank you


immagine.jpg (416.9 KiB)
1.jpg (221.7 KiB)
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.

Andrea avatar image Andrea commented ·

I have the wrong conversation, you can cancel, sorry

0 Likes 0 ·

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.