Example #1
0
            private DateTime compiledStamp;             // Last time compiled

            public LuaFileScript(LuaEngine engine, string scriptId, FileInfo fileSource, Encoding encoding, bool compileWithDebugger)
                : base(engine, scriptId, compileWithDebugger)
            {
                this.fileSource    = fileSource;
                this.encoding      = encoding ?? Encoding.Default;
                this.compiledStamp = DateTime.MinValue;

                // compile an add
                Compile();
            }             // ctor
Example #2
0
            private DEConfigItem currentItem = null;             // current node, that is used as parent

            public LuaDebugSession(LuaEngine engine, IDEWebSocketContext context)
            {
                this.engine  = engine;
                this.log     = LoggerProxy.Create(engine.Log, "Debug Session");
                this.context = context;

                cancelSessionTokenSource = new CancellationTokenSource();
                sessionTask = Task.Run(Execute, cancelSessionTokenSource.Token);

                UseNode("/");

                Info("Debug session established.");
            }             // ctor
Example #3
0
            protected LuaScript(LuaEngine engine, string scriptId, bool compileWithDebugger)
            {
                this.engine   = engine;
                this.log      = LoggerProxy.Create(engine.Log, scriptId);
                this.scriptId = scriptId;

                this.chunk = null;
                this.compiledWithDebugger = compileWithDebugger;

                // attach the script to the engine
                engine.AddScript(this);

                log.Info("HinzugefĆ¼gt.");
            }             // ctor
Example #4
0
            public LuaMemoryScript(LuaEngine engine, Func <TextReader> code, string name, KeyValuePair <string, Type>[] args)
                : base(engine, Guid.NewGuid().ToString("D"), false)
            {
                this.name = name;

                try
                {
                    Compile(code, args);
                }
                catch (Exception e)
                {
                    LogLuaException(e);
                }
            }             // ctor
Example #5
0
            public LuaAttachedGlobal(LuaEngine engine, string scriptId, LuaTable table, bool autoRun)
            {
                this.engine    = engine;
                this.log       = LoggerProxy.Create(GetHostLog(table) ?? engine.Log, scriptId);
                this.scriptId  = scriptId;
                this.table     = table;
                this.autoRun   = autoRun;
                this.needToRun = autoRun;

                // Run the script
                if (needToRun && IsCompiled)
                {
                    Run(false);
                }
            }             // ctor
Example #6
0
 public LuaEngineTraceLineDebugger(LuaEngine engine)
 {
     this.engine = engine;
 }             // ctor