Hi,
I’m looking for a way to generate an (almost) unique hardware ID for the computer the game is running on.
I know there are no perfect methods, but does UE4 provide a function or do I have to write my own, like described there:
Thanks,
Ben
Hi,
I’m looking for a way to generate an (almost) unique hardware ID for the computer the game is running on.
I know there are no perfect methods, but does UE4 provide a function or do I have to write my own, like described there:
Thanks,
Ben
The only thing we have is FPlatformMisc::GetMachineId()
which returns you an FGuid
that we generate the first time UE4 is run on a machine. It’s not in any way tailored to the hardware though, so if you’re wanting something more like what’s described in that article, then you’ll need to implement it yourself.
/**
* Get (or create) the unique ID used to identify this computer.
* This is sort of a misnomer, as there will actually be one per user account on the operating system.
* This is NOT based on a machine fingerprint.
*/
static FGuid GetMachineId();
Thanks, that should do the trick for my use case. Does it work on Android, too?
It should do, although I never actually tested that platform as we were only concerned with desktop platforms at the time.
Essentially the machine ID will be stored in the registry on Windows, and all other platforms will store it in an INI file within their FPlatformProcess::ApplicationSettingsDir()
. This likely means that someone could get around this on Android by just clearing their app user-data (or just by re-installing the app).
Cool, thank you very much for the quick and profound response, Jamie!
that website in the link is dead, is there any way to do this in 2023?