433 : Nickname is already in use.

Asked by ile on 2012-03-02

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:
2012-03-03
Last query:
2012-03-03
Last reply:
2012-03-03

This question was reopened

  • 2012-03-02 by ile
ile (ilkkah) said : #1

ProtocolError event seemed to help here.

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.

ile (ilkkah) said : #3

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

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.

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

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.

ile (ilkkah) said : #7

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

The library is great, btw.

ile (ilkkah) said : #8

Thanks Alex Regueiro, that solved my question.