Ejemplo n.º 1
0
        private static void RegisterServerRpc(ILProcessor worker, ServerRpcMethod rpc)
        {
            var skeleton         = rpc.skeleton;
            var requireAuthority = rpc.requireAuthority;

            var registerMethod = GetRegisterMethod(skeleton);
            var invokeType     = GetServerInvokeType(rpc);

            CallRegister(worker, rpc, invokeType, registerMethod, requireAuthority);
        }
Ejemplo n.º 2
0
        private static RpcInvokeType?GetServerInvokeType(ServerRpcMethod rpcMethod)
        {
            var func = rpcMethod.skeleton;

            if (func.ReturnType.Is(typeof(void)))
            {
                return(RpcInvokeType.ServerRpc);
            }
            else
            {
                // Request RPC dont need type, so pass nullable so opcode is exlcuded from register
                return(default(RpcInvokeType?));
            }
        }