本文整理汇总了Java中org.luaj.vm2.compiler.LuaC.install方法的典型用法代码示例。如果您正苦于以下问题:Java LuaC.install方法的具体用法?Java LuaC.install怎么用?Java LuaC.install使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.luaj.vm2.compiler.LuaC
的用法示例。
在下文中一共展示了LuaC.install方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: standardGlobals
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Create a standard set of globals for JSE including all the libraries.
*
* @return Table of globals initialized with the standard JSE libraries
* @see #debugGlobals()
* @see JsePlatform
* @see JmePlatform
*/
public static Globals standardGlobals() {
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JseMathLib());
globals.load(new JseOsLib());
// globals.load(new JseIoLib());//安全考虑,删除for LuaView
// globals.load(new LuajavaLib());//安全考虑,删除for LuaView
LoadState.install(globals);
LuaC.install(globals);
return globals;
}
示例2: main
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
//Globals globals = JsePlatform.standardGlobals();
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JseMathLib());
globals.load(new JseIoLib());
globals.load(new JseOsLib());
globals.load(new JavaLibInteractionTest());
LoadState.install(globals);
LuaC.install(globals);
System.out.println(new File(".").getAbsolutePath());
System.out.println(new File(args[0]).exists());
LuaValue chunk = globals.loadfile(new File(args[0]).getAbsolutePath());
chunk.call();
}
示例3: setupCompilerGlobal
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
private static Globals setupCompilerGlobal() {
// Create server globals with just enough library support to compile user
// scripts.
compiler = new Globals();
compiler.load(new JseBaseLib());
compiler.load(new PackageLib());
compiler.load(new StringLib());
// To load scripts, we occasionally need a math library in addition to compiler
// support.
// To limit scripts using the debug library, they must be closures, so we only
// install LuaC.
compiler.load(new JseMathLib());
LoadState.install(compiler);
LuaC.install(compiler);
// Set up the LuaString metatable to be read-only since it is shared across all
// scripts.
LuaString.s_metatable = new ReadOnlyLuaTable(LuaString.s_metatable);
return compiler;
}
示例4: standardGlobals
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Create a standard set of globals for JSE including all the libraries.
*
* @return Table of globals initialized with the standard JSE libraries
* @see #debugGlobals()
* @see JsePlatform
* @see org.luaj.vm2.lib.jme.JmePlatform
*/
public static Globals standardGlobals() {
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JseMathLib());
globals.load(new JseIoLib());
globals.load(new JseOsLib());
globals.load(new LuajavaLib());
LoadState.install(globals);
LuaC.install(globals);
return globals;
}
示例5: LuaScriptExecutorPool
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
public LuaScriptExecutorPool(GameScriptingEngine gameScriptingEngine, int poolSize, boolean sandboxed) {
this.gameScriptingEngine = gameScriptingEngine;
this.sandboxed = sandboxed;
executors = new ArrayBlockingQueue<ScriptExecutor<LuaValue>>(poolSize);
for (int i = 0; i < poolSize; i++) {
executors.offer(new LuaScriptExecutor(this));
}
if(sandboxed) {
//Create sandboxed compiler
sandboxedGlobals = new Globals();
sandboxedGlobals.load(new JseBaseLib());
sandboxedGlobals.load(new PackageLib());
sandboxedGlobals.load(new StringLib());
// To load scripts, we occasionally need a math library in addition to compiler support.
// To limit scripts using the debug library, they must be closures, so we only install LuaC.
sandboxedGlobals.load(new JseMathLib());
LoadState.install(sandboxedGlobals);
LuaC.install(sandboxedGlobals);
}
}
示例6: standardGlobals
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Create a standard set of globals for JSE including all the libraries.
*
* @return Table of globals initialized with the standard JSE libraries
* @see #debugGlobals()
* @see JsePlatform
* @see JmePlatform
*/
public static Globals standardGlobals() {
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JseMathLib());
globals.load(new JseIoLib());
globals.load(new JseOsLib());
globals.load(new LuajavaLib());
LoadState.install(globals);
LuaC.install(globals);
return globals;
}
示例7: LuaEngine
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
private LuaEngine() {
globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JseMathLib());
globals.load(new JseIoLib());
globals.load(new JseOsLib());
globals.load(new MultiDexLuajavaLib());
LoadState.install(globals);
LuaC.install(globals);
globals.finder = this;
globals.set("loadResource", new resLoader());
}
示例8: loadSkeletalAnimation
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
private static void loadSkeletalAnimation(Animation animation, File animationFile) throws IOException
{
Globals globals = new Globals();
globals.load(new PackageLib());
globals.load(new JseMathLib());
LoadState.install(globals);
LuaC.install(globals);
LuaValue chunk = globals.load(new FileReader(animationFile), "SkeletalAnimation");
chunk.call();
LuaTable rootT = globals.get("root").checktable();
LuaTable animationT = globals.get("animation").checktable();
loadAnimation(animation, animationT, rootT);
animation.root = loadBone(animation, rootT);
}
示例9: standardGlobals
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Create a standard set of globals for JME including all the libraries.
*
* @return Table of globals initialized with the standard JME libraries
* @see #debugGlobals()
* @see JsePlatform
* @see JmePlatform
*/
public static Globals standardGlobals() {
Globals globals = new Globals();
globals.load(new BaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new OsLib());
globals.load(new MathLib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JmeIoLib());
LoadState.install(globals);
LuaC.install(globals);
return globals;
}
示例10: standardGlobals
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Create a standard set of globals for JSE including all the libraries.
*
* @return Table of globals initialized with the standard JSE libraries
* @see #debugGlobals()
* @see org.luaj.vm2.lib.jse.JsePlatform
* @see org.luaj.vm2.lib.jme.JmePlatform
*/
public static Globals standardGlobals() {
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new JseMathLib());
globals.load(new JseOsLib());
LoadState.install(globals);
LuaC.install(globals);
return globals;
}
示例11: newStandard
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Create a new lua Globals object representing the standard one used in this game
*
* @return a new Globals instance
*/
public static Globals newStandard() {
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new Bit32Lib());
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new JseMathLib());
LoadState.install(globals);
LuaC.install(globals);
LuaJC.install(globals);
return globals;
}
示例12: initEnvironment
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
private void initEnvironment() {
environment = new Globals();
LoadState.install(environment);
LuaC.install(environment);
LuaJC.install(environment);
modsTable = new LuaTable();
environment.set("mods", modsTable);
}
示例13: ScriptingManager
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
public ScriptingManager(File scriptDirectory, StrictModeOption strictMode) {
this.scriptDirectory = scriptDirectory;
modules = new HashMap<>();
this.strictMode = strictMode;
globals = createGlobals();
LuaC.install(globals);
}
示例14: reset
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
/**
* Resets the script manager.
*/
public void reset() {
//re-install globals to ensure that require()-d modules are also reloaded
globals = createGlobals();
LuaC.install(globals);
for (ScriptingModule module : modules.values()) {
module.reset();
}
}
示例15: LuaInstance
import org.luaj.vm2.compiler.LuaC; //导入方法依赖的package包/类
public LuaInstance() throws AerospikeException {
globals.load(new JseBaseLib());
globals.load(new PackageLib());
//globals.load(new Bit32Lib()); // not needed for 5.1 compatibility
globals.load(new TableLib());
globals.load(new StringLib());
globals.load(new CoroutineLib());
globals.load(new JseMathLib());
globals.load(new JseIoLib());
globals.load(new JseOsLib());
globals.load(new LuajavaLib());
globals.load(new DebugLib());
LuaTable packageTable = (LuaTable)globals.get("package");
loadedTable = (LuaTable)packageTable.get("loaded");
globals.load(new LuaBytesLib(this));
globals.load(new LuaListLib(this));
globals.load(new LuaMapLib(this));
globals.load(new LuaStreamLib(this));
LuaC.install(globals);
load("compat52", true);
load("as", true);
load("stream_ops", true);
load("aerospike", true);
globals.load(new LuaAerospikeLib(this));
}