It’s become evident that when developers screw up, data is lost. This can often mean thousands of dollars worth of in-game goods are lost.
I propose an api that allows developers to determine how many times a user has purchased a developer product.
local owns = game:GetService("MarketplaceService"):GetProductPurchaseCount(player, productid)
Edit: Alternate Implementation:
API returns a lua table of dates. The number of purchases can be calculated by “#var”, or they can dig in to look at dates.
This method would only work on products owned under that game (or place). Sometimes honest developers make mistakes, don’t keep purchase records, and this can lead to very unhappy users in the end. It’s easy to overlook especially when you’re excited and focusing on your gameplay. ROBLOX has this information stored, developers shouldn’t have to store it twice.
For developers who use developer products, please answer this anonymous poll. Be honest!
Resolution of loss of developer product purchases is a step in the right direction. I have some questions regarding the implementation though that I hope you can clear up for me:
Is there any specific reason this is a count of purchases rather than a log of all transactions, including data such as time and date purchased? With only the #purchases you may have trouble restoring data e.g. DeveloperProduct saving was bugged for a week and when you go to restore a player’s data, they have 8 purchases – how many were purchased in the period saving was bugged?
Why is this an in-game API rather than a site feature like Trade > My Transactions? For automatic restoration capabilities?
I don’t see a likely situation in which you were unable to save a transaction yet were able to maintain track of the other transactions (unless we’re talking about datastores being down, in which case, this warrants a feature request to disable all in-game purchases whenever those, albeit rarely, have issues). In all instances I’ve seen, people lose all data. Not partial. Although if you have use cases please share them!
I’m not quite sure what you mean here. This is to allow developers to restore purchases if they screw up. Not for the users.
ScriptOn’s example sounds like one such case. I don’t know his specific setup, but let’s imagine another game had a similar issue:
Developer updated data saving and introduced a bug that produced an error when trying to save purchases
Data was not reset because the old data loaded in successfully and wasn’t overwritten with default data
A day later the developer discovers the issue and fixes it
Player complains to developer that he purchased 3 skins but they’re no longer in his inventory
Player has 8 purchases of skins in total. How are you supposed to tell how many were purchased yesterday except for relying on the player to be truthful?
Yes, it’s not for users. I was referring to a private page only accessible by developers like Group Admin > Revenue > Line Item. We do manual restorations for Zombie Rush, so that’s why I was wondering if the purpose of it being an in-game API was automatic restorations, which you’ve clarified that’s the case.
Developer products are typically handled when you purchase it ingame. So if I buy a skin, it’s added to my “Inventory”. If the developer broke inventory saving, everything the user had would be wiped. The same applies to things like ingame gold. The server handles this and applies the gold. If they broke gold saving, all gold would be lost.
However, if a developer screwed up the code that gives you an item when you purchase it - this has nothing to do with save data however could be corrected if the API provided purchase dates. So, I believe this is a use case.
Iv had cases where people buy a product, get their cash, then conveniently the server crash and they insta-join another server before any data has been saved.
Having this option would be great, but even greater would be ‘A searchbar in Trade > Sold’ section.
Coming from personal experience, this is really only true is if data loading is broken, and the player’s data is set to the default data. If just saving is erroring, the player’s inventory would freeze and neither update nor reset.
I do save when they purchase something, but within a pcall.
Thing is, because people often buy multiple things in a row, it would use up all my data instantly.
So for each purchase I will wait 60 seconds, if no purchase more has been made, then it will save.
It’s a security measure to keep the server from using up all their data.
I could probably improve it more but for anyone who’s ever done coding, anywhere, will know of a thing called bugs and unpredictable results. We NEED a search tab in Trade > Sold, even if it’s just to verify someone is lying about purchasing a product.
Edit: Dont’ wish to highjack your thread so I’ll just stop here
You have 60 + 10 per player saves per minute. It’s hard to believe you can hit the data saving request limit per player just by players purchasing things too fast. If this is the case you should make a separate feature request to raise the limit. If you do not ensure data is saved before granting the purchase, datastores may be down and players will lose the purchase they paid for. It’s best to make sure things save before returning purchase granted, because if it fails you will either have a chance to retry the purchase or they will be refunded.
I just made a feature request for resolving the issue. On its own, saving player purchases usually doesn’t use up too many requests, but under the right circumstances (above-average usage of requests from other features of the game, surge of purchases, etc) it can present an issue.