Example #1
0
        public void Bind <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(string name, RPCMethod <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> rpc)
        {
            RPCMethodHelper <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> helper = new RPCMethodHelper <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>();

            m_MapRPCBind[name] = helper;
            helper.method      = rpc;
        }
Example #2
0
        public void Bind <T0, T1, T2, T3>(string name, RPCMethod <T0, T1, T2, T3> rpc)
        {
            RPCMethodHelper <T0, T1, T2, T3> helper = new RPCMethodHelper <T0, T1, T2, T3>();

            m_MapRPCBind[name] = helper;
            helper.method      = rpc;
        }
Example #3
0
        //==========================================================================

        public void Bind(string name, RPCMethod rpc)
        {
            RPCMethodHelper helper = new RPCMethodHelper();

            m_MapRPCBind[name] = helper;
            helper.method      = rpc;
        }
Example #4
0
        private void OnBindingRPCInvoke(RPCMessage msg, IPEndPoint target)
        {
            if (m_MapRPCBind.ContainsKey(msg.name))
            {
                Debuger.Log(LOG_TAG, "OnBindingRPCInvoke() RPC:{0}, Target:{1}", msg.name, target);

                RPCMethodHelper rpc = m_MapRPCBind[msg.name];


                try
                {
                    rpc.Invoke(msg.args, target);
                }
                catch (Exception e)
                {
                    Debuger.LogError(LOG_TAG, "OnBindingRPCInvoke() RPC<" + msg.name + ">响应出错:" + e.Message + "\n" + e.StackTrace + "\n");
                }
            }
            else
            {
                Debuger.LogError(LOG_TAG, "OnBindingRPCInvoke() 收到未知的RPC:{0}", msg.name);
            }
        }
Example #5
0
        private void OnBindingRPCInvoke(RPCMessage msg, IPEndPoint target)
        {
            if (m_MapRPCBind.ContainsKey(msg.name))
            {
                MyLogger.Log(LOG_TAG, "OnBindingRPCInvoke() RPC:{0}, Target:{1}", msg.name, target);

                RPCMethodHelper rpc = m_MapRPCBind[msg.name];


                try
                {
                    rpc.Invoke(msg.args, target);
                }
                catch (Exception e)
                {
                    MyLogger.LogError(LOG_TAG, "OnBindingRPCInvoke()", " RPC<" + msg.name + ">response error:" + e.Message + "\n" + e.StackTrace + "\n");
                }
            }
            else
            {
                MyLogger.LogError(LOG_TAG, "OnBindingRPCInvoke() Unkown RPC request:{0}", msg.name);
            }
        }