public virtual bool AllowNearProtocol(ulong type) { var attr = GetType().GetCustomAttribute<AllowNearTypesAttribute>(); return attr!=null && (attr.Types.Length == 0 || attr.Types.Contains(type)); }