mIRC Home    About    Download    Register    News    Help

Print Thread
identifying the difference between servers? #155685 08/08/06 03:56 PM
Joined: Aug 2006
Posts: 26
D
Dromedary Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2006
Posts: 26
i know that server names can be read by $server, but is there a more "specific" way to tell them apart? i'm trying to code local channel support, and i am having a bit of trouble with this. it's not that i can't tell the different servers apart using $server, but i just am afraid that server names will change and there may be a situation where multiple servers are named the same thing.

i thought of using $serverip, but that often doesn't work without error (many times it returns 255.255.255.255 for me for some reason, not always or anything though)... and everyone knows server ip's change.

does a solution exist, or should i just keep with using $server?

Re: identifying the difference between servers? #155686 08/08/06 04:01 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I would say stick with $server, but if you want to be safe, you could try a combination of that and $network.


-KingTomato
Re: identifying the difference between servers? #155687 08/08/06 10:49 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If the network is using UnrealIRCd 3.2, then no two servers can have the same name, just like no two people on the network can use the same nick.

I believe this is true for all IRCd's, but don't guarantee it.

Re: identifying the difference between servers? #155688 09/08/06 02:03 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You could get the IP for the server and use that to distinguish them. I don't know if that would be more or less reliable than using $server. The $server name could change, but the server could also move to another IP address.

-genius_at_work