Exemple #1
0
        public RPCMethodHelper GetMethodHelper(string name)
        {
            var helper = m_mapMethodHelper[name];

            if (helper == null)
            {
                MethodInfo mi       = null;
                object     listener = null;
                for (int i = 0; i < m_listListener.Count; i++)
                {
                    listener = m_listListener[i];
                    mi       = listener.GetType().GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public);
                    if (mi != null)
                    {
                        break;
                    }
                }

                if (mi != null)
                {
                    helper          = new RPCMethodHelper();
                    helper.listener = listener;
                    helper.method   = mi;
                    m_mapMethodHelper.Add(name, helper);
                }
            }

            return(helper);
        }
Exemple #2
0
        public virtual void Dump()
        {
            StringBuilder sb = new StringBuilder();

            foreach (var pair in m_mapMethodHelper)
            {
                RPCMethodHelper helper = pair.Value;
                sb.AppendFormat("\t<name:{0}, \tmethod:{1}.{2}>\n", pair.Key,
                                helper.method.DeclaringType.Name, helper.method.Name);
            }

            Debuger.LogWarning("\nRPC Cached Methods ({0}):\n{1}", m_mapMethodHelper.Count, sb);
        }