433 : Nickname is already in use.

Asked by ile

HI, and thanks for the Irc.net library.

Is there a way to handle this error in the login phase: "433 Nickname is already in use."?

Question information

Language:
English Edit question
Status:
Solved
For:
IRC.NET Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Regueiro
Solved:
Last query:
Last reply:

This question was reopened

  • by ile
Revision history for this message
ile (ilkkah) said :
#1

ProtocolError event seemed to help here.

Revision history for this message
ile (ilkkah) said :
#2

Can't find a way to react to that (ProtocolError Code 433) though - how change the nickname to something else and try again.

Revision history for this message
ile (ilkkah) said :
#3

OK, please ignore the previous comment. Client.LocalUser.SetNickName() seemed to do the job.

Revision history for this message
ile (ilkkah) said :
#4

One more question:

Would it be better to send the Connected event after it's clear that nickname has been set successfully?

Currently the Connected event is sent before the nickname is set. It may confuse the client, and actually there has to be a workaround through that in the client.

Revision history for this message
ile (ilkkah) said :
#5

I am using MotdReceived as the Connected event for now.

Wonder if this spells trouble in the future.

(Sorry for sending so many messages here.)

Revision history for this message
Best Alexander Regueiro (alexreg) said :
#6

No worries. You have indeed figured it out for yourself -- ProtocolError is the event you want. I don't raise any specific events because it doesn't really add functionality to the library, plus the events and their codes vary somewhat by server.

I think what you want for your 'Connected' event is actually the IrcClient.Registered event. The Connected event simply occurs when a socket (TCP) connection is established with the server.

Hope that helps.

Revision history for this message
ile (ilkkah) said :
#7

Yes, of course, Registered event will work much better. Thank you.

The library is great, btw.

Revision history for this message
ile (ilkkah) said :
#8

Thanks Alex Regueiro, that solved my question.