Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
I found a binary installer for luarocks for windows, installed it normally, from MSVC's command prompt (so that it can find the compiler).
How did you install for linux, did you use a specific luarocks package, or did you build from source? If building yourself, you might need to modify Lua compilation to support dynamic libraries.
I wonder now, maybe we broke something in MCServer linux compilation and it doesn't support dynamic libraries in its Lua engine anymore. I'll check this out.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
01-09-2014, 04:51 PM
(This post was last modified: 01-09-2014, 05:06 PM by xoft.)
You're right, the Lua compilation has been butchered. Working on it now.
Please try out the LuaDlFix branch, it should provide a fix for *nix versions.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
I don't understand what exactly you want. If you need to store "name"="value" pairs in Lua, use a regular Lua table; internally it is a hashmap.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
As for the first error, we just found out about some issues with Lua files being loaded in different orders. As an easy fix, make sure either:
1, The handler function and the registration are at the same file, and the handler is above the registration
2, The handler function is global in any file and the registration is done within the plugin's Initialize() function.
The error message basically tells you that you have provided wrong types of arguments - the AddHook() function was expecting a number and a function, and it got a number (TNUMBER) and a nil (TNIL). That means that the OnPlayerChat is not defined at the moment when the AddHook() function is being called.
The second error, "Transport endpoint is not connected", is a known side-effect, it is safe to ignore it (it just means that the client closed the connection before we told them that we're disconnecting). There's no harm in there.