Page 1 of 1

Some questions about love.thread

Posted: Tue Aug 25, 2015 3:14 pm
by louie999
In the game I'm making I want it to be that people can mod my game, but I want to restrict the use of some functions by the user, can I do that by using love.thread?

Re: Some questions about love.thread

Posted: Tue Aug 25, 2015 5:32 pm
by Nixola
I think a combination of [wiki]love.filesystem.load[/wiki] and [manual]setfenv[/manual] would be what you need.

Re: Some questions about love.thread

Posted: Thu Aug 27, 2015 1:11 pm
by T-Bone
love.thread could be used like that, yes. The mod's code would run on a thread, and is allowed to affect the game code only via a well-defined thread-communication API. It's not the first thing I'd try, but it could work. There are some security issues you might want to think about; you probably want some kind of sandboxing anyway and then I don't think the separate thread would matter as much.