Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/crypto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ function MP.UTILS.server_connection_ID()
local serial_ptr = ffi.new("DWORD[1]")
local ok = ffi.C.GetVolumeInformationA("C:\\", nil, 0, serial_ptr, nil, nil, nil, 0)
if ok ~= 0 then raw_id = tostring(serial_ptr[0]) end
end
elseif os_name == "OS X" then
local cmd = [[ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }']]
local handle = io.popen(cmd)
local result = handle:read("*a")
if handle then handle:close() end
print(result)
raw_id = tostring(result)
end

if not raw_id then raw_id = os.getenv("USER") or os.getenv("USERNAME") or os_name end

Expand Down