Пример #1
0
        HarmonyInstance(string id)
        {
            if (DEBUG)
            {
                var assembly = typeof(HarmonyInstance).Assembly;
                var version  = assembly.GetName().Version;
                var location = assembly.Location;
                if (location == null || location == "")
                {
                    location = new Uri(assembly.CodeBase).LocalPath;
                }
                FileLog.Log("### Harmony id=" + id + ", version=" + version + ", location=" + location);
                var callingMethod   = GetOutsideCaller();
                var callingAssembly = callingMethod.DeclaringType.Assembly;
                location = callingAssembly.Location;
                if (location == null || location == "")
                {
                    location = new Uri(callingAssembly.CodeBase).LocalPath;
                }
                FileLog.Log("### Started from " + callingMethod.FullDescription() + ", location " + location);
                FileLog.Log("### At " + DateTime.Now.ToString("yyyy-MM-dd hh.mm.ss"));
            }

            this.id = id;

            if (!selfPatchingDone)
            {
                selfPatchingDone = true;
                SelfPatching.PatchOldHarmonyMethods();
            }
        }
Пример #2
0
 HarmonyInstance(string id)
 {
     this.id = id;
     SelfPatching.PatchOldHarmonyMethods();
 }