FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.72k stars 400 forks source link

Submarine hash not updated after editing submarine #6675

Open Tsunder opened 2 years ago

Tsunder commented 2 years ago

Description Updating a submarine and publishing it does not update the sub's hash for the purpose of joining multiplayer.

the client reports that the sub hash matches that of the server, when the sub does not. this results in

image Steps To Reproduce

  1. client 1 start a round on Sub A
  2. client 2 edits and saves Sub A (do NOT restart/reload, go to main menu and join multiplayer)
  3. client 2 connects to client 1, try to spectate.

Version 0.14.9.1..

Additional information Add any other context about the problem here.

NilanthAnimosus commented 1 year ago

Tested against Release/traitor-update commit https://github.com/Regalis11/Barotrauma-development/commit/d52502a4b762805aea2d388b8758840b81dbab1b

Had varied issues looking into this, such as updating the published item getting stuck when the other instance was running from another folder (Possibly due to them sharing the installed workshop folder).

but when I did get it to publish and work correctly (As to meet not restarting the client in the reproduction), joining the first client which was actively playing on an existing dedicated resulted in the following error on load (Which crashed the client):

Barotrauma.dll!Barotrauma.GameSession.StartRound(Barotrauma.LevelData levelData, bool mirrorLevel, Barotrauma.SubmarineInfo startOutpost, Barotrauma.SubmarineInfo endOutpost) Line 415
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameSession.cs(415)
Barotrauma.dll!Barotrauma.GameSession.StartRound(string levelSeed, float? difficulty, Barotrauma.LevelGenerationParams levelGenerationParams) Line 393
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameSession.cs(393)
Barotrauma.dll!Barotrauma.Networking.GameClient.StartGame(Barotrauma.Networking.IReadMessage inc) Line 1421
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs(1421)
Barotrauma.dll!Barotrauma.CoroutineManager.PerformCoroutineStep(Barotrauma.CoroutineHandle handle) Line 213
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaShared\SharedSource\CoroutineManager.cs(213)
Barotrauma.dll!Barotrauma.CoroutineManager.IsDone(Barotrauma.CoroutineHandle handle) Line 223
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaShared\SharedSource\CoroutineManager.cs(223)
Barotrauma.dll!Barotrauma.CoroutineManager.Update(bool paused, float deltaTime) Line 252
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaShared\SharedSource\CoroutineManager.cs(252)
Barotrauma.dll!Barotrauma.GameMain.Update(Microsoft.Xna.Framework.GameTime gameTime) Line 900
    at C:\Github_Sources\Barotrauma\Barotrauma\BarotraumaClient\ClientSource\GameMain.cs(900)

Note, the filepath for this submarineinfo was "Submarines\Downloaded\Typhon2 - itemtest.sub" and not the workshop or local mods path. Not quite sure why, but somehow the submarine element is null XML wise, but the file does exist in the downloaded folder and was 311kb (so not blank and matched the correct size of the localmods/workshop installed)

There is likely to be different results if this however is tested using two different machines.