/userip NICK
/userip NICK
hi, it would be useful to have a command /userip NICK which would return the NICK's IP in a raw numeric. Just like the /userhost NICK does. Of course the /userip would only be allowed for opers, and for normal users it could return the cloaed IP, like KAG7724.7242GA.IP
do you think such a module is doable? i know unreal 3.2.1 can show the NICK's IP in a /whois reply, but i need a more faster way to read a Users IP
Like when my bot (it's an oper) joins my irc, then it would retrieve IPs of all clients currently connected to the server, and doing this via the /whois command would be very slow.
please helpppppp...
do you think such a module is doable? i know unreal 3.2.1 can show the NICK's IP in a /whois reply, but i need a more faster way to read a Users IP
Like when my bot (it's an oper) joins my irc, then it would retrieve IPs of all clients currently connected to the server, and doing this via the /whois command would be very slow.
please helpppppp...
Well, I would assume the best way to do this is with a bit of research.
It appears that the User structure does have a field for the IP Address. It is char* ip_str, and the code says it stores the IP in string form (so I'm assuming dotted-quad for IPv4 and colon-hex (or whatever it's called ;p) for IPv6). After this you could simply do an IsOper(sptr) if you want to show it for all opers or IsEyes(sptr) if you want +s +e required. Failing the check, you can probably look to see how Unreal passes an IP address to the cloak module, and use this to cloak the IP using the appropriate routine .
How you obtain a pointer to the User structure from the nick list (if you want /userhost-like support ) is another matter. I suppose you could see how /userhost does it (read through m_userhost.c).
It appears that the User structure does have a field for the IP Address. It is char* ip_str, and the code says it stores the IP in string form (so I'm assuming dotted-quad for IPv4 and colon-hex (or whatever it's called ;p) for IPv6). After this you could simply do an IsOper(sptr) if you want to show it for all opers or IsEyes(sptr) if you want +s +e required. Failing the check, you can probably look to see how Unreal passes an IP address to the cloak module, and use this to cloak the IP using the appropriate routine .
How you obtain a pointer to the User structure from the nick list (if you want /userhost-like support ) is another matter. I suppose you could see how /userhost does it (read through m_userhost.c).
To kenshinxl & aquanight: for example like this? (By the way, no documentation yet, and the module requires Unreal3.2.1.) Yes, the easiest and most recommended way of coding a /userip that works like /userhost is to take the code of /userhost do modifications in it like I did, because then /userip will be also suitable for scripts). What I don't agree with is showing the IP only to eyes (+e) users. That snomask has an other meaning, I think.
-
- Former UnrealIRCd head coder
- Posts: 811
- Joined: Sat Mar 06, 2004 8:47 pm
- Location: United States
- Contact:
For the next version, I intend to include a /userip command (that will probably be almost exactly like the one AngryWolf made).
AngryWolf, you have one major bad thing in your module. Don't create numeric conflicts! A numeric for /userip already exists courtesy of ircu. RPL_USERIP is 340, not 710. I'd strongly suggest you use 340 instead.
I don't know if you are aware, but http://www.alien.net.au/irc/irc2numerics.html lists the numerics in use by several IRCds. It's a good place to look when adding a feature that is supported by other IRCds or when trying to avoid conflicts.
AngryWolf, you have one major bad thing in your module. Don't create numeric conflicts! A numeric for /userip already exists courtesy of ircu. RPL_USERIP is 340, not 710. I'd strongly suggest you use 340 instead.
I don't know if you are aware, but http://www.alien.net.au/irc/irc2numerics.html lists the numerics in use by several IRCds. It's a good place to look when adding a feature that is supported by other IRCds or when trying to avoid conflicts.
-- codemastr
Thanks for your help, codemastr. Unfortunately I didn't know that website, but it's extremely useful. I wonder why I haven't seen it yet.
Until the next version gets released, I will make this module available for people who don't want to wait. So the module with the numeric correction and the documentation is available from my modules page (or from this link).
Until the next version gets released, I will make this module available for people who don't want to wait. So the module with the numeric correction and the documentation is available from my modules page (or from this link).
You probably downloaded the win32 binary, rather than the source.
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]