I've written a C# console app to test this problem.
Here's the part that works:
On an ElectroServer instance, I add callbacks for Engine.ConnectionResponse and Engine. LoginResponse.
On the instance, I call Engine.AddServer, then Engine.Connect.
My ConnectionResponse callback gets called, and I create a LoginRequest with a valid UserName and call Engine.Send
If the UserName is unique, I get a LoginResponse callback, with the Successful flag set to true. Hooray!
Here's the part that doesn't work:
If the UserName is already in use, I do not get a call to my LoginResponse callback at all!
I would expect to get a LoginResponse callback with Successful set to false, and the Error set to UserNameExists
Some additional information:
I don't know if this helps, but if I then leave Electroserver running, and connect successfully, in the Connection response, the response object has Successful set to true, but the Error set to UserNameExists... I'm guessing ElectroServer doesn't clear out the last Error code when sending a success message. If this is true, it means ElectroServer has internally set a UserNameExists error -- it just never got down to my client.
Other things I've tried:
I've also tried registering a callback for GenericError, in case that's where the error ought to be handled. No dice.
I haven't tried this in other languages, only C#