public void Start() { string FougeriteDirectoryConfig = Path.Combine(Util.GetServerFolder(), "FougeriteDirectory.cfg"); Config.Init(FougeriteDirectoryConfig); Logger.Init(); _timergo = new GameObject(); _timergo.AddComponent <CTimerHandler>(); UnityEngine.Object.DontDestroyOnLoad(_timergo); CTimer.StartWatching(); Rust.Steam.Server.SetModded(); Rust.Steam.Server.Official = false; if (ApplyOptions()) { //ModuleManager.LoadModules(); LuaPluginLoader.GetInstance(); CSharpPluginLoader.GetInstance(); JavaScriptPluginLoader.GetInstance(); PythonPluginLoader.GetInstance(); Fougerite.Hooks.ServerStarted(); Fougerite.ShutdownCatcher.Hook(); } SQLiteConnector.GetInstance.Setup(); }
/// <summary> /// Execute a lua script, given the /// path to the LUA script containing the message template definitions. After /// using this function, use <see cref="TemplateExists"/>, /// <see cref="GetTemplate"/>, and <see cref="GetAllTemplates"/> to /// examine initialized template structures. /// </summary> /// <param name="templateDefinitionScriptPath">LUA script file path</param> /// public bool ExecuteTemplate(string templateDefinitionScriptPath) { bool result = false; try { lastError = "no error."; LuaPluginLoader loader = new LuaPluginLoader(); LuaPredefMgrPlugin predef = new LuaPredefMgrPlugin(); loader.RegisterPlugin(predef); LuaDictionaryPlugin dic = new LuaDictionaryPlugin(); loader.RegisterPlugin(dic); LuaUtilPlugin util = new LuaUtilPlugin(); loader.RegisterPlugin(util); LuaTimerPlugin timer = new LuaTimerPlugin(); loader.RegisterPlugin(timer); LuaBaseConstantsPlugin constants1 = new LuaBaseConstantsPlugin(); loader.RegisterPlugin(constants1); LuaMissionConstantsPlugin constants2 = new LuaMissionConstantsPlugin(); loader.RegisterPlugin(constants2); LuaInfotainmentConstantsPlugin constants3 = new LuaInfotainmentConstantsPlugin(); loader.RegisterPlugin(constants3); LuaLanguageConstantsPlugin constants4 = new LuaLanguageConstantsPlugin(); loader.RegisterPlugin(constants4); using (Lua lua = new Lua()) { loader.LoadPlugins(lua); lua.DoString("function dofile(...) end;"); lua.DoFile(templateDefinitionScriptPath); lua.GetFunction("_Initialization").Call(new object[0]); this.templates = predef.Templates; result = true; } } catch (Exception ex) { LogManager.WriteLog( TraceType.ERROR, "ExecuteTemplate error : Predefined message template file not valid [" + templateDefinitionScriptPath + "]", "PIS.Ground.InstantMessage.TemplateListAccessorClass", ex, EventIdEnum.InstantMessage); lastError = ex.Message; } return(result); }
/// <summary> /// Loads this extension /// </summary> public override void Load() { // Setup Lua instance InitialiseLua(); // Register the loader loader = new LuaPluginLoader(LuaEnvironment); Manager.RegisterPluginLoader(loader); }
/// <summary> /// Loads this extension /// </summary> public override void Load() { // Setup Lua instance InitializeLua(); // Register the loader loader = new LuaPluginLoader(LuaEnvironment, this); Manager.RegisterPluginLoader(loader); Cleanup.Add(Path.Combine(Interface.Oxide.ExtensionDirectory, "x64/lua51.dll")); Cleanup.Add(Path.Combine(Interface.Oxide.ExtensionDirectory, "x86/lua51.dll")); }
public void Start() { string FougeriteDirectoryConfig = Path.Combine(Util.GetServerFolder(), "FougeriteDirectory.cfg"); Config.Init(FougeriteDirectoryConfig); Logger.Init(); Rust.Steam.Server.SetModded(); Rust.Steam.Server.Official = false; if (ApplyOptions()) { //ModuleManager.LoadModules(); LuaPluginLoader.GetInstance(); CSharpPluginLoader.GetInstance(); JavaScriptPluginLoader.GetInstance(); PythonPluginLoader.GetInstance(); Fougerite.Hooks.ServerStarted(); Fougerite.ShutdownCatcher.Hook(); } SQLiteConnector.GetInstance.Setup(); }
/// <summary> /// Execute a lua script, given the /// path to the LUA script containing the message template definitions. After /// using this function, use <see cref="TemplateExists"/>, /// <see cref="GetTemplate"/>, and <see cref="GetAllTemplates"/> to /// examine initialized template structures. /// </summary> /// <param name="templateDefinitionScriptPath">LUA script file path</param> /// public bool ExecuteTemplate(string templateDefinitionScriptPath, List <string> scriptsList) { bool result = false; try { lastError = "no error."; LuaPluginLoader loader = new LuaPluginLoader(); LuaPredefMgrPlugin predef = new LuaPredefMgrPlugin(); loader.RegisterPlugin(predef); LuaEventMgrPlugin evtmgr = new LuaEventMgrPlugin(); loader.RegisterPlugin(evtmgr); LuaTagConstantsPlugin tag = new LuaTagConstantsPlugin(); loader.RegisterPlugin(tag); LuaDictionaryPlugin dic = new LuaDictionaryPlugin(); loader.RegisterPlugin(dic); LuaUtilPlugin util = new LuaUtilPlugin(); loader.RegisterPlugin(util); LuaReportPlugin report = new LuaReportPlugin(); loader.RegisterPlugin(report); LuaDataplugPlugin dataplug = new LuaDataplugPlugin(); loader.RegisterPlugin(dataplug); LuaTimerPlugin timer = new LuaTimerPlugin(); loader.RegisterPlugin(timer); LuaAVStreamMgrPlugin avstreammgr = new LuaAVStreamMgrPlugin(); loader.RegisterPlugin(avstreammgr); LuaDecisionMatrixPlugin matrix = new LuaDecisionMatrixPlugin(); loader.RegisterPlugin(matrix); LuaDm400TPlugin player400t = new LuaDm400TPlugin(); loader.RegisterPlugin(player400t); Lua100TPlugin player100t = new Lua100TPlugin(); loader.RegisterPlugin(player100t); Lua150TPlugin player150t = new Lua150TPlugin(); loader.RegisterPlugin(player150t); Lua180TPlugin player180t = new Lua180TPlugin(); loader.RegisterPlugin(player180t); LuaPlaylistPlugin playlist = new LuaPlaylistPlugin(); loader.RegisterPlugin(playlist); LuaPlayerPldPlugin playerPld = new LuaPlayerPldPlugin(); loader.RegisterPlugin(playerPld); LuaPlayerVVPlugin playerVV = new LuaPlayerVVPlugin(); loader.RegisterPlugin(playerVV); LuaEventSchedulerPlugin eventScheduler = new LuaEventSchedulerPlugin(); loader.RegisterPlugin(eventScheduler); LuaLmtDbPlugin lmtDb = new LuaLmtDbPlugin(); loader.RegisterPlugin(lmtDb); LuaSpeechPlugin speech = new LuaSpeechPlugin(); loader.RegisterPlugin(speech); LuaPlayerMp3Plugin playerMp3 = new LuaPlayerMp3Plugin(); loader.RegisterPlugin(playerMp3); LuaSonoDbPlugin sonoDb = new LuaSonoDbPlugin(); loader.RegisterPlugin(sonoDb); LuaTaskSchedulerPlugin taskScheduler = new LuaTaskSchedulerPlugin(); loader.RegisterPlugin(taskScheduler); LuaPlayerWavPlugin playerWav = new LuaPlayerWavPlugin(); loader.RegisterPlugin(playerWav); LuaMissionDataClientPlugin mission_data = new LuaMissionDataClientPlugin(); loader.RegisterPlugin(mission_data); LuaBaseConstantsPlugin constants1 = new LuaBaseConstantsPlugin(); loader.RegisterPlugin(constants1); LuaMissionConstantsPlugin constants2 = new LuaMissionConstantsPlugin(); loader.RegisterPlugin(constants2); LuaInfotainmentConstantsPlugin constants3 = new LuaInfotainmentConstantsPlugin(); loader.RegisterPlugin(constants3); LuaLanguageConstantsPlugin constants4 = new LuaLanguageConstantsPlugin(); loader.RegisterPlugin(constants4); LuaPisConstantsPlugin constants5 = new LuaPisConstantsPlugin(); loader.RegisterPlugin(constants5); LuaConfigConstantsPlugin constants6 = new LuaConfigConstantsPlugin(); loader.RegisterPlugin(constants6); LuaTrainConstantsPlugin constants7 = new LuaTrainConstantsPlugin(); loader.RegisterPlugin(constants7); using (Lua lua = new Lua()) { loader.LoadPlugins(lua); lua.DoString("function dofile(...) end;"); foreach (string script in scriptsList) { lua.DoFile(script); } lua.DoFile(templateDefinitionScriptPath); lua.GetFunction("_Initialization").Call(new object[0]); this.templates = predef.Templates; } result = true; } catch (Exception ex) { LogManager.WriteLog( TraceType.ERROR, "ExecuteTemplate error : Predefined message template file not valid [" + templateDefinitionScriptPath + "]", "PIS.Ground.InstantMessage.TemplateListAccessorClass", ex, EventIdEnum.InstantMessage); lastError = ex.Message; } return(result); }