Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Hacking my game

Discussion in 'Scripting' started by OkeyNik, May 2, 2019.

  1. OkeyNik

    OkeyNik

    Joined:
    Mar 14, 2017
    Posts:
    41
    Hello everyone, I recently saw my game on third-party sites (but already in the cracked version). I have resources in the game: coins (earned in the game) and diamonds (with the help of donating). So, in the cracked version, all values on gold and diamonds are 9999999. And I do not know how to fix my code so that later on users could not use this function.

    #hacking #cheating #cracking
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,913
    Any serious, money-involving function, like storing how much credit your users have should be stored on a server. Never locally. Unless you're willing to live with cracks. Never trust any code locally, no matter if you wrote it, every client, all code can be hacked on the client side.
     
  3. OkeyNik

    OkeyNik

    Joined:
    Mar 14, 2017
    Posts:
    41
    But can I do anything for now? Maybe any other steps I can make that in the future not to make these errors. Maybe there are any kinds of testing that will help me discover other holes in my application?
     
  4. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,745
    1. Move all players data to server.
    2. Add some major updates to your game like more content and gameplay modes.
    Don't know what else you can do now...
     
  5. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    IL2CPP and some nasty checks would make cheaters life much harder.
    I doubt someone would ever buy 999999 diamonds, so you might execute some nasty check and do some crazy stuff. Like changing all text to "Dirty Cheater" or smth like that.

    Although its not bullet proof. Heck, even Denuvo can be hacked, so don't be upset if someone does decompile your game. If you're using mono backend - especially. Code is just right there, without any obfuscation.
     
    MD_Reptile likes this.
  6. OkeyNik

    OkeyNik

    Joined:
    Mar 14, 2017
    Posts:
    41
    If I will transfer all the data to the server, can I change the data to any user? For example, add coins to me? Not by Unity editor, but on the server, so that the data come will synchronize with a server and my android device
     
  7. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    You will pretty much have to set this up yourself: set up a Server, a protocol, and the security measures. Usually, your users will have to log in to your Server, and therefore they'll need an account with you, so you'll have to implement a front end as well as the back end. I don't know if there are off-the-shelf solutions for this (we implemented our own - anyone here has a recommendation for an established, reliable Service?), but the upshot is that how you transfer the data to the server, and what options you have is pretty much up to you.
     
    OkeyNik likes this.
  8. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,745