1
0

MojangAPI: Added a UseCachedOnly param to GetUUIDsFromPlayerNames().

This commit is contained in:
madmaxoft
2014-07-31 10:02:50 +02:00
parent 0336e12cee
commit 8b519bf6e2
5 changed files with 55 additions and 11 deletions

View File

@@ -307,8 +307,38 @@ function TestUUIDFromName()
"aloe_vera",
}
UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(ValidPlayerNames);
-- Log the results:
for _, name in ipairs(ValidPlayerNames) do
local UUID = UUIDs[name]
if (UUID == nil) then
LOG(" UUID(" .. name .. ") not found.")
else
LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"")
end
end
-- Test yet again, cache-only:
LOG("Testing once more, cache only...")
local PlayerNames3 =
{
"xoft",
"aloe_vera",
"notch", -- Valid player name, but not cached (most likely :)
}
UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(PlayerNames3, true)
LOG("UUID-from-Name resolution test finished.")
-- Log the results:
for _, name in ipairs(PlayerNames3) do
local UUID = UUIDs[name]
if (UUID == nil) then
LOG(" UUID(" .. name .. ") not found.")
else
LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"")
end
end
LOG("UUID-from-Name resolution tests finished.")
end