コード例 #1
0
ファイル: EntryHotSwap.cs プロジェクト: Cooble/NiceDay
        int counterToCheckAssLoad;//will wait for a while and then checks if managed was loaded if autoload is enabled

        public override void OnAttach()
        {
            AssemblyLocator.InitPaths();
            counterToCheckAssLoad = ASS_CHECK_INTERVAL * 2;
            Log.ND_TRACE("C# scripting attached: HotSwap");

            if (ASS_CHECK_INTERVAL == 0)//will be resolved in OnUpdate()
            {
                LoadDomain();
            }
        }
コード例 #2
0
ファイル: EntryCold.cs プロジェクト: Cooble/NiceDay
 public override void OnAttach()
 {
     Log.ND_TRACE("C# scripting attached: Cold\n -> Loading assembly");
     AssemblyLocator.InitPaths();
     AssemblyLocator.CheckForModification();
     AssemblyLocator.CopyAssembly();
     if (!File.Exists(AssemblyLocator.DOMAIN_PATH))
     {
         Log.ND_ERROR("Cannot load dll: " + AssemblyLocator.DOMAIN_PATH);
         return;
     }
     loader = new ProxyAssLoader();
     loader.LoadFrom(AssemblyLocator.DOMAIN_PATH);
     loader.LoadLayers();
     loader.AttachLayers();
 }
コード例 #3
0
ファイル: EntryHotSwap.cs プロジェクト: Cooble/NiceDay
        public override void OnUpdate()
        {
            divideCall(() => {
                if (AssemblyLocator.CheckForModification())
                {
                    Log.ND_INFO("Found newer dll - > copying");
                    UnloadDomain();
                    AssemblyLocator.CopyAssembly();
                    LoadDomain();
                }
            });
            if (loader != null)
            {
                loader.UpdateLayers();
            }

            if (counterToCheckAssLoad > 0)
            {
                if (--counterToCheckAssLoad == 0 && loader == null)
                {
                    Log.ND_WARN("Cannot find Managed.dll");
                }
            }
        }