get username in PRECONNECT hook (not nickname)

These are old archives. They are kept for historic purposes only.

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 »

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 »

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 »

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 »

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 »

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 »

Ok I will do it.

Thanks
Post Reply