diff options
author | Mattes D <github@xoft.cz> | 2015-04-23 21:36:17 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-04-23 21:36:17 +0200 |
commit | a41f21f76f558e6808647c72478c6c3a42c77090 (patch) | |
tree | c4d91ef3f38ade72f61a400887372b8589bceb23 /MCServer/Plugins/Debuggers/Debuggers.lua | |
parent | Nether Quartz is handled in the Ore handler. (diff) | |
parent | Implemented cPluginManager:DoWithPlugin(), fixed ForEachPlugin(). (diff) | |
download | cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.tar cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.tar.gz cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.tar.bz2 cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.tar.lz cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.tar.xz cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.tar.zst cuberite-a41f21f76f558e6808647c72478c6c3a42c77090.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 01a5de81e..6580e9dbc 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -62,6 +62,7 @@ function Initialize(a_Plugin) -- TestRankMgr() TestFileExt() TestFileLastMod() + TestPluginInterface() local LastSelfMod = cFile:GetLastModificationTime(a_Plugin:GetLocalFolder() .. "/Debuggers.lua") LOG("Debuggers.lua last modified on " .. os.date("%Y-%m-%dT%H:%M:%S", LastSelfMod)) @@ -75,6 +76,18 @@ function Initialize(a_Plugin) ) --]] + -- Test the crash in #1889: + cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICKING_ENTITY, + function (a_CBPlayer, a_CBEntity) + a_CBPlayer:GetWorld():DoWithEntityByID( -- This will crash the server in #1889 + a_CBEntity:GetUniqueID(), + function(Entity) + LOG("RightClicking an entity, crash #1889 fixed") + end + ) + end + ) + return true end; @@ -82,6 +95,27 @@ end; +function TestPluginInterface() + cPluginManager:DoWithPlugin("Core", + function (a_CBPlugin) + if (a_CBPlugin:GetStatus() == cPluginManager.psLoaded) then + LOG("Core plugin was found, version " .. a_CBPlugin:GetVersion()) + else + LOG("Core plugin is not loaded") + end + end + ) + + cPluginManager:ForEachPlugin( + function (a_CBPlugin) + LOG("Plugin in " .. a_CBPlugin:GetFolderName() .. " has an API name of " .. a_CBPlugin:GetName() .. " and status " .. a_CBPlugin:GetStatus()) + end + ) +end + + + + function TestFileExt() assert(cFile:ChangeFileExt("fileless_dir/", "new") == "fileless_dir/") assert(cFile:ChangeFileExt("fileless_dir/", ".new") == "fileless_dir/") |