G
G
grabbee2020-10-11 13:45:37
Game development
grabbee, 2020-10-11 13:45:37

How is the game currency stored inside?

At its simplest, it's like a total. But then it is almost impossible to cancel the expense. In general, confusion will be inevitable.
- A person first bought 2 coins through kiwi
- Then he bought another 1 coin on the card
- Spent 3 coins on "armor".
- I bought 2 more coins via qiwi.

And I receive a refund of the (second) payment on the card. It turns out that the armor needs to be taken away, And he already has enough coins for the armor. And you need to pick up one coin. I'm already confused...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Shumov, 2020-10-11
@grabbee

Consumable resources when returning funds are very difficult to roll back because they have already been spent on something. In fact, these cases are rare and can be ignored. In case of abuse of this situation, you can simply ban the account

A
antonwx, 2020-10-11
@antonwx

In any game, in the event of such actions, the account is blocked until the funds get out of the minus

C
ComodoHacker, 2020-10-11
@ComodoHacker

Approximately the same as real currency is stored in real accounting (banking, accounting, etc.) systems. Current balance + transaction log.
In fact, you already have two currencies in the system: real money and game currency. They need to be stored separately. And a separate transaction to reflect the transfer from one to another.
If you need to make a refund of funds that have already been spent, you do not need to find out exactly what they were spent on and how to roll it all back. It's just that the balance becomes negative, which means debt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question