Page 1 of 1

get username in PRECONNECT hook (not nickname)

Posted: Mon Feb 22, 2016 9:50 am
by m3z
Hi All,

I would like to get the username instead of nickname in the _preconnect hook.
Hook callback get a aClient *sptr in parameter.
But sptr->username is set to "". sptr->name is feed but with nickname.
I think, at this moment (preconnect) unrealIrcd have already received from client it, so how can i get it ?

Thanks for your help

Re: get username in PRECONNECT hook (not nickname)

Posted: Mon Feb 22, 2016 1:49 pm
by m3z
One information more : the modules i develop is for unrealdircd 4.0.1

Re: get username in PRECONNECT hook (not nickname)

Posted: Tue Feb 23, 2016 5:46 am
by dboyz
Hi,

I assume the hook you mentioned is HOOKTYPE_PRE_LOCAL_CONNECT.
I looked into the source code and indeed the ircd already has client's username at this point.
However I'm not too sure why sptr->username is set to ""

Re: get username in PRECONNECT hook (not nickname)

Posted: Tue Feb 23, 2016 10:10 am
by m3z
Hi dboyz,

And thanks for your answer.
Yes i confirm, I talk about HOOKTYPE_PRE_LOCAL_CONNECT hook.
Do you know if there somewhere a description of the structure pointed by sptr (other than source)?

Re: get username in PRECONNECT hook (not nickname)

Posted: Tue Feb 23, 2016 4:20 pm
by dboyz
Hello,

Unfortunately no but you can try your luck digging the documentations though.
unrealircd.org/docs

Re: get username in PRECONNECT hook (not nickname)

Posted: Wed Feb 24, 2016 10:49 am
by m3z
Ok I will do it.

Thanks