示例#1
0
        public void Run(
            RemoteHooking.IContext context,
            string channelName
            , HookParameter parameter
            )
        {
            frameCount = 0;
            try
            {
                LuaDLL.Uninstall();
                LuaDLL.HookLoadLibrary();
                LuaDLL.BindEasyHook();
                MessageBox.Show("success");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            NetWorkClient.ConnectServer("127.0.0.1", 2333);
            while (true)
            {
                Thread.Sleep(100);
                frameCount++;
            }
        }
示例#2
0
        public static void OnStartGame()
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif
            if (isInite)
            {
                return;
            }

            isInite = true;
            setting = LuaDeepProfilerSetting.Instance;
            LPLuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
            if (setting.isNeedCapture)
            {
                Screen.SetResolution(480, 270, true);
            }

#if UNITY_EDITOR
            if (setting.isDeepLuaProfiler)
            {
                LuaDLL.Uninstall();
                LuaDLL.HookLoadLibrary();
                LuaDLL.BindEasyHook();
                //LuaDLL.Install();
            }
#endif

            if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler || setting.isCleanMode)
            {
                GameObject go = new GameObject();
                go.name      = "MikuLuaProfiler";
                go.hideFlags = HideFlags.HideAndDontSave;
                DontDestroyOnLoad(go);
                go.AddComponent <HookLuaSetup>();
                if (!setting.isLocal)
                {
                    LPNetWorkClient.ConnectServer(setting.ip, setting.port);
                }
            }
        }
示例#3
0
        public static void OnStartGame()
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif
#if UNITY_EDITOR_WIN
            string path  = null;
            var    files = System.IO.Directory.GetFiles(Application.dataPath, "EasyHook64.bin", System.IO.SearchOption.AllDirectories);
            if (files.Length > 0)
            {
                path = files[0];
            }
            if (!string.IsNullOrEmpty(path))
            {
                IntPtr ptr = LoadLibrary(path);
                if (ptr == null)
                {
                    Debug.LogError("dont't move dll file to other place");
                    return;
                }
            }
            else
            {
                Debug.LogError("no EasyHook64.bin");
                return;
            }
#endif
            if (isInite)
            {
                return;
            }

            isInite = true;
            setting = LuaDeepProfilerSetting.Instance;
            LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
            if (setting.isNeedCapture)
            {
                Screen.SetResolution(480, 270, true);
            }

#if UNITY_EDITOR
            if (setting.isDeepLuaProfiler)
            {
                LuaDLL.Uninstall();
                LuaDLL.HookLoadLibrary();
                LuaDLL.BindEasyHook();
                //LuaDLL.Install();

                if (setting.isCleanMode)
                {
                    LuaProfilerPrecompileSetting.CompileLuaScript(false);
                }
            }
#endif

            if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler || setting.isCleanMode)
            {
                GameObject go = new GameObject();
                go.name      = "MikuLuaProfiler";
                go.hideFlags = HideFlags.HideAndDontSave;
                DontDestroyOnLoad(go);
                go.AddComponent <HookLuaSetup>();
                if (!setting.isLocal)
                {
                    NetWorkClient.ConnectServer(setting.ip, setting.port);
                }
            }
        }
示例#4
0
        public static void OnStartGame()
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif
#if UNITY_EDITOR_WIN
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(true);
            System.Diagnostics.StackFrame sf = st.GetFrame(0);
            string path = sf.GetFileName();

            path = path.Replace("Core\\LuaHookSetup.cs", "Plugins\\EasyHook64.dll");
            IntPtr ptr = LoadLibrary(path);
            if (ptr == null)
            {
                Debug.LogError("dont't move dll file to other place");
                return;
            }
#endif
            if (isInite)
            {
                return;
            }

            isInite = true;
            setting = LuaDeepProfilerSetting.Instance;
            LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
            if (setting.isNeedCapture)
            {
                Screen.SetResolution(480, 270, true);
            }

#if UNITY_EDITOR
            if (setting.isDeepLuaProfiler)
            {
                LuaDLL.Uninstall();
                LuaDLL.HookLoadLibrary();
                LuaDLL.BindEasyHook();
                //LuaDLL.Install();

                if (setting.isCleanMode)
                {
                    LuaProfilerPrecompileSetting.CompileLuaScript(false);
                }
            }
#endif

            if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler || setting.isCleanMode)
            {
                GameObject go = new GameObject();
                go.name      = "MikuLuaProfiler";
                go.hideFlags = HideFlags.HideAndDontSave;
                DontDestroyOnLoad(go);
                go.AddComponent <HookLuaSetup>();
                if (!setting.isLocal)
                {
                    NetWorkClient.ConnectServer(setting.ip, setting.port);
                }
            }
        }