get username in PRECONNECT hook (not nickname)

For the old 4.x series

Moderators: Gottem, Supporters

Post Reply
m3z
Posts: 4
Joined: Mon Feb 22, 2016 9:42 am

get username in PRECONNECT hook (not nickname)

Post by m3z » Mon Feb 22, 2016 9:50 am

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

m3z
Posts: 4
Joined: Mon Feb 22, 2016 9:42 am

Re: get username in PRECONNECT hook (not nickname)

Post by m3z » Mon Feb 22, 2016 1:49 pm

One information more : the modules i develop is for unrealdircd 4.0.1

dboyz
Posts: 68
Joined: Tue Jun 14, 2011 6:36 am

Re: get username in PRECONNECT hook (not nickname)

Post by dboyz » Tue Feb 23, 2016 5:46 am

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 ""

m3z
Posts: 4
Joined: Mon Feb 22, 2016 9:42 am

Re: get username in PRECONNECT hook (not nickname)

Post by m3z » Tue Feb 23, 2016 10:10 am

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)?

dboyz
Posts: 68
Joined: Tue Jun 14, 2011 6:36 am

Re: get username in PRECONNECT hook (not nickname)

Post by dboyz » Tue Feb 23, 2016 4:20 pm

Hello,

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

m3z
Posts: 4
Joined: Mon Feb 22, 2016 9:42 am

Re: get username in PRECONNECT hook (not nickname)

Post by m3z » Wed Feb 24, 2016 10:49 am

Ok I will do it.

Thanks

Post Reply