display country of user in search listings
Moderator: Moderators
display country of user in search listings
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]
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]
-
- Posts: 32
- Joined: 2003-12-12 14:28
- Location: FL,USA
- Contact:
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Re: display country of user in search listings
It's pretty similar to this existing thread:Hotblack wrote:What do you people think about this?
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.
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:
but now i need to do this operations:
but it can only be done with integers. how do i convert the "string" to an "int" thanks
---- // ----
ok, problem resolved. tks to Sphinx
Pofis
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
Code: Select all
ipnum = 16777216*w + 65536*x + 256*y + z
---- // ----
ok, problem resolved. tks to Sphinx
Pofis
-
- Posts: 506
- Joined: 2003-01-03 07:33
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
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.
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
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
If anyone wants the patch, here it is
[edited] this patch only shows the country of the user in transfer view, not in search list
Pofis
[edited] this patch only shows the country of the user in transfer view, not in search list
Pofis