Esempio n. 1
0
        public RPCMethodInfo GetMethodIndex(UInt32 hash, out bool bAdd)
        {
            RPCMethodInfo index;

            if (mMethods.TryGetValue(hash, out index))
            {
                bAdd = false;
                return(index);
            }

            for (byte i = 0; i < byte.MaxValue; i++)
            {
                if (HasIndex(i))
                {
                    continue;
                }
                else
                {
                    index           = new RPCMethodInfo();
                    index.ClassName = ClassName;
                    index.HashCode  = hash;
                    index.Index     = i;
                    mMethods.Add(hash, index);
                    bAdd = true;
                    return(index);
                }
            }

            var expInfo = string.Format("RPC类:{0}的RPC函数超过255个,请改变写法");

            //System.Windows.Forms.MessageBox.Show(expInfo);
            throw new System.Exception(expInfo);
        }
Esempio n. 2
0
        public void RegMethodIndex(UInt32 hash, byte index, string name)
        {
            RPCMethodInfo oidx;

            if (mMethods.TryGetValue(hash, out oidx))
            {
                System.Diagnostics.Debugger.Break();
            }
            oidx           = new RPCMethodInfo();
            oidx.ClassName = ClassName;
            oidx.HashCode  = hash;
            oidx.Index     = index;
            oidx.FullName  = name;
            mMethods[hash] = oidx;
        }