Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Unknown startgame error (Destination array was not long enough) during Multiplayer campaign level transition.

Open NilanthAnimosus opened this issue 3 years ago • 0 comments

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?

During some network testing reproducing a bug that required multiple level transitions, we encountered this on the critical-networking-fixes branch (now effectively unstable 0.19.4.0) during one of such level transitions to make sure character data saved in a campaign.

the error was:

Error while reading a message from server. {Destination array was not long enough. Check the destination index, length, and the array's lower bounds. (Parameter 'destinationArray')}
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
   at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Barotrauma.MultiPlayerCampaign.ClientRead(IReadMessage msg) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GameSession\GameModes\MultiPlayerCampaign.cs:line 754
   at Barotrauma.Networking.GameClient.ReadLobbyUpdate(IReadMessage inc) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs:line 2152
   at Barotrauma.Networking.GameClient.ReadDataMessage(IReadMessage inc) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs:line 702
   at Barotrauma.Networking.LidgrenClientPeer.HandleDataMessage(NetIncomingMessage lidgrenMsg) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Networking\Primitives\Peers\LidgrenClientPeer.cs:line 162
   at Barotrauma.Networking.LidgrenClientPeer.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Networking\Primitives\Peers\LidgrenClientPeer.cs:line 124
   at Barotrauma.Networking.GameClient.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs:line 555

followed by:

There was an error initializing the round (disconnected during the StartGame coroutine.)
Coroutine "Barotrauma.Networking.GameClient+<StartGame>d__103" has failed

This also caused the endgame screen to get stuck.

Reproduction steps

Unknown. we tried reproducing by using the same campaign save exiting out without saving to recreate conditions as well as multiple back to back transitions, but were unable to.

some potential notes here: the connected client may have been loading faster than the server was, but we tried to trigger it again and couldn't.

Bug prevalence

Just once

Version

Other

-

Unstable 0.19.4.0

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

NilanthAnimosus avatar Sep 07 '22 07:09 NilanthAnimosus