diff options
author | Mattes D <github@xoft.cz> | 2015-12-28 11:08:46 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-12-28 11:08:46 +0100 |
commit | 7a778e291139624ad0733103d57b6e816c5a9ccc (patch) | |
tree | 680db5b3c2f43af5bd8f902fda0e4c0ad28ffb46 /Server/Plugins | |
parent | Removed excessive logging in redstone simulator. (diff) | |
download | cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.tar cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.tar.gz cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.tar.bz2 cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.tar.lz cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.tar.xz cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.tar.zst cuberite-7a778e291139624ad0733103d57b6e816c5a9ccc.zip |
Diffstat (limited to '')
-rw-r--r-- | Server/Plugins/Debuggers/Debuggers.lua | 31 | ||||
-rw-r--r-- | Server/Plugins/Debuggers/Info.lua | 6 |
2 files changed, 37 insertions, 0 deletions
diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua index 7058a5025..85e2c50ae 100644 --- a/Server/Plugins/Debuggers/Debuggers.lua +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -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) local bbox = cBoundingBox(0, 10, 0, 10, 0, 10) local v1 = Vector3d(1, 1, 1) diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua index 486cfd0d9..99d3ebe74 100644 --- a/Server/Plugins/Debuggers/Info.lua +++ b/Server/Plugins/Debuggers/Info.lua @@ -259,6 +259,12 @@ g_PluginInfo = Handler = HandleConsoleTestUrlParser, HelpString = "Tests the cUrlParser", }, + + ["uuid"] = + { + Handler = HandleConsoleUuid, + HelpString = "Queries the cMojangAPI for a player's UUID", + } }, -- ConsoleCommands } -- g_PluginInfo |