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.67k stars 395 forks source link

Disconnect when someone else purchases item swap when you're not controlling a character #14110

Closed Regalis11 closed 3 weeks ago

Regalis11 commented 3 weeks ago

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/14109

Originally posted by **Regalis11** June 10, 2024 ### Disclaimers - [X] I have searched the issue tracker to check if the issue has already been reported. - [ ] My issue happened while using mods. ### What happened? You disconnect when someone else purchases item swap (= new turret) when you're not controlling a character. ### Reproduction steps 1. Host a server, start a new campaign as client A 2. Join the server as client B 3. Purchase a new turret or swap an existing one to something else as client A, before client B spawns 4. Client B should disconnect with the error message below ### Bug prevalence Happens every now and then ### Single player or multiplayer? Multiplayer hosted from the in-game menu (= using a listen server) ### - _No response_ ### Version v1.4.6.0 (Blood in the Water Update, hotfix 2) ### - _No response_ ### Which operating system did you encounter this bug on? Windows ### Relevant error messages and crash reports ```shell ThrowError: Error while reading a message from server. Exception thrown while reading segment SyncIds at position 32. Inner exception: Tried to set the balance on an invalid wallet at Barotrauma.InvalidWallet.set_Balance(Int32 value) in \Barotrauma\BarotraumaShared\SharedSource\GameSession\Data\Wallet.cs:line 120 at Barotrauma.Wallet.Deduct(Int32 price) in \Barotrauma\BarotraumaShared\SharedSource\GameSession\Data\Wallet.cs:line 204 at Barotrauma.Wallet.TryDeduct(Int32 price) in \Barotrauma\BarotraumaShared\SharedSource\GameSession\Data\Wallet.cs:line 189 at Barotrauma.MultiPlayerCampaign.TryPurchase(Client client, Int32 price) in \Barotrauma\BarotraumaClient\ClientSource\GameSession\GameModes\MultiPlayerCampaign.cs:line 1019 at Barotrauma.UpgradeManager.PurchaseItemSwap(Item itemToRemove, ItemPrefab itemToInstall, Boolean force, Client client) in \Barotrauma\BarotraumaShared\SharedSource\GameSession\UpgradeManager.cs:line 351 at Barotrauma.MultiPlayerCampaign.ClientRead(IReadMessage msg) in \Barotrauma\BarotraumaClient\ClientSource\GameSession\GameModes\MultiPlayerCampaign.cs:line 723 at Barotrauma.Networking.GameClient.<>c__DisplayClass125_0.b__0(ServerNetSegment segment, IReadMessage inc) in \Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs:line 2143 at Barotrauma.Networking.SegmentTableReader`1.Read(IReadMessage msg, SegmentDataReader segmentDataReader, ExceptionHandler exceptionHandler) in \Barotrauma\BarotraumaShared\SharedSource\Utils\SegmentTable.cs:line 296 ```