1
0
Fork 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
1 changed files with 31 additions and 0 deletions

View File

@ -80,6 +80,7 @@ function Initialize(Plugin)
TestBlockAreasString()
TestStringBase64()
TestUUIDFromName()
--[[
-- 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()
LOG("Testing SQLite bindings...");