Jump to content

Lua binary lib loading is blocked?


Recommended Posts

I suppose this is done for anti-cheating and/or anti DRM blocking reasons?

Quote

[00:08:22]: error loading module 'socket.core' from file '../mods/web-admin\scripts\socket\core.dll':
    DLL Loading blocked for - ../mods/web-admin\scripts\socket\core.dll
 

I suppose I can understand that, though I was hoping to introduce a web server via a mod to enable web administration, but if I can't use lua's socket lib that's not going to be possible. I suppose I could go another route, say an external node js server using IPC to read/write stdin/out of the server process, though I'm not sure how well that works on non *nix platforms, it's also a lot less user friendly than just enabling a mod and being ready to go.

I've noticed that there's a TheSim:QueryServer() method that could make posts/gets to an external server that could periodically poll secondary process listening on localhost if I did go that route. That external process could queue up commands and deliver them when the server does a GET, but that's incredibly clunky. A websocket would be better, but again, we can't inject a lib to support it apparently. :(

 

So, my question to the mod community: do you folks have any thoughts/suggestions on how to go about something like this if we can't inject lua binary libs? 

Link to comment
Share on other sites

The modding portion was written to be sandboxed and multi-platform.

So having a dll wouldn't work for *ni/X.

Since it's a sandbox loading in unsigned code that could escape the box easily is clearly not allowed, and finding a way to do that would be an exploit which you should report to Klei to stop others from doing really bad things.

 

As for using external methods to do this you could read/write to a virtual file or use a named pipe for inter-process communication.

This won't be too user-friendly as clicking a subscribe button and being good to go- the system in place wasn't designed for it.

However, for workarounds, anything file-based for transferring data is pretty cross-platform.

Link to comment
Share on other sites

That's what I figured the case was. 

So, another thought. To keep things lua friendly, is it okay to implement a REST server in LUA, and ship the lua socket libs and executable in the mod download? That way the game engine would not be asked to load it, but a mod could start up the external webserver which could then use IPC to its child. The mod would then serve as a point to dispatch and receive buffered commands in the pipe coming from that external webserver.  If the sandbox is allowed to fork a child that could still work and still be an easy download, although I'm not sure if it's okay to package binaries in the mod tools, and of course it opens up a trust problem since this would be a binary outside the sandbox.

Maybe I'm just trying to go too far within the mod system?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...