Debuggers plugin: Added "uuid" console command.
This commit is contained in:
parent
78eb4c8ed8
commit
7a778e2911
@ -2071,6 +2071,37 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function HandleConsoleUuid(a_Split, a_EntireCmd)
|
||||||
|
-- Check params:
|
||||||
|
local playerName = a_Split[2]
|
||||||
|
if not(playerName) then
|
||||||
|
return true, "Usage: uuid <PlayerName>"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Query with cache:
|
||||||
|
LOG("Player " .. playerName .. ":")
|
||||||
|
local cachedUuid = cMojangAPI:GetUUIDFromPlayerName(playerName, true)
|
||||||
|
if not(cachedUuid) then
|
||||||
|
LOG(" - not in the UUID cache")
|
||||||
|
else
|
||||||
|
LOG(" - in the cache: \"" .. cachedUuid .. "\"")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Query online:
|
||||||
|
local onlineUuid = cMojangAPI:GetUUIDFromPlayerName(playerName, false)
|
||||||
|
if not(onlineUuid) then
|
||||||
|
LOG(" - UUID not available online")
|
||||||
|
else
|
||||||
|
LOG(" - online: \"" .. onlineUuid .. "\"")
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function HandleConsoleBBox(a_Split)
|
function HandleConsoleBBox(a_Split)
|
||||||
local bbox = cBoundingBox(0, 10, 0, 10, 0, 10)
|
local bbox = cBoundingBox(0, 10, 0, 10, 0, 10)
|
||||||
local v1 = Vector3d(1, 1, 1)
|
local v1 = Vector3d(1, 1, 1)
|
||||||
|
@ -259,6 +259,12 @@ g_PluginInfo =
|
|||||||
Handler = HandleConsoleTestUrlParser,
|
Handler = HandleConsoleTestUrlParser,
|
||||||
HelpString = "Tests the cUrlParser",
|
HelpString = "Tests the cUrlParser",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
["uuid"] =
|
||||||
|
{
|
||||||
|
Handler = HandleConsoleUuid,
|
||||||
|
HelpString = "Queries the cMojangAPI for a player's UUID",
|
||||||
|
}
|
||||||
}, -- ConsoleCommands
|
}, -- ConsoleCommands
|
||||||
} -- g_PluginInfo
|
} -- g_PluginInfo
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user