Commander_Wars icon indicating copy to clipboard operation
Commander_Wars copied to clipboard

Server replacing the user when creating a match v38_4

Open lonewolf19991 opened this issue 6 months ago • 7 comments

Describe the bug When a match is hosted, through the Server in v38_4, the user 'Server' replaces the user that created the match.

This only occurs when a match is hosted directly through the server, and no issues occur when the game is connected through a direct IP address, from player to player.

To Reproduce Steps to reproduce the behavior:

  1. Connect to the server
  2. Host a match
  3. Go to the CO Selection screen
  4. See error

Expected behavior The User should be the creator of the match, and not be replaced by the server

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows/Linux
  • Version Windows 10/Arch Linux
  • Active Mods (Note: none vanilla mod problems want be investigated)
  • Game Version: 38_4

Additional context Add any other context about the problem here.

lonewolf19991 avatar May 29 '25 00:05 lonewolf19991

I have been performing tests, and the issue seems to affect Linux exclusively. The problem does not occur on V37_2, so my suspicion is that the refactoring done to create the AppImage might have had an impact on this, since the code was primarily focused on Linux. @Robosturm Could you please check what impact the code from this pull request onward, could have on the way the server slaves are spawned? https://github.com/Robosturm/Commander_Wars/pull/1848

I believe that this might be the root of the issue, unfortunately I am not well versed on CMake, to pinpoint the exact lines of why this happens.

lonewolf19991 avatar May 30 '25 06:05 lonewolf19991

These three commits are the only ones I can think of for the rest any commit made by RimiKanokawa might be an issue as well, but I don't really know what he did with building/deplyoing CoW for Linux so I can't help you. 42d10fbb79649dac12bd55ef3abb141054ea6ee9 9104e632f3edff02bf56b004398e33cd0503bc2e 6571a9d7184d4fb1a8d38624089b5249399efc0a

Robosturm avatar May 30 '25 11:05 Robosturm

I have been testing further with @Lymia From her conjecture, it is unrelated to the refactoring of the code, to add an AppImage. However it's from that build onwards that I have noticed the issue, she's been working on a fix. We have concluded that both versions the one with the defined path in the ini, and the pathless one (windows style dumping of the folders and files), have the same problem. I will dig through the code to see if there's anything I can find as suspicious.

lonewolf19991 avatar May 30 '25 22:05 lonewolf19991

One of these two commits is involved, but not the root cause of this bug: https://github.com/Robosturm/Commander_Wars/commit/9104e632f3edff02bf56b004398e33cd0503bc2e https://github.com/Robosturm/Commander_Wars/commit/42d10fbb79649dac12bd55ef3abb141054ea6ee9 Reverting them causes the server player slot to show up as "Human" instead of the server's name, meaning one of these code changes is responsible for putting the server player in. Still investigating.

Lymia avatar May 31 '25 18:05 Lymia

I've ruled out https://github.com/Robosturm/Commander_Wars/commit/42d10fbb79649dac12bd55ef3abb141054ea6ee9. I'm investigating https://github.com/Robosturm/Commander_Wars/commit/9104e632f3edff02bf56b004398e33cd0503bc2e now, and looking for root cause.

Lymia avatar Jun 02 '25 04:06 Lymia

@Robosturm Do you know if https://github.com/Robosturm/Commander_Wars/commit/9104e632f3edff02bf56b004398e33cd0503bc2e could be the source of this problem? Lymia's contributions have been ruled out, we tested the binaries after her pull requests.

lonewolf19991 avatar Jun 22 '25 16:06 lonewolf19991

Probably but as mentioned I can't reproduce it . And the sync code during player selection is a complete mess and would need a redesign. Currently I'm not in a mood to work on CoW so the main thing I do is bug fixing aka maintenance

Robosturm avatar Jun 23 '25 07:06 Robosturm