Class used to load Lua script files. This script engine is an optional one and can be disabled by commenting a single line of code.
Пример #1
0
        /// <summary>
        ///   Creates a new instance of ScriptManager
        /// </summary>
        /// <param name="scriptPath">Path to scripts.</param>
        public ScriptManager(string scriptPath)
        {
            _scriptsPath = scriptPath;
            sUtilities.CreateDirectory(scriptPath);

            if (ScriptsConfig.Lua)
            {
                sUtilities.CreateDirectory(Path.Combine(scriptPath, "Lua"));
                _luaEngine = new LuaEngine.LuaEngine(Path.Combine(scriptPath, "Lua"));
            }
            else
            {
                Log.Warning("ScriptManager", sLConsole.GetString("Lua support is disabled!"));
            }

            if (ScriptsConfig.Python)
            {
                sUtilities.CreateDirectory(Path.Combine(scriptPath, "Python"));
                _pythonEngine = new PythonEngine.PythonEngine(Path.Combine(scriptPath, "Python"));
            }
            else
            {
                Log.Warning("ScriptManager", sLConsole.GetString("Python support is disabled!"));
            }
        }
Пример #2
0
        /// <summary>
        ///   Creates a new instance of ScriptManager
        /// </summary>
        /// <param name="scriptPath">Path to scripts.</param>
        public ScriptManager(string scriptPath)
        {
            _scriptsPath = scriptPath;
            sUtilities.CreateDirectory(scriptPath);

            if(ScriptsConfig.Lua)
            {
                sUtilities.CreateDirectory(Path.Combine(scriptPath, "Lua"));
                _luaEngine = new LuaEngine.LuaEngine(Path.Combine(scriptPath, "Lua"));
            }
            else
                Log.Warning("ScriptManager", sLConsole.GetString("Lua support is disabled!"));

            if(ScriptsConfig.Python)
            {
                sUtilities.CreateDirectory(Path.Combine(scriptPath, "Python"));
                _pythonEngine = new PythonEngine.PythonEngine(Path.Combine(scriptPath, "Python"));
            }
            else
                Log.Warning("ScriptManager", sLConsole.GetString("Python support is disabled!"));
        }