Reputation: 771
I am currently developing a first-person-shooter.
I would like to know if there is a way to generate a GUID that will always return the same value for the same machine, but will be different on another machine.
I need to do this generation to effectively ban troublesome users.
I want it to work on both Microsoft Visual C++ and g++.
Upvotes: 1
Views: 963
Reputation: 13918
You could read the MachineGuid key at the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
registry key.
That would work on Windows, but you'd need an alternate method for other OS's.
Upvotes: 1
Reputation: 513
I would second the vote on the MAC address, because every MAC address is unique when manufactured, but then you run the issue of spoofing. I recommend you base it on multiple values such as the volume serial number, CPU model/stepping, MAC Address, and the disk manufacturer just as an example. It's up to you, but try to avoid relying on just a single value as that could always change, but then again, the GUID would change if any of your identifying factors changed, so you would need to pick some kind of persistent value between machines. Something like the product key, or product id rather might be a better choice, but im not sure if thats easily accessible if at all.
Upvotes: 1
Reputation: 1356
You could use the MAC address.
A way to do it is described here.
Upvotes: 0