$UserIP
Moderator: Moderators
$UserIP
How about an extension to find out your external ip and set it automatically?
Client: $UserIP <nickname>
Server: $UserIP <nickname> <ip address>
When the client gets a userip matching its own nickname it would automatically set it in the settings so that you don't need to find it out yourself everytime DSL users connect to the net!!
NMDC hub can have a simple script to reply to this, and newer hub software can have it implemented..
Obviously this could be used for ops that want to find out a users IP too.. what do you think
Client: $UserIP <nickname>
Server: $UserIP <nickname> <ip address>
When the client gets a userip matching its own nickname it would automatically set it in the settings so that you don't need to find it out yourself everytime DSL users connect to the net!!
NMDC hub can have a simple script to reply to this, and newer hub software can have it implemented..
Obviously this could be used for ops that want to find out a users IP too.. what do you think
Hmm.. Good feature, but I think the ender-way is the way to do this...
The protocol should not allow for monitoring other users IP. If one would want that; implement it explicitly in the hubsoft or script!
I have found that sending $jibberish <unknownparam1> ... <unknownparamN>| does not confuse either nmdchub, nmdc or dc++...
Therefore I think all hubs and all clients MUST ignore unspecified and unhandled messages.....
This is important, as with the current rate of new ideas we had lately, we wouldn't want the $Supports to be a mile long. I think only stuff that implies a different behavour from the original protocol should be added to supports. Messages that are ignored by hubs can safely be added to our new venture without bothering with supports....
.. so we could add this easily...
Now we (perhaps) got $Kick and $MyIP and $YourIP.... none taken for granted... Who manages this stuff? Who keeps track of them, and where?
Iceman? Spykie?
The protocol should not allow for monitoring other users IP. If one would want that; implement it explicitly in the hubsoft or script!
I have found that sending $jibberish <unknownparam1> ... <unknownparamN>| does not confuse either nmdchub, nmdc or dc++...
Therefore I think all hubs and all clients MUST ignore unspecified and unhandled messages.....
This is important, as with the current rate of new ideas we had lately, we wouldn't want the $Supports to be a mile long. I think only stuff that implies a different behavour from the original protocol should be added to supports. Messages that are ignored by hubs can safely be added to our new venture without bothering with supports....
.. so we could add this easily...
Now we (perhaps) got $Kick and $MyIP and $YourIP.... none taken for granted... Who manages this stuff? Who keeps track of them, and where?
Iceman? Spykie?
[url=dchub://ancient.myftp.org]ancient.myftp.org - [BBB][Sunet][Tele2] ONLY! @ 20GB (ISP/IP/Share Scripted)[/url]
Re: $UserIP
If originally thought like ender here, with only myip and response.aDe wrote:Obviously this could be used for ops that want to find out a users IP too
But then, i thought- why not let a little room for future development in - and as long as its only for ops, whats the harm.. the individual hub could decide whether to reply to ops requests or not.. and besides.. how hard is it to get a dc users ip if you are already at protocol level.. not very hard..
let's (1) limit the amount of new commands, and (2) allow the hub(owner) to decide who get's which info -> just use $UserIP
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
Ptaczek has agreed to add this command to PtocaX... please read the DCExt post i just made..
http://dcplusplus.sourceforge.net/forum ... .php?t=256
http://dcplusplus.sourceforge.net/forum ... .php?t=256
I see no mention of this; maybe it's automatically implied, but I'd be happier for the clarification.
What about the $Supports command? I know Nev has said that he's tested firing off unknown commands at both DC++ and NMDC and both were fine with it, but would it not be a better idea to stick to the idea that Arne pioneered and only use commands when they're supported by both parties?
Neimad
What about the $Supports command? I know Nev has said that he's tested firing off unknown commands at both DC++ and NMDC and both were fine with it, but would it not be a better idea to stick to the idea that Arne pioneered and only use commands when they're supported by both parties?
Neimad
Added support for $MyIP command to GeneralBot because it was easy enough to add. There are other ways for operators to find out specific users ip, at least i dont want them to be able to collect everyone's IP with a simple mouse click or so.
GeneralBot also supports $BotINFO command for hublist bots (at least one of my own), the format is like:
Client->Hub:
$BotINFO <bot description>
GeneralBot->Client:
$HubINFO <hub name>$<hub address>$<hub description>$<max users>$<min share>$<min slots>$<max hubs>$NMDCHub GeneralBot 0.24$
Where
<bot description> = any string, describes the bot, script will save it just for informational purposes, i.e. "$BotINFO FinHubList 105 hubs, 72 online, 7701 users. http://finhublist.no-ip.org/PublicHubList.config"
<hub name> = frmHub.txtName
<hub address> = frmHub.txtIP (for reducing multiple aliases of one hub)
<hub description> = frmHub.txtDescription (usually out of date on other hublists)
<max users> = frmHub.sldrMaxUsers value (to calculate how full the hub is, current user count can be calculated from $NickList)
<min share> = script's minimum share limit in bytes
<min slots> = script's minimum slot limit
<max hubs> = script's maximum hub limit
And then there is hub type+script name which offered the info, and one additional field after that last $ just for reserve...
There are at this moment also support for following operator commands:
$Ban <username> <reason>
Bans the users name but does not kick the user or send him any data.
$BanIP <username> <reason>
Bans the IP of <username>, does not kick the user or send him any data.
$Kill <username> <reason>
Bans the users name, sends him a reason in PM and kicks him.
$UserInfo <username>
Displays info of the user.
But i think there are too much additions to the protocol, better method could be something like:
$OpCommand <command> <username> <moreinfo>
i.e. "$OpCommand Ban Gadget Talking too much". This method could work just like the command was written to main chat, but it just wont be visible for other users.
I probably add this feature in later versions, any suggestions?
Code: Select all
Sub DataArival (curUser, sCurData)
If sCurData="$MyIP" Then CurUser.SendData CStr("$YourIP "+curUser.IP+"|")
End Sub
Client->Hub:
$BotINFO <bot description>
GeneralBot->Client:
$HubINFO <hub name>$<hub address>$<hub description>$<max users>$<min share>$<min slots>$<max hubs>$NMDCHub GeneralBot 0.24$
Where
<bot description> = any string, describes the bot, script will save it just for informational purposes, i.e. "$BotINFO FinHubList 105 hubs, 72 online, 7701 users. http://finhublist.no-ip.org/PublicHubList.config"
<hub name> = frmHub.txtName
<hub address> = frmHub.txtIP (for reducing multiple aliases of one hub)
<hub description> = frmHub.txtDescription (usually out of date on other hublists)
<max users> = frmHub.sldrMaxUsers value (to calculate how full the hub is, current user count can be calculated from $NickList)
<min share> = script's minimum share limit in bytes
<min slots> = script's minimum slot limit
<max hubs> = script's maximum hub limit
And then there is hub type+script name which offered the info, and one additional field after that last $ just for reserve...
There are at this moment also support for following operator commands:
$Ban <username> <reason>
Bans the users name but does not kick the user or send him any data.
$BanIP <username> <reason>
Bans the IP of <username>, does not kick the user or send him any data.
$Kill <username> <reason>
Bans the users name, sends him a reason in PM and kicks him.
$UserInfo <username>
Displays info of the user.
But i think there are too much additions to the protocol, better method could be something like:
$OpCommand <command> <username> <moreinfo>
i.e. "$OpCommand Ban Gadget Talking too much". This method could work just like the command was written to main chat, but it just wont be visible for other users.
I probably add this feature in later versions, any suggestions?
Why not?Gadget wrote:There are other ways for operators to find out specific users ip, at least i dont want them to be able to collect everyone's IP with a simple mouse click or so.
Also, why add MyIP when UserIP is the agreed standard.. and, if you don't want to answer the requests for other users ips, then fine.. dont..
Copy the dcext script if you like... from the above link.. "easy enough"
Ok, changed that command, so it's now the same =)
Code: Select all
Sub DataArival (curUser, sCurData)
If sCurData="$UserIP "+curUser.sName Then CurUser.SendData CStr("$UserIP "+curUser.sName+" "+curUser.IP+"|")
End Sub
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Well, the first step is...
Well, the first step is to give him a patch. And I just mailed one off. Someone who has their IP unset and is behind a firewall is likely not to have a fixed port mapped through, but I suppose in that case making their active mode IP correct doesn't worsen the situation at all. And for those on dynamic IPs who are clueful about port mapping, this could really help, provided hubs support it.aDe wrote:arnetheduck is not convinced this is a 'entirely necessary' function though.. so I don't know if/when we will see this in the official release of DC++...
I like this idea. $userip will help soo many people get into active mode. The only prob is with bcdc 0.232, if you connect to a hub running on your connection with localhost, it will set your ip to 127.0.0.1 . This is fine, but when you try connecting to it at your ip, it will no longer change the ip in the settings. Anyone know why? I've got the $userip script running on my hub, but anyone that connects to it with bcdc 0.232 has the same problem of the hub not setting the ip. It will however tell you *** User .Phantom has IP: 2xx.xxx.xxx.xxx
suppose I should have looked at the code b4 I posted. I wonder how much testing went into this piece of code:
if (SETTING(HUB_IP_SET) && getNick() == userNick &&
userIP.find("127.0.0.1") != string::npos &&
userIP.find("192.168.") != 0)
{
//set own active mode IP
SettingsManager::getInstance()->set(SettingsManager::SERVER, userIP);
}
Looks like a case of the code working in reverse. It will only set your ip if it is local, not the other way around.
if (SETTING(HUB_IP_SET) && getNick() == userNick &&
userIP.find("127.0.0.1") != string::npos &&
userIP.find("192.168.") != 0)
{
//set own active mode IP
SettingsManager::getInstance()->set(SettingsManager::SERVER, userIP);
}
Looks like a case of the code working in reverse. It will only set your ip if it is local, not the other way around.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Phantom wrote:suppose I should have looked at the code b4 I posted. I wonder how much testing went into this piece of code:
Looks like a case of the code working in reverse. It will only set your ip if it is local, not the other way around.
Code: Select all
if (SETTING(HUB_IP_SET) && getNick() == userNick &&
Util::strnicmp(userIP.c_str(), "127.0.0.1", 9) == 0 && // localhost
Util::strnicmp(userIP.c_str(), "192.168.", 8) == 0 && // rfc 1918
Util::strnicmp(userIP.c_str(), "10.", 3) == 0 && // ditto - 172.16/12 also there, but not simple to test for
Util::strnicmp(userIP.c_str(), "169.254.", 8) == 0) // from ietf zeroconf draft
Well, the user IP showing code in BCDC is separate, anyhow.
172.16.0.0/12
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
I've already made one extra post; another can't hurt.
Anyway, the STL way is to use string.find(), as documented in http://www.sgi.com/tech/stl/basic_string.html. if (userIP.find("blah") != string::npos) do_something();
Anyway, the STL way is to use string.find(), as documented in http://www.sgi.com/tech/stl/basic_string.html. if (userIP.find("blah") != string::npos) do_something();
strnicmp, insensitive? that's not necessary.GargoyleMT wrote:Code: Select all
Util::strnicmp(userIP.c_str(), "127.0.0.1", 9) == 0 && // localhost
That's in the same style that's used with the url code in HubFrame.cpp. What's the proper way to test for whether an STL string begins with another string? (:oops: my schooling was short on useful items, like stl).
stl on strings: http://wza.digitalbrains.com/users/walt ... tring.html
hmm.. cologic, I'd go with compare...
Code: Select all
int compare(size_type pos, size_type n, const charT* s, size_type len = npos) const
I can very much recommend the c++ annotations by Frank Brokken, at:
http://www.icce.rug.nl/documents/cpp.shtml
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
-
- The Creator Himself
- Posts: 296
- Joined: 2003-01-02 17:15
actually, I rethought it,
and figured there is no need for the first command, if the server sends a list by itself.
I got it implemented on my own dch++ hub with a plugin,
it works, so now I got my "Copy IP to clipboard" =)
at login the hub checks my userlevel, and if it's high enough, it will send a:
$UserIP user1 ip1$user2 ip2$user3 ip3|
and to all users with high enough userlevel
$UserIP Sedulus myip|
and figured there is no need for the first command, if the server sends a list by itself.
I got it implemented on my own dch++ hub with a plugin,
it works, so now I got my "Copy IP to clipboard" =)
at login the hub checks my userlevel, and if it's high enough, it will send a:
$UserIP user1 ip1$user2 ip2$user3 ip3|
and to all users with high enough userlevel
$UserIP Sedulus myip|
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
Finally UserIP made it into official DC++, for more info see
http://dc.ade.se/userip
http://dc.ade.se/userip
-
- Posts: 147
- Joined: 2003-01-04 02:20
- Location: Canada http://hub-link.sf.net
- Contact:
aDe,
SDCH has supported $UserIP since the beginning. Not sure if it supports $UserIP2 though...
[EDIT: Fixed the link. TheParanoidOne]
SDCH has supported $UserIP since the beginning. Not sure if it supports $UserIP2 though...
[EDIT: Fixed the link. TheParanoidOne]
Version 0.03 supports UserIP2 as well.
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....
TasMan wrote:Version 0.03 supports UserIP2 as well.
added it to the list, thanksHaArD wrote:aDe,
SDCH has supported $UserIP since the beginning. Not sure if it supports $UserIP2 though...
One question though....considering that the client does not add a "UserIP" menu item or anything, if the client supports UserCommand, should the hub send a UserCommand for UserIP? I would've thought the client would automatically create it but what do I know =p. No problem for me either way of course.
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....
Errr in the case above the client is obviously DC++ 0.305 =). Just need to know if the flaw is in the client or hub implementation.
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
I haven't sniffed the connection, but I don't think DC++ will use the UserIP reported from the server as your external IP. (Which is something that BCDC's code did.)TasMan wrote:Errr in the case above the client is obviously DC++ 0.305 =). Just need to know if the flaw is in the client or hub implementation.