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); }
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)); }
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)); }
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(); } } } }
public UInt32 GetMethodHash() { var code = RPCParameter.GetRPCCode(Method); return((UInt32)UniHash.APHash(code)); }