-
Notifications
You must be signed in to change notification settings - Fork 6
Why is there no API to get player balance?
Trying to get the player balance is most often an incorrect design choice. Why are you trying to do this?
Do not try to fetch the player balance for this. Just call takeMoney
directly and handle the error.
The player balance may be modified by another command/event between fetching money and the actual takeMoney
call. As a result, players can exploit this to purchase the same item multiple times even without enough money.
Use InfoAPI. Users can define custom infos to display player balance in different ways, such as total/average money in a certain currency, total amount transacted in the past day, etc. Just accept a string in your config and render it with InfoAPI.
Then delete that method from the interface. The existence of such a method simply didn't make sense.
Then tell your users to update. They most likely used getBalance incorrectly anyway.