Facepunch / sbox-issues

178 stars 12 forks source link

Leaving a game breaks networking #7086

Closed Nolankicks closed 14 hours ago

Nolankicks commented 2 days ago

Describe the bug

Leaving a game breaks networking

To Reproduce

Leave a networked lobby

Expected behavior

Nothing should break

Media/Files

Image

[Generic] Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Sandbox.Network.NetworkSystem.GetFilteredConnections(ChannelState minimumState, Nullable1 filter)+MoveNext() in C:\build_work\sbox\sbox\engine\Sandbox.Engine\Networking\System\NetworkSystem.Send.cs:line 59 at Sandbox.DeltaSnapshotSystem.Send(DeltaSnapshotContainer container, IEnumerable1 connections) in C:\build\_work\sbox\sbox\engine\Sandbox.Game\Scene\Networking\DeltaSnapshots\DeltaSnapshotSystem.cs:line 209 at Sandbox.Scene.GameTick() in C:\build\_work\sbox\sbox\engine\Sandbox.Game\Scene\Scene\Scene.Tick.cs:line 280 at Sandbox.Game.Frame() in C:\build\_work\sbox\sbox\engine\Sandbox.Game\Game\Game.Scene.cs:line 30 at Sandbox.GameInstanceDll.Tick() in C:\build\_work\sbox\sbox\engine\Sandbox.GameInstance\GameInstanceDll.cs:line 276 at Sandbox.EngineLoop.FrameStart() in C:\build\_work\sbox\sbox\engine\Sandbox.Engine\EngineLoop.cs:line 158 at Sandbox.EngineLoop.RunFrame(CMaterialSystem2AppSystemDict appDict, Boolean& wantsQuit) in C:\build\_work\sbox\sbox\engine\Sandbox.Engine\EngineLoop.cs:line 36

[Generic] Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Sandbox.Network.NetworkSystem.Broadcast(ByteStream msg, ChannelState minimumState, Nullable1 filter, NetFlags flags) in C:\build_work\sbox\sbox\engine\Sandbox.Engine\Networking\System\NetworkSystem.Send.cs:line 28 at Sandbox.Network.GameNetworkSystem.Broadcast[T](T obj, Nullable1 filter, NetFlags flags) in C:\build\_work\sbox\sbox\engine\Sandbox.Engine\Networking\System\GameNetworkSystem\GameNetworkSystem.cs:line 110 at Sandbox.Rpc.SendInstanceRpc(GameObject go, Component component, WrappedMethod& m, Object[] argumentList, RpcAttribute attribute) in C:\build\_work\sbox\sbox\engine\Sandbox.Game\Scene\Networking\Rpc.InstanceRpc.cs:line 168 at Sandbox.Rpc.OnCallInstanceRpc(GameObject& go, Component& component, WrappedMethod& m, Object[]& argumentList) in C:\build\_work\sbox\sbox\engine\Sandbox.Game\Scene\Networking\Rpc.InstanceRpc.cs:line 125 at Footsteps.PlayFootstep(FootstepEvent e) in Player/FootSteps.cs:line 54 at Sandbox.SceneModel.OnAnimationEvent(IntPtr typeName, Single cycle, Single time, IntPtr data) in C:\build\_work\sbox\sbox\engine\Sandbox.Engine\SceneSystem\SceneModel.Events.cs:line 118 2024/11/29 22:31:15.0380

Additional context

https://sbox.game/nolankicks/fortwars/errors/view/21216762e1d27f319b892b900484a1cbc71b420d56ac7f32dc806e2e0950bb98 https://sbox.game/nolankicks/fortwars/errors/view/a405554b5de8d0fbafd066c51d9330f6245a61204b8d042eb88c1ca07fc03d4a https://sbox.game/nolankicks/fortwars/errors/view/0e0b4f0ef5cce729920535c24fd569c814e4a15da7a1fde0fab11a2bccbd43d7 https://sbox.game/nolankicks/fortwars/errors/view/db99e8f7d215d684894b1a73e1d6c95dd3b34284cddca6c5dc917ae7ebb0785f

Nolankicks commented 2 days ago

Method in question: Image

Nolankicks commented 2 days ago

Seems to maybe be with bad timing? Didn't happen with 2 people. 3 people it did when rpcs were being fired alot and the host leaves

kurozael commented 14 hours ago

Lemme know if it happens again :)

Nolankicks commented 14 hours ago

Seems to be fixed, thanks man