Ejemplo n.º 1
0
 /// <summary>
 /// Stops the master server dll concurrent task
 /// </summary>
 private static void StopMasterServerDll()
 {
     LmpDomain.SetData("Stop", true);
     Thread.Sleep(10000);
     AppDomain.Unload(LmpDomain);
     Console.Clear();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Starts the master server dll
        /// </summary>
        private static void StartMasterServerDll()
        {
            LmpDomain = AppDomain.CreateDomain("LMP.MasterServer", null, DomainSetup);
            LmpDomain.SetData("Arguments", Arguments);
            LmpDomain.SetData("Stop", false);

            LmpDomain.DoCallBack(async() =>
            {
                //Reload the uhttpSharp dll as otherwise on linux it fails
                var uhttpSharpPath = Path.Combine(Directory.GetCurrentDirectory(), "uhttpsharp.dll");
                AppDomain.CurrentDomain.Load(File.ReadAllBytes(uhttpSharpPath));

                AppDomain.CurrentDomain.Load(File.ReadAllBytes(DllPath));
                var assembly   = AppDomain.CurrentDomain.Load(File.ReadAllBytes(DllPath));
                var entryPoint = assembly.GetType("LMP.MasterServer.EntryPoint");

                entryPoint.GetMethod("MainEntryPoint")?.Invoke(null, new[] { AppDomain.CurrentDomain.GetData("Arguments") });

                while (!(bool)AppDomain.CurrentDomain.GetData("Stop"))
                {
                    await Task.Delay(100);
                }

                entryPoint.GetMethod("Stop")?.Invoke(null, new object[0]);
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Starts the master server dll
        /// </summary>
        private static void StartMasterServerDll()
        {
            LmpDomain = AppDomain.CreateDomain("LMP.MasterServer", null, DomainSetup);
            LmpDomain.SetData("Arguments", Arguments);
            LmpDomain.SetData("Stop", false);

            LmpDomain.DoCallBack(async() =>
            {
                var assembly   = AppDomain.CurrentDomain.Load(File.ReadAllBytes(DllPath));
                var entryPoint = assembly.GetType("LMP.MasterServer.EntryPoint");

                entryPoint.GetMethod("MainEntryPoint")?.Invoke(null, new[] { AppDomain.CurrentDomain.GetData("Arguments") });

                while (!(bool)AppDomain.CurrentDomain.GetData("Stop"))
                {
                    await Task.Delay(100);
                }

                entryPoint.GetMethod("Stop")?.Invoke(null, new object[0]);
            });
        }