August 2018
Intermediate to advanced
794 pages
28h 4m
English
The Unity and PHP code that is presented illustrates a simple, unsecured web-based leaderboard. To prevent players hacking into the board with false scores, we should encode some form of secret game code (or key) into the communications. Only update requests that include the correct code will actually cause a change to the database.
The Unity code will combine the secret key (in this example, the harrypotter string) with something related to the communication – for example, the same MySQL/PHP leaderboard may have different database records for different games that are identified with a game ID:
// Unity Csharp code string key = "harrypotter" string gameId = 21; string gameCode ...
Read now
Unlock full access