How do I get the unique ID of a PC

  • Hello, a question, each computer has an unique ID.

    This can be used so that saved games can not be shared.

    How do I get the id of the computer where my game runs?

  • First thing that comes to mind would be to put a "cookie" in localstorage. But localstorage isn't really accessible or shareable to begin with so I don't see why this would be a problem?

  • Thanks but the game is saved locally in a file in JSON. I will not use local storage.

  • Are you referring to the MAC address?

    There may be a way to do it from JavaScript (run-time), but I don't know how. If you're ok with a hack, perhaps you can try creating a batch file, and then put

    getmac > d:\gamedir\getmac.txt

    Use NWJs's "Run file" to run the file, and access the output. I haven't tried it, and again, super hacky. If the game is run on Mac, the command will likely be different.

  • Why do you need to protect save files like this?

    As a player I would be pissed if I couldn't load my old saves after replacing some hardware on my PC (say, motherboard or HDD).

  • It's a bit complicated to get the MAC address for what I see.

    The truth is I do not know what I will do, I will continue thinking while I continue with the development.

    -----------------------------

    Well, my game is online and local.

    In the online mode you unlock content, this data is saved locally so that in the next session the contents are unlocked.

    If a player unlocks everything and shares the game, the game will have lost incentive because other players will have everything unlocked without having to win it by winning rounds and playing online.

    This hurts the overall experience so I need some way that the games can not be shared.

    If there is another way then I could try it and avoid that problem you are commenting on.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • you must decide do you want to bind score, save game state etc. to user (can play on diferent machines eg. PC, notebook etc. ) or to single machine?

    I would recommecnd to bind personal data to user account (thats why we have login to every game) rather than to a machine.

  • you must decide do you want to bind score, save game state etc. to user (can play on diferent machines eg. PC, notebook etc. ) or to single machine?

    I would recommecnd to bind personal data to user account (thats why we have login to every game) rather than to a machine.

    Yes, I think you could study that way of saving data in the cloud.

    Any clue on how to start with that?

    What plugin or method should I follow for that ?.

  • Ok, I think that saving the file in the cloud would require an internet connection and would not allow recovering the data without internet in local mode.

    I need some way to make the locally saved data can not be exchanged.

  • ...user also need internet access to even get your game, no?

    start here:

    https://www.scirra.com/tutorials/525/simple-login-using-a-mysql-database

  • Browsers generally try to make it deliberately difficult to get a unique ID for a computer, because it could be used to track users across the web, which has privacy implications. Also the original idea is flawed in that if you have savegames tied to a specific unique system ID based on the hardware setup or something, then you can end up locking yourself out of your own savegames by changing your system setup. So, basically, don't try to do this. User accounts are a better way.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)