question

jacob avatar image
jacob asked

Get User Inventory returns virtual currency incorrectly (slightly offset value)

Hello,

I am using Unreal Engine 4.19's "Get User Inventory" blueprint node which returns a "ClientGetUserInventoryResult" with a payload of that player's Virtual Currency. I'm always able to retrieve from this the player's virtual currency, but when the player has a high virtual currency value the returned number is almost always offset by a few numbers.

Sometimes the value is correctly pulled down from Playfab, but usually it will have a slight offset. I tested a number of different PC values, and found that incrementing/decrementing is working correctly, but what I pull down from playfab is incorrect (even though playfab's value is correct when I look at it). I didn't experience any problems with low values (750, 7500, 75000).

I have no idea why this would occur outside of playfab treating virtual currencies in some manner before delivering them to me. Using the "GetUserInventory" Client call is very standard and I just created my own getter for the virtual currency value to see if that worked correctly but I had the exact same offset result.

Example 1:
*Printing out what I have*
LogBlueprintUserMessages: 75,000,000 PC
*Printing out what I just decremented*
LogBlueprintUserMessages: [BP_PF_PCUpdate] Successfully decremented a PC value of: 5.0. *Printing out new value of what I have (Playfab delivers the wrong value, but it is stored correctly online as 74,999,995)*
LogBlueprintUserMessages: [BP_PF_PCUpdate] Get PC returned. You have: 74999992 PC.

Example 2:
Note Output: At 75,800,000, spending 100, drop to 75,799,904. *InCorrect*. Playfab holds 75,799,900. Decrement:
LogBlueprintUserMessages: [PlayFab_PCUpdate_C_243] [BP_PF_PCUpdate] Successfully modified a PC value of: 100.0.
LogBlueprintUserMessages: [PlayFab_PCUpdate_C_243] Get PCs returned. You have: 75799904 PC.

Note Output: At 75,799,900, spending 100, drop to 75,799,800. *Correct*. Decrement:
LogBlueprintUserMessages: [PlayFab_PCUpdate_C_245] [BP_PF_PCUpdate] Successfully modified a PC value of: 100.0.
LogBlueprintUserMessages: [PlayFab_PCUpdate_C_245] Get PCs returned. You have: 75799800 PC.

Info:
TitleId: 59E9
Test PlayFabId: D80BB6A16B43EA48

The test player is logged in, and requesting the data for the same PlayFabId.

Character Data
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.

Seth Du avatar image Seth Du ♦ commented ·

I have informed @Brendan and see if he can help with this issue.

1 Like 1 ·

1 Answer

·
brendan avatar image
brendan answered

Reviewing the event history for that player (https://developer.playfab.com/en-US/59E9/playstream/event-history?query=RDgwQkI2QTE2QjQzRUE0OCUyMEFORCUyMHBsYXllcl92aXJ0dWFsX2N1cnJlbmN5X2JhbGFuY2VfY2hhbmdlZA==&sumBy=&termsField=), it would appear that none of those balances was ever set on the player account, unless you had the PC currency set to regenerate at some point (in which case, the regenerated total would have been returned). I've tried my own experiments with the VC system, and cannot reproduce the results you're describing - in all my tests, the correct balance is returned. Can you provide a specific set of steps to follow, using Postman, that show this behavior?

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.

jacob avatar image jacob commented ·

The PC currency has never been set to regenerate. I used Postman and found the results to be correct as well. Would you or someone on your team be able to test this problem in Unreal? That is where the situation is occurring for me. Bellow are pictures depicting the correct Postman GetUserInventory (74999900), and the incorrect UE4 GetUserInventory (74999904). If you look at the Playfab Account's VC updates for today, you'll see that the VC was never set to have 4 in the last position of the value, and instead always a 5 or 0.

Test PlayFabId: D80BB6A16B43EA48


Session Ticket: D80BB6A16B43EA48---59E9-8D66D0040570662-x490u1kbnXG+nTntVAt5s06rcQLqGnaNABHxrsX4Ulo=

Postman (Correct):


Unreal 4.19 Blueprints (Incorrect)

0 Likes 0 ·
brendan avatar image brendan jacob commented ·

Sorry, but the engine you're using is completely irrelevant to the values returned. If you use Wireshark to capture the details of the packets being exchanged, you'll see that we're only ever returning the value of the player's VC balance at the time of the request. We can't really affect any changes a particular engine makes to those values - though I will add that we haven't had any reports previously that Blueprints is altering the values we return, so it's not clear why you're seeing the values you're reporting. Can you try inserting a breakpoint at the point the data is returned from our service, so see how it is being managed up to the point where you're querying it?

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.