summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-28 17:14:23 +0200
committermadmaxoft <github@xoft.cz>2014-07-28 17:14:23 +0200
commitb6677efecdd026a7eb8d652a067e4770182cd7c1 (patch)
tree30956bc8d1617fd0cb04ac52ffca63f50af949aa /MCServer
parentAdded cClientHandle:GetUUIDsFromPlayerNames() to Lua API. (diff)
downloadcuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.tar
cuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.tar.gz
cuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.tar.bz2
cuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.tar.lz
cuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.tar.xz
cuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.tar.zst
cuberite-b6677efecdd026a7eb8d652a067e4770182cd7c1.zip
Diffstat (limited to 'MCServer')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index b402c1867..80416acc7 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -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...");