summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-05-08 00:18:41 +0200
committerMattes D <github@xoft.cz>2015-05-08 00:18:41 +0200
commit237d8fa501501a8fab881d045fa4f1eee0e728b4 (patch)
treeae916b7f21ea456da862abeee338742d4c7bc6ac /MCServer
parentMerge pull request #1949 from SafwatHalaby/burn (diff)
parentFixed inter-plugin calls. (diff)
downloadcuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.gz
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.bz2
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.lz
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.xz
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.zst
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.zip
Diffstat (limited to 'MCServer')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua28
1 files changed, 10 insertions, 18 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index bffc6e844..a49f8b5a6 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -54,7 +54,7 @@ function Initialize(a_Plugin)
-- TestBlockAreas()
-- TestSQLiteBindings()
-- TestExpatBindings()
- -- TestPluginCalls()
+ TestPluginCalls()
TestBlockAreasString()
TestStringBase64()
@@ -157,26 +157,18 @@ function TestPluginCalls()
-- The Split parameter should be a table, but it is not used in that function anyway,
-- so we can get away with passing nil to it.
- -- Use the old, deprecated and unsafe method:
- local Core = cPluginManager:Get():GetPlugin("Core")
- if (Core ~= nil) then
- LOGINFO("Calling Core::ReturnColorFromChar() the old-fashioned way...")
- local Gray = Core:Call("ReturnColorFromChar", nil, "8")
- if (Gray ~= cChatColor.Gray) then
- LOGWARNING("Call failed, exp " .. cChatColor.Gray .. ", got " .. (Gray or "<nil>"))
- else
- LOGINFO("Call succeeded")
- end
- end
-
- -- Use the new method:
- LOGINFO("Calling Core::ReturnColorFromChar() the recommended way...")
- local Gray = cPluginManager:CallPlugin("Core", "ReturnColorFromChar", nil, "8")
+ LOG("Debuggers: Calling NoSuchPlugin.FnName()...")
+ cPluginManager:CallPlugin("NoSuchPlugin", "FnName", "SomeParam")
+ LOG("Debuggers: Calling Core.NoSuchFunction()...")
+ cPluginManager:CallPlugin("Core", "NoSuchFunction", "SomeParam")
+ LOG("Debuggers: Calling Core.ReturnColorFromChar(..., \"8\")...")
+ local Gray = cPluginManager:CallPlugin("Core", "ReturnColorFromChar", "split", "8")
if (Gray ~= cChatColor.Gray) then
- LOGWARNING("Call failed, exp " .. cChatColor.Gray .. ", got " .. (Gray or "<nil>"))
+ LOGWARNING("Debuggers: Call failed, exp " .. cChatColor.Gray .. ", got " .. (Gray or "<nil>"))
else
- LOGINFO("Call succeeded")
+ LOG("Debuggers: Call succeeded")
end
+ LOG("Debuggers: Inter-plugin calls done.")
end