From e07c54f7f80fc6fe6f2abd8f81b45c8d6dc4e2d7 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 1 Dec 2013 16:34:04 +0100 Subject: APIDump: Added missing params to OnPlayerRightClick() hook. --- MCServer/Plugins/APIDump/Hooks/OnPlayerRightClick.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerRightClick.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerRightClick.lua index d767b449d..de9b3662c 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnPlayerRightClick.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerRightClick.lua @@ -21,6 +21,9 @@ return { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, { Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player interacted. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the mouse crosshair on the block" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the mouse crosshair on the block" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the mouse crosshair on the block" }, }, Returns = [[ If the function returns false or no value, MCServer calls other plugins' callbacks and finally sends -- cgit v1.2.3 From 70cf0c09a875f578cc9be9ebf7a900c3e857a2a5 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 2 Dec 2013 22:36:43 +0100 Subject: The server builds and uses Lua as DLL in Debug mode. This is a test to see how LuaRocks will interact. Only debug mode on Windows is affected, all other platforms and modes are unchanged. --- MCServer/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'MCServer') diff --git a/MCServer/.gitignore b/MCServer/.gitignore index c03bcbe99..1fed134fe 100644 --- a/MCServer/.gitignore +++ b/MCServer/.gitignore @@ -1,4 +1,7 @@ *.exe +*.dll +*.exp +*.lib *.ini MCServer logs @@ -20,3 +23,4 @@ valgrind.log motd.txt *.deuser *.dmp +*.xml -- cgit v1.2.3 From 0a2fcf909c5affcb13ef42377c6e0c880dd887c7 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 3 Dec 2013 21:48:40 +0100 Subject: Added a quick LuaRocks testing plugin. You need to install the luarocks system and through it the luasocket and 30log rocks. --- MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua (limited to 'MCServer') diff --git a/MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua b/MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua new file mode 100644 index 000000000..6e90b1ae9 --- /dev/null +++ b/MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua @@ -0,0 +1,49 @@ + +-- TestLuaRocks.lua + +-- This is a mockup plugin that does a quick test of LuaRocks capability in MCServer + +-- "Success" is when the plugin loads, downloads the forum webpage and displays the headers and length and then displays both libs as loaded. +-- "Failure" usually manifests as one of the "require" lines failing, although you have the luarock installed. +-- Note that the plugin deliberately never fully loads, so that it can be reloaded fast by pressing its Enable button in the webadmin's plugin list. + + + + + + +local log30 = require("30log"); +local socket = require("socket"); +local http = require("socket.http"); + + + + + +LOGINFO("Trying to download a webpage..."); +local body, code, headers = http.request('http://forum.mc-server.org/index.php'); +LOG("code: " .. tostring(code)); +LOG("headers: "); +for k, v in pairs(headers or {}) do + LOG(" " .. k .. ": " .. v); +end +LOG("body length: " .. string.length(body)); + + + + + +function Initialize(a_Plugin) + if (socket == nil) then + LOG("LuaSocket not found"); + else + LOG("LuaSocket loaded"); + end + if (log30 == nil) then + LOG("30log not found"); + else + LOG("30log loaded"); + end + LOGINFO("Preventing plugin load so that it may be requested again from the webadmin."); + return false; +end \ No newline at end of file -- cgit v1.2.3 From 5832781727784c9926e397f3ff61d0d456c64797 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 3 Dec 2013 21:15:43 +0000 Subject: Updated TransAPI, fixes #389 @madmaxoft is this the right API usage? --- MCServer/Plugins/TransAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/TransAPI b/MCServer/Plugins/TransAPI index 52e1de433..da2723724 160000 --- a/MCServer/Plugins/TransAPI +++ b/MCServer/Plugins/TransAPI @@ -1 +1 @@ -Subproject commit 52e1de4332a026e58fda843aae98c1f51e57199e +Subproject commit da272372406e0990235b008dba73b7bfbda040e8 -- cgit v1.2.3