Hi all, is there a way to obtain a ‘guaranteed unique machine ID’ in Unity?
I would like to authenticate game keys to unique machine IDs if possible.
Can it be done?
Thanks!!
Hi all, is there a way to obtain a ‘guaranteed unique machine ID’ in Unity?
I would like to authenticate game keys to unique machine IDs if possible.
Can it be done?
Thanks!!
There are a number of choices, but a MAC address is probably one of the more commonly used “unique” ids. In .NET, you’d access that using System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
Here’s an example:
http://stackoverflow.com/questions/3598403/how-to-get-mac-id-of-a-system-using-c-sharp
A quick look seems to indicate that the above is supported by Mono, though I’ve never used it.
Jeff
One addition… .You didn’t mention what device(s) you’re targeting. The MAC address would be appropriate for typical computer hardware (PC / MAC / etc), but likely not for mobile devices.
Oooh, many thanks jgodfrey, did the trick!
If you’re using Unity, why not use SystemInfo.deviceUniqueIdentifier?
Please note that a Mac address is specific to the network port, not the computer.
If my computer has multiple network ports (as my personal machine does - I have 2), if I unplug the network cable, move my PC, and plug my cable back into a different port, my Mac address will be different.
I noticed deviceUniqueIdentifier for my dev machine changed today. If this number changes often, that could be a problem for some uses.