mIRC Home    About    Download    Register    News    Help

Print Thread
Is it possible to rename connection id ($cid) #151706 20/06/06 10:25 PM
Joined: Dec 2002
Posts: 60
C
coder Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
possible ? example changing the $cid = 3 to connection3 ..

Re: Is it possible to rename connection id ($cid) #151707 20/06/06 11:15 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
No. The connection ID is set when the connection is made.
I would suggest using $scon rather than $scid as $scon reference the connection in the order it was created (ie: first connection is 1, 2nd is 2, 3rd is 3). Now, while this sounds like it's the same as $scid, $scid uses the $cid information to reference that connection, as $scon references the connection number.

I'm sorry I can't explain it better. I suggest you read the help file under /help $scon & /help $scid (both are actually in the same area) and compare the differences.

Re: Is it possible to rename connection id ($cid) #151708 21/06/06 07:52 AM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
each new connection gets a unique new cid
The first (quakenet)= 1
the 2nd (undernet) = 2
the third (EFnet) = 3

if we close the Undernet connection and open a new one to Rizon, Rizon is 4.
QuakeNet = 1
EFnet = 3
Rizon = 4

As you can see if we'd loop trough $scid it would fail since theres no $scid(2). cid is ALWAYS unique so having named connections defeats its purpose.

scon is a method to reference all the open connections
$scon(0) returns total connections
$scon(1) returns the first connection (even if the $cid > 1)

If you follow the following rules then addressing the wrong/an invalid connection is less likely to happen:

If you want to dynamicly reference all the open servers use SCON.
if you need to store information with a connection id as a reference use SCID.

You can check if a connection is to a certain server with
$scon(N).network
$scon(N).server


$maybe
Re: Is it possible to rename connection id ($cid) #151709 21/06/06 08:21 AM
Joined: Dec 2002
Posts: 60
C
coder Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
oWh thx

is opening socket via /sockopen is considered as $cid too ?
because it's weird for me when echoing $cid and it returns 34