/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fm.ak.server.lua;
import fm.ak.server.Main;
import fm.ak.server.sutil;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.jse.JsePlatform;
/**
* Singleton City
* @author Petre
*/
public class luautil {
final static String LUADIR = "lua";
public static boolean init () {
String script = LUADIR + "\\sv_init.lua";
LuaValue _G = JsePlatform.standardGlobals();
try {
_G.get("dofile").call(LuaValue.valueOf(script));
} catch (org.luaj.vm2.LuaError ex) {
Main.ui.commitln("Error: " + ex.getMessage());
Main.ui.commitln(sutil.ADVICE.REINSTALL.s());
return true;
}
return false;
}
}