[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Multiple lua instances
- From: ingmar wirths <ingmania@...>
- Date: Tue, 19 Jan 2010 18:37:25 +0100
>> hm.. actually, i would like to permit the user to introduce new functions
>> at his
>> caprice. Can i still put them in a sandbox automatically somehow?
>
> You do that when you load their code:
>
> code = loadfile ( "path/to/users.lua" ) -- Load user's code
> setfenv ( code , { print = print } ) -- Sandbox user code
> code ( ) -- Run user's code
>
> ^^ you load the user's script//code like this. you can do a similar thing
> from the C api too.
Ok, thanks, i guess that answers my questions. Thank you all for your help ~
- References:
- Multiple lua instances, ingmar wirths
- Re: Multiple lua instances, Rob Kendrick
- Re: Multiple lua instances, ingmar wirths
- Re: Multiple lua instances, Rob Kendrick
- Re: Multiple lua instances, ingmar wirths
- Re: Multiple lua instances, Rob Kendrick
- Re: Multiple lua instances, ingmar wirths
- Re: Multiple lua instances, Rob Kendrick
- Re: Multiple lua instances, ingmar wirths
- Re: Multiple lua instances, Quae Quack