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

Unity data security during gameplay (in ios and Android)

Discussion in 'Scripting' started by benzsuankularb, Jul 18, 2016.

  1. benzsuankularb

    benzsuankularb

    Joined:
    Apr 10, 2013
    Posts:
    132
    Can user hack or edit the player score during gameplay (not PlayerPreference or Server Hijack)?

    If yes, How can we prevent this?
     
  2. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    Don't even try to. The ones who really want to cheat will always find ways to cheat.
    If you need to prevent players from cheating, you need to use an authoritive server.
     
  3. benzsuankularb

    benzsuankularb

    Joined:
    Apr 10, 2013
    Posts:
    132
    Sorry, What do you mean about authoritive server. I don't quite understand.

    And how It'll protect us from cheat, If use can cheat at the very first data source.
     
  4. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    It's really hard if not even impossible to protect your game-client.

    People can read the memory on most devices and change values easily.
    Your save files can be edited or if you encrypt them, they can be decrypted and people will find ways to do so.

    Anyway, what kind of game is it?
     
    benzsuankularb likes this.
  5. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    there are basically two way of data being validated. The server says it's right (server is Authoritative), or the client says it right (client is Authoritative).

    If you're going down the route of "Authoritative server" you're basically playing on the server and the local client is just a display/input gatherer. This of course requires a lot more beefier servers for all the extra processing.

    If you're going down the route of "Authoritative client" you run the risk of users manipulating the client to their own ends, but the server is just a way of keeping track of their stuff.


    There are some hybrid approaches where the client and server are responsible for different things, or where the server double checks what the client is sending etc. (check out "The Division" for a recent high profile problem case where the client was responsible for things like ammo count and filtering what you can see, which was very rapidly turned into infinite ammo and wall vision "hacks")
     
    benzsuankularb likes this.
  6. benzsuankularb

    benzsuankularb

    Joined:
    Apr 10, 2013
    Posts:
    132
    A normal casual game. Let think about Flappy bird.
    But it's score are sensitive and valuable.

    I see. Thank you so much.