public NetworkBehaviourProcessor(TypeDefinition td, Readers readers, Writers writers, PropertySiteProcessor propertySiteProcessor, IWeaverLogger logger)
 {
     Weaver.DLog(td, "NetworkBehaviourProcessor");
     netBehaviourSubclass = td;
     this.logger          = logger;
     serverRpcProcessor   = new ServerRpcProcessor(netBehaviourSubclass.Module, readers, writers, logger);
     clientRpcProcessor   = new ClientRpcProcessor(netBehaviourSubclass.Module, readers, writers, logger);
     syncVarProcessor     = new SyncVarProcessor(netBehaviourSubclass.Module, readers, writers, propertySiteProcessor, logger);
     syncObjectProcessor  = new SyncObjectProcessor(readers, writers, logger);
 }
        void ProcessServerRpc(HashSet <string> names, MethodDefinition md, CustomAttribute serverRpcAttr)
        {
            if (md.IsAbstract)
            {
                Weaver.Error("Abstract ServerRpcs are currently not supported, use virtual method instead", md);
                return;
            }

            if (!ValidateRemoteCallAndParameters(md, RemoteCallType.ServerRpc))
            {
                return;
            }

            if (names.Contains(md.Name))
            {
                Weaver.Error($"Duplicate ServerRpc name {md.Name}", md);
                return;
            }

            bool requireAuthority = serverRpcAttr.GetField("requireAuthority", false);

            names.Add(md.Name);
            serverRpcs.Add(new CmdResult
            {
                method           = md,
                requireAuthority = requireAuthority
            });

            MethodDefinition userCodeFunc = ServerRpcProcessor.GenerateStub(md, serverRpcAttr);

            MethodDefinition skeletonFunc = ServerRpcProcessor.GenerateSkeleton(md, userCodeFunc);

            if (skeletonFunc != null)
            {
                serverRpcSkeletonFuncs.Add(skeletonFunc);
            }
        }