Exemple #1
0
        public CommandHandler(ControlInterface ctrlInterface, GlobalConfig config)
        {
            this.commandQueue  = new CommandQueue(ctrlInterface);
            this.ctrlInterface = ctrlInterface;
            this.config        = config;

            eventCallback       = LuaEventHandler;
            luaEventCallbackPtr = Marshal.GetFunctionPointerForDelegate(eventCallback);
            frameName           = SFUtil.GetRandomAsciiString(5);

            ResolveEndSceneAddress();
            RegisterFunctions();
        }
Exemple #2
0
        public void InitializeLuaEventFrameHandler_W()
        {
            if (luaEventFunctionName != null)
            {
                return;
            }

            luaEventFunctionName = config.LuaPlugFunctionName ?? SFUtil.GetRandomAsciiString(4);

            FrameScript__RegisterFunction(luaEventFunctionName, luaEventCallbackPtr);
            FrameScript__Execute($"if not {frameName} then  {frameName} = CreateFrame('Frame'); end; {frameName}:SetScript('OnEvent', function(self, eventName, ...) {luaEventFunctionName}(eventName, ...) end); {frameName}:RegisterAllEvents();", 0, 0);

            wardenScan = false;
        }
Exemple #3
0
        public void InitializeLuaEventFrameHandler()
        {
            if (luaEventFunctionName != null)
            {
                return;
            }

            while (wardenScan)
            {
                Thread.Sleep(200);
            }

            luaEventFunctionName = config.LuaPlugFunctionName ?? SFUtil.GetRandomAsciiString(4);

            commandQueue.Submit <object>((() =>
            {
                FrameScript__RegisterFunction(luaEventFunctionName, luaEventCallbackPtr);
                FrameScript__Execute($"if not {frameName} then  {frameName} = CreateFrame('Frame'); end; {frameName}:SetScript('OnEvent', function(self, eventName, ...) {luaEventFunctionName}(eventName, ...) end); {frameName}:RegisterAllEvents();", 0, 0);

                return(null);
            }));
        }