C
C
ch3rkasov2014-10-12 19:47:48
Donations
ch3rkasov, 2014-10-12 19:47:48

How to implement a donation?

At the moment, the game implements donation through the site in the following way:
1. The user logs in to his account on the site
2. Replenishes the account
3. Enters the game and spends his money on improvements
I want to make keys to replenish the account:
1. A key is bought through the store script
2. This key is entered in the game and the account is replenished
. Only the creation of a table in the database comes to mind:
key | sum
1E4T2A | 100
In which keys will be generated upon purchase, and later, when entering the key in the game, a request will be sent to the database to check for validity, and then the account will be replenished.
Is it possible to somehow generate keys on the site, so that later the game server takes information about the replenishment directly from the key (not only the amount, but also the date, what else can be there)? And how safe is it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zuzzz, 2014-10-13
@ch3rkasov

You can do it, but it's not safe. If they manage to unravel the key algorithm, then the cheaters will pour in a huge amount of illegal money. What can kill the economy of the game, although it depends on the game.
It's easier to connect the store API to the game.
A brief algorithm is as follows: - the
player goes to the store and buys n game money, while indicating his game login or email.
-shop after verification of payment sends information to the server that a user with a login such and such paid for n game money. The server must have a script to receive such messages.
-well, and then the player's balance is replenished.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question