Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #6
0
 public LuaEngineTraceLineDebugger(LuaEngine engine)
 {
     this.engine = engine;
 }             // ctor