display country of user in search listings

Archived discussion about features (predating the use of Bugzilla as a bug and feature tracker)

Moderator: Moderators

Locked
Hotblack
Posts: 1
Joined: 2004-04-05 10:41
Location: Sweden

display country of user in search listings

Post by Hotblack » 2004-04-05 10:48

As you might know, a company called Maxmind have published their country database for free. This makes it possible to map an IP to the country of the ISP. This is something that would be a good enhancement of DC++, i.e. to be able to see the location of the user when searching for files. This would make it much easier to find users with potentially good transfer rates...

No DNS resolving is necessary, just a quick lookup in the CSV file that's downloadable from http://www.maxmind.com/app/geoip_country

This could be made an option, if Arne doesn't want to add the CSV file to the archive (it's about 900 kb compressed) or if the features increases memory usage alot (I assume the list would have to be loaded into memory for quick searching), but I figure it's a feature most people would like to enable.

Unfortunately I don't know C++, so I can't code this feature myself...

What do you people think about this?

(My apologies _if_ this has been discussed before, but I couldn't find any mention of it in the forum or feature tracker.)[/b]

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 18:47
Location: USA
Contact:

Post by BSOD2600 » 2004-04-05 12:10

Hmm, while it might come in handy for finding a faster download...I usually pay attention only to their used/open slots which often results is pretty decent speeds. That being said, I don't think its a must have feature... but would be nice ;)

*neutral*

IntraDream
Posts: 32
Joined: 2003-12-12 14:28
Location: FL,USA
Contact:

Post by IntraDream » 2004-04-05 16:50

well i think im stealing this idea.

:)

Tim-

Blippo
Posts: 5
Joined: 2003-12-04 05:06
Location: Finland

Post by Blippo » 2004-04-05 17:15

Remember those unfortunate fellows that have to pay more for their international traffic than domestic (I've read about this in some other threads..)
So I guess it would be a real nice feature for some, pretty useless but fun for others.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Re: display country of user in search listings

Post by GargoyleMT » 2004-04-05 20:22

Hotblack wrote:What do you people think about this?

It's pretty similar to this existing thread:
http://dcplusplus.sourceforge.net/forum ... php?t=8251 (for country code in the hublist)

I'm sure that certain segments of the DC population would love this feature, I don't think it belongs in DC++ itself - 900kb compressed is bigger than the existing executable. And some people take issue with DC++'s existing memory footprint.

Pofis
Posts: 14
Joined: 2003-11-25 14:06
Location: Portugal
Contact:

Post by Pofis » 2004-04-07 03:31

Hi :)
I'm trying to do this but i have a little problem:
i did the code to split the IP(string) of the users in 4 parts w,x,y,z(strings)
eg:

Code: Select all

IP = 23.24.25.26
w = 23, x = 24, w = 25, z = 26


but now i need to do this operations:

Code: Select all

ipnum = 16777216*w + 65536*x + 256*y + z


but it can only be done with integers. how do i convert the "string" to an "int" :?: thanks

---- // ----

ok, problem resolved. tks to Sphinx :D

Pofis

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2004-04-07 06:57

Code: Select all

#include <string>
#include <iostream>
#include <sstream>
using namespace std;


int main()
{
  int i;
  char c;
  istringstream ips1("127.0.0.1");
  istringstream ips2("196.168.42.42");
  unsigned long ip1 = 0;
  unsigned long ip2 = 0;

  ips1 >> i >> c; ip1 += i & 0xFF; ip1 <<= 8;
  ips1 >> i >> c; ip1 += i & 0xFF; ip1 <<= 8;
  ips1 >> i >> c; ip1 += i & 0xFF; ip1 <<= 8;
  ips1 >> i; ip1 += i & 0xFF;

  cout << ip1 << " " << (16777216*(unsigned long)127 + 65536 * 0 + 256 * 0 + 1) << endl;

  ips2 >> i >> c; ip2 += i & 0xFF; ip2 <<= 8;
  ips2 >> i >> c; ip2 += i & 0xFF; ip2 <<= 8;
  ips2 >> i >> c; ip2 += i & 0xFF; ip2 <<= 8;
  ips2 >> i; ip2 += i & 0xFF;

  cout << ip2 << " " << (16777216*(unsigned long)196 + 65536*168 + 256*42 + 42) << endl;

}


2130706433 2130706433
3299355178 3299355178




(More or less the way verlihub uses it in its ban-ranges)
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

Pofis
Posts: 14
Joined: 2003-11-25 14:06
Location: Portugal
Contact:

Post by Pofis » 2004-04-10 13:48

Ok code is done and emailed to arne ;)
I hope it gets implemented in the next release :)

Pofis

xhost+
Posts: 19
Joined: 2004-01-22 18:01
Location: in.the.middle.of.nowhere

Post by xhost+ » 2004-04-13 17:18

Definitely no. Who cares where I'm from? Dowload speed is not really related to source distance anymore. I download faster from far-Sweden than I do from my German "neighbours".

xhost+

Pofis
Posts: 14
Joined: 2003-11-25 14:06
Location: Portugal
Contact:

Post by Pofis » 2004-04-14 05:40

Well some people might like this feature others not, so it should be an option that user can choose either to use or not.

Anyway, in my country like 50% of the ISP make a diference between international and national, for example: you have 1GB of download per month for international traffic and 20GB of download per month for national traffic. So at least here in Portugal many people would like this feature. Dunno about other countrys.

Pofis

Pofis
Posts: 14
Joined: 2003-11-25 14:06
Location: Portugal
Contact:

Post by Pofis » 2004-04-17 12:59

If anyone wants the patch, here it is :D

[edited] this patch only shows the country of the user in transfer view, not in search list

Pofis

Locked