Esempio n. 1
0
        public void SetMethod(System.Reflection.MethodInfo mtd, UInt16 index, System.Type argType)
        {
            ArgumentType = argType;
            RPCIndex     = index;
            Method       = mtd;
            var HashString = GetRPCCode(mtd);

            MethodHash = UniHash.APHash(HashString);
        }
Esempio n. 2
0
            public static UInt32 SortAndCalHash_2(Type type, List <FieldDesc> Members)
            {
                Members.Sort((x, y) => x.Name.CompareTo(y.Name));
                string str = Rtti.RttiHelper.GetTypeMetaHashString(type);

                foreach (var i in Members)
                {
                    str += Rtti.RttiHelper.GetTypeMetaHashString(i.PropInfo.MemberType) + i.Name;
                }
                return(UniHash.APHash(str));
            }
Esempio n. 3
0
            public static UInt32 SortAndCalHash_1(Type type, List <FieldDesc> Members)
            {
                string hashStr = Rtti.RttiHelper.GetTypeMetaHashString(type) + "->\n";

                Members.Sort((Rtti.MetaData.FieldDesc a, Rtti.MetaData.FieldDesc b) =>
                {
                    return(a.PropInfo.Name.CompareTo(b.PropInfo.Name));
                });
                foreach (var i in Members)
                {
                    hashStr += Rtti.RttiHelper.GetTypeMetaHashString(i.PropInfo.MemberType) + ":" + i.PropInfo.Name + ";\n";
                }
                return(UniHash.APHash(hashStr));
            }
Esempio n. 4
0
        public void SetMethod(System.Reflection.MethodInfo mtd, UInt16 index, System.Type paramType)
        {
            Index       = index;
            Method      = mtd;
            HashString  = RPCParameter.GetRPCCode(mtd);
            MethordHash = UniHash.APHash(HashString);

            mParamType = paramType;
            if (paramType.BaseType != null && paramType.BaseType.IsGenericType)
            {
                var typeArgs = paramType.BaseType.GenericTypeArguments;
                if (typeArgs.Length > 1)
                {
                    if (typeArgs[0].FullName != paramType.FullName)
                    {
                        System.Diagnostics.Debugger.Break();
                    }
                }
            }
        }
Esempio n. 5
0
        public UInt32 GetMethodHash()
        {
            var code = RPCParameter.GetRPCCode(Method);

            return((UInt32)UniHash.APHash(code));
        }