0
\$\begingroup\$

I'm writing a simple turn-based game for mobile, just to test the waters and I'm having doubts about the approach.

Each player has 5 cards on hand.

I want for both players to be able to replay exactly what the other player did. Would it be okay (from a security perspective (and in what degree?)) for both clients to know in-memory what the other player has on hand?

Example: Game Start > Server sends encrypted data* to both clients > Clients decrypts data in memory

Server sends user action > Client replay action

*where data is Client1's cards and Client2's cards.

The reason for not having the server sending "need to know" stuff, is for code-simplicity and responsiveness.

\$\endgroup\$
  • 3
    \$\begingroup\$ No this is not safe at all. What stops someone from just seeing what cards the other player has in hand? \$\endgroup\$ – Charanor Feb 6 '18 at 12:51
2
\$\begingroup\$

This is not safe.

As soon as you let client know something, consider the player knows it too. Even if the information is hidden from players view in GUI, it can be more or less easily extracted from memory and/or network data exchange.

\$\endgroup\$
  • \$\begingroup\$ That's what I thought, but at the same time, I'm thinking, how many people do actually use memory-hack, that it's worth the time to "fight it"? :/ \$\endgroup\$ – Whyser Feb 6 '18 at 12:58
  • \$\begingroup\$ That's a whole different question. I'd consider, if you have such problems with the game, that's a sign of success - someone really plays it and likes it bad enough to cheat! Percentage .. cannot be estimated that easily. Depends on lots of factors. I'd say something around 0.1% - 10%. Also there are special tools that scan memory in search of "interesting" values. They make such hacking more affordable. \$\endgroup\$ – Kromster says support Monica Feb 6 '18 at 15:21
  • \$\begingroup\$ Thanks for your input regarding this! I assumed as much but good to get confirmation from others in the community! \$\endgroup\$ – Whyser Feb 6 '18 at 15:23
  • \$\begingroup\$ @Whyser Assume your game goes well and you are building a solid player base - I mean that's the goal right? Only one single cheater may ruin the game for all and before you addressed the issue players have left this now 'unplayable' game due to cheaters ruin it. \$\endgroup\$ – Tapirboy Feb 15 '18 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.