FreeCol/freecol

Cannot resume multiplayer due to server.userNameNotPresent error

SteeveDroz opened this issue · 8 comments

Version

freecol v0.11.6 on Linux/Fedora 31

Description

NOTE: I'm using FreeCol in French, so the name of the menus can differ slightly as I translate them into English on the fly.

On a hotseat game (2 clients on the same computer, one as the owner of the game), with a previously saved game, Player 1, the owner, opens the saved game and waits for Player 2.

Player 2 clics on "New game" and chooses "Join a multiplayer game" with server 127.0.0.1:3541. He also chooses "Player 2" as his name.

If Player 2 chooses his own previous nation, an error message tells him that the username isn't present in the game.

WARNING: ServerAPI. login error, messageId: server.userNameNotPresent message: Player "Guillaume Ier" is not present in the game.
Known players = ( Player 1 Player 2 Louis XIV Élizabeth Iere )

Desired behavior

Use the name specified in the "Name" field as the username instead of the default name for the nation.

Why am I sure the problem comes from there?

If Player 2 chooses another nation, when prompt, he can take it without a problem.

Workaround

Unzip the saved game, change name="Player 2" to name="Guillaume Ier" and rezip the saved game, but seriously, that's not even an option for lambda users.

I tried to fix the bug, but the codebase is so huge that I lost myself :-(
My starting point is the following:

} else if ((present = getPlayer(serverGame)) == null) {

I hope it can help someone!

Have you tried using a nightly release? This code has changed a fair bit since 0.11.6.

Yep. On freecol-git-20201224 error confirmed

Here is some workaround:
https://github.com/dvr-1com/saveFix

This error seems still present on 20220217.
We ran into a freeze while trying to negotiate peace between two human players (both on Windows 10). The client of the user sending the peace offer froze when the other user accepted the offer without changing.
After killing the frozen client, I cannot rejoin, getting this error. However, it seems I could join as spanish (which is an AI player).

This error seems still present on 20220217. We ran into a freeze while trying to negotiate peace between two human players (both on Windows 10). The client of the user sending the peace offer froze when the other user accepted the offer without changing. After killing the frozen client, I cannot rejoin, getting this error. However, it seems I could join as spanish (which is an AI player).

Sorry this is happening. @mpope042 can take a look at some point, but I can't make any promises.

At least we have the workaround of editing the name within the savegame, or manually entering the default name when starting the game.

Please try the new release 0.12.0 and see if the problem is still there.