mage icon indicating copy to clipboard operation
mage copied to clipboard

Disconnect from server then unable to join "Username already in use (or you IP address changed)"

Open Alex-Vasile opened this issue 3 years ago • 3 comments

From reddit: https://www.reddit.com/r/XMage/comments/x2xro7/problem_reconnecting_to_the_beta_client_after/

I have this recurring issue where when i get dc'd from a game im playing as part of a draft tournament, then open a new client and try to reconnect i get this error:

  • I cant reconnect with that name for like a minute or so even if close all running tasks related to xmage
  • I've had this problem with a different username before, its not unique to the one in the picture
  • Its only ever happened on the BETA server
  • It also happens on private servers with very few people online, im pretty sure there is no 2nd user with the same name

Anybody know why this occurs or what to do about this? thank you

Alex-Vasile avatar Sep 01 '22 14:09 Alex-Vasile

I have also had this problem occur when playing with others on a locally hosted server. I will get disconnected from the local server running on my own computer and then be unable to re-join.

Alex-Vasile avatar Sep 01 '22 14:09 Alex-Vasile

Would be helpful to look at the logs when this happens. I'm guessing the server is holding the old connection open and then won't let you reconnect until it times out.

weirddan455 avatar Sep 01 '22 15:09 weirddan455

Would be helpful to look at the logs when this happens. I'm guessing the server is holding the old connection open and then won't let you reconnect until it times out.

I will look through my logs and see if i have anything from the last time it happened (if I remember when). I also don't know the reason why the user gets disconnected in the first place. The two might be related. E.g. in my case it was a local server on the same machine as the client, so it's hard to believe that it would be caused by a poor connection.

Alex-Vasile avatar Sep 01 '22 17:09 Alex-Vasile

Added: that comment outdated

It's related to client side disconnection (app freeze or network fail) on non-registration servers. Server keeps old session for possible network restore from a user. But user can't restore it due session lost.

Manual use case: close connected client by task manager or stop it by IDE without disconnect button click and without windows close. Nothing to do with it. It's by design.

Possible improve: save temp user/session on client side in register and restore it on new client connect with same name.

JayDi85 avatar Sep 30 '23 01:09 JayDi85

After some research. Real reason: in non-registration mode server uses user's name + IP address to authenticate on the server.

If you disconnected and see "user name busy" error then your machine changed IP address. Example: your VPN or proxy re-connected and got another IP. It's important for xmage to use a stable connection without any timeouts.

So save and reconnect with session id can help with it (need some code improvements).

JayDi85 avatar Nov 30 '23 18:11 JayDi85

Fixed in #11527

JayDi85 avatar Dec 07 '23 17:12 JayDi85