Closed evilfactory closed 1 year ago
I did some debugging and found out that ServerSettings.HiddenSubs
was different between the server and client, so there's definitely some desync in settings going on.
I have found similar problem, it looks like in my case it is caused by translation. The list of submarines on the dedicated server is ordered as it should be. The connected client has Russian language. Names for vanilla subs are different (taken from Content\Texts\Russian\RussianVanilla.xml) and the list of subs on the client is ordered accordingly. When the client hides any sub, the sub with the same position in the server list is hidden on the server side (it is stored in serversettings.xml). For beginning of the list (Azimuth, Barsuk) both list have the same numbering, but after that wrong subs are hidden. If all connected clients have the same language installed it has no impact - all clients have the same submarine lists. However, if I want to manually enter a hidden sub in the settings file I have to find a corresponding sub in the server list to write a "fake" subname in to the settings file.
I managed to solve the problem just by ordering the sub list on the server side: Barotrauma\BarotraumaServer\ServerSource\Screens\NetLobbyScreen.cs
just after string #130:
subs = SubmarineInfo.SavedSubmarines.Where(s => s.Type == SubmarineType.Player && !s.HasTag(SubmarineTag.HideInMenus)).ToList();
added:
subs = subs.OrderBy(s => s.Name).ToList();
Tested, no issues found. Closing.
Disclaimers
What happened?
For some reason the hidden submarine list will from it looks like desync between the server and client, causing some really weird behavior such as the wrong voted submarines being picked and submarines randomly being put into the hidden submarine list.
These are the two submarines that i used for testing: LocalMods.zip
Reproduction steps
Bug prevalence
Happens regularly
Version
0.19.14.0
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
No response