1
0

Debuggers: Added an example for cClientHandle:GetUUIDsFromPlayerNames().

This commit is contained in:
madmaxoft 2014-07-28 17:14:23 +02:00
parent 1acd03f96f
commit b6677efecd

View File

@ -80,6 +80,7 @@ function Initialize(Plugin)
TestBlockAreasString() TestBlockAreasString()
TestStringBase64() TestStringBase64()
TestUUIDFromName()
--[[ --[[
-- Test cCompositeChat usage in console-logging: -- Test cCompositeChat usage in console-logging:
@ -275,6 +276,36 @@ end
function TestUUIDFromName()
LOG("Testing UUID-from-Name resolution...")
-- Test by querying a few existing names, along with a non-existent one:
local PlayerNames =
{
"xoft",
"aloe_vera",
"nonexistent_player",
}
-- WARNING: Blocking operation! DO NOT USE IN TICK THREAD!
local UUIDs = cClientHandle:GetUUIDsFromPlayerNames(PlayerNames)
-- Log the results:
for _, name in ipairs(PlayerNames) 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 test finished.")
end
function TestSQLiteBindings() function TestSQLiteBindings()
LOG("Testing SQLite bindings..."); LOG("Testing SQLite bindings...");