Esempio n. 1
0
        public static IEnumerable <CodeInstruction> Transpiler(
            IEnumerable <CodeInstruction> instructions, MethodBase original)
        {
            try {
                var codes = TranspilerUtils.ToCodeList(instructions);
                // (node.m_connectGroup == NetInfo.ConnectGroup.None || (node.m_connectGroup & info2.m_connectGroup & NetInfo.ConnectGroup.AllGroups) != NetInfo.ConnectGroup.None)
                // (node4.m_connectGroup == NetInfo.ConnectGroup.None || (node4.m_connectGroup & info.m_connectGroup & NetInfo.ConnectGroup.AllGroups) != NetInfo.ConnectGroup.None)
                CheckNodeConnectGroupNone.Patch(codes, original); // 2
                CheckNodeConnectGroup.Patch(codes, original);     // 2

                Log.Info($"{ReflectionHelpers.ThisMethod} patched {original} successfully!");
                return(codes);
            } catch (Exception e) {
                Log.Error(e.ToString());
                throw e;
            }
        }
        public static IEnumerable<CodeInstruction> Transpiler(
            IEnumerable<CodeInstruction> instructions, MethodBase original) {
            try {
                var codes = TranspilerUtils.ToCodeList(instructions);

                CheckNodeConnectGroupNone.Patch(codes, original);
                CheckNodeConnectGroup.Patch(codes, original);
                CheckNetConnectGroupNone.Patch(codes, original);
                CheckNetConnectGroup.Patch(codes, original);

                Log.Info($"{ReflectionHelpers.ThisMethod} patched {original} successfully!");
                return codes;
            } catch (Exception e) {
                Log.Error(e.ToString());
                throw e;
            }
        }