Exemplo n.º 1
0
        /// <summary>
        /// Registers the RPC delegate.
        /// </summary>
        /// <param name="rpcDel">The RPC delegate.</param>
        /// <param name="methodName">Name of the method.</param>
        protected void RegisterRPCDelegate(RPCDelegate rpcDel, string methodName)
        {
            if (rpcHandlers == null)
            {
                rpcHandlers = new RPCDelegate[TinyNetStateSyncer.GetNumberOfRPCMethods(GetType())];
            }

            int index = TinyNetStateSyncer.GetRPCMethodIndexFromType(GetType(), methodName);

            rpcHandlers[index] = new RPCDelegate(rpcDel);
        }