Description
The problem
It is currently impossible to safely conduct transactions between players. The most common way is to use the AddMoney
and RemoveMoney
functions, but this causes several problems.
Firstly, it is not possible to see where money comes from. Yes, you do have a reason
parameter, but this is optional.
You can't use SQL transactions to safely update players' balance, as the mutations are running separately.
Ideal solution
Store player balances separately from the player table in a dedicated table with support for different bank account types. Also have a table for tracking transactions between accounts and other bank account mutations. Also, have a dedicated function for transferring money between different accounts.
Alternative solutions
Implement a money transfer method. This would not require a dedicated table, which would lead to big migration overhead for existing servers. This transfer method would be able to transfer money of both cash and bank balances to different users, or be able to convert cash to bank balances and vice versa.
Additional context
No response