LuaSettings

A LuaSettings object defines the settings on how Lua will execute code. These settings cannot be changed once they have been loaded into a Lua or LuaEnvironment constructor.

Name

Default: null

This is the name of the object for use with debugging.

Libraries

Default: LuaLibraries.UseDefault

Which libraries that Lua code will have access to. These are the same as defined in the Lua specification. LuaLibraries.UseDefault will convert to LuaLibraries.All when given to Lua. To specify more than one, use the bitwise OR (|).

ClassAccess

Default: LuaClassAccess.Registered

What types a Lua defined class can derive from. Default is only from those explicitly registered to Lua. LuaClassAccess.System allows any type that is defined in a System library (as long as the assembly is referenced in AppDomain.CurrentDomain.GetAssemblies()). LuaClassAccess.All allows any type the hosting environment has access to.

Encoding

Default: null

The default encoding to use when writing to files using the io library. If null it will use Encoding.UTF8.

ModuleBinder

Default: null

The binder that will load modules into Lua, set to null to use the default, (see Modules).

AllowNonSeekStreams

Default: false

Whether to allow non-seekable streams. When code is loaded, they are first hashed to determine if it has already been loaded. A stream can only be hashed if it is seekable. If this is true, then any non-seekable streams will always parse, even if they have been already loaded. If this is set to false, an exception is thrown.

AllowReflection

Default: false

Whether to allow Lua to access reflection. For example, if Lua calls obj.GetType() it can access members that are not normally available to it. This ensure that GetType and all other reflection objects are not visible to Lua. If this is true, then it is allowed to access reflection.

EnsureReturnType

Default: false

Whether Lua will have acccess to the backing type of a return value or only the type of the return. By default, Lua will have access according to the backing object type. This means when you return an object, it will still have access as if the return type was the same as the object's type. If this is true, then the framework will ensure that Lua only has access according to the type of the return value.

Last edited May 26, 2013 at 2:56 AM by ModMaker, version 2

Comments

No comments yet.