space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.54k stars 3.15k forks source link

Placing Ash into a Beaker causes a client side error. #30025

Open CaasGit opened 1 month ago

CaasGit commented 1 month ago

Description

Putting ash into a beaker causes an error on the client.

[ERRO] root: Predicting the queued deletion of a networked entity: ash (2098/n2451, Ash). Trace:    at System.Environment.get_StackTrace()
   at Robust.Client.GameObjects.ClientEntityManager.QueueDeleteEntity(Nullable`1 uid) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameObjects/ClientEntityManager.cs:line 75
   at Content.Shared.Chemistry.EntitySystems.SolutionSpikerSystem.TrySpike(EntityUid source, EntityUid target, EntityUid user, RefillableSolutionComponent spikableTarget, SolutionSpikerComponent spikableSource, SolutionContainerManagerComponent managerSource, SolutionContainerManagerComponent managerTarget) in _PATH_/space-station-14/Content.Shared/Chemistry/EntitySystems/SolutionSpikerSystem.cs:line 64
   at Content.Shared.Chemistry.EntitySystems.SolutionSpikerSystem.OnInteractUsing(Entity`1 entity, InteractUsingEvent& args) in _PATH_/space-station-14/Content.Shared/Chemistry/EntitySystems/SolutionSpikerSystem.cs:line 29
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass57_0`2.<SubscribeLocalEvent>g__EventHandler|0(EntityUid uid, IComponent comp, TEvent& args) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass67_0`1.<EntSubscribe>b__0(EntityUid uid, IComponent comp, Unit& ev) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 460
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass76_1.<EntCollectOrdered>b__0(Unit& ev) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 664
   at Robust.Shared.GameObjects.EntityEventBus.DispatchOrderedEvents(Unit& eventArgs, ValueList`1& found) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Ordering.cs:line 52
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalOrdered(EntityUid uid, Type eventType, EventData subs, Unit& unitRef, Boolean broadcast) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Ordering.cs:line 43
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalEventCore(EntityUid uid, Unit& unitRef, Type type, Boolean broadcast) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 236
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalEvent[TEvent](EntityUid uid, TEvent args, Boolean broadcast) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 200
   at Robust.Shared.GameObjects.EntitySystem.RaiseLocalEvent[TEvent](EntityUid uid, TEvent args, Boolean broadcast) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntitySystem.cs:line 159
   at Content.Shared.Interaction.SharedInteractionSystem.InteractUsing(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation, Boolean checkCanInteract, Boolean checkCanUse) in _PATH_/space-station-14/Content.Shared/Interaction/SharedInteractionSystem.cs:line 954
   at Content.Shared.Interaction.SharedInteractionSystem.UserInteraction(EntityUid user, EntityCoordinates coordinates, Nullable`1 target, Boolean altInteract, Boolean checkCanInteract, Boolean checkAccess, Boolean checkCanUse) in _PATH_/space-station-14/Content.Shared/Interaction/SharedInteractionSystem.cs:line 427
   at Content.Shared.Interaction.SharedInteractionSystem.HandleUseInteraction(ICommonSession session, EntityCoordinates coords, EntityUid uid) in _PATH_/space-station-14/Content.Shared/Interaction/SharedInteractionSystem.cs:line 301
   at Robust.Shared.Input.Binding.PointerInputCmdHandler.<>c__DisplayClass5_0.<.ctor>b__0(PointerInputCmdArgs& args) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/Input/Binding/InputCmdHandler.cs:line 97
   at Robust.Shared.Input.Binding.PointerInputCmdHandler.HandleCmdMessage(IEntityManager entManager, ICommonSession session, IFullInputCmdMessage message) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/Input/Binding/InputCmdHandler.cs:line 121
   at Robust.Client.GameObjects.InputSystem.HandleInputCommand(ICommonSession session, BoundKeyFunction function, IFullInputCmdMessage message, Boolean replay) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameObjects/EntitySystems/InputSystem.cs:line 80
   at Content.Client.Interaction.DragDropSystem.OnUseMouseUp(PointerInputCmdArgs& args) in _PATH_/space-station-14/Content.Client/Interaction/DragDropSystem.cs:line 333
   at Content.Client.Interaction.DragDropSystem.OnUse(PointerInputCmdArgs& args) in _PATH_/space-station-14/Content.Client/Interaction/DragDropSystem.cs:line 151
   at Robust.Shared.Input.Binding.PointerInputCmdHandler.HandleCmdMessage(IEntityManager entManager, ICommonSession session, IFullInputCmdMessage message) in _PATH_/space-station-14/RobustToolbox/Robust.Shared/Input/Binding/InputCmdHandler.cs:line 121
   at Robust.Client.GameObjects.InputSystem.HandleInputCommand(ICommonSession session, BoundKeyFunction function, IFullInputCmdMessage message, Boolean replay) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameObjects/EntitySystems/InputSystem.cs:line 80
   at Content.Client.Gameplay.GameplayStateBase.OnKeyBindStateChanged(ViewportBoundKeyEventArgs args) in _PATH_/space-station-14/Content.Client/Gameplay/GameplayStateBase.cs:line 207
   at Content.Client.Gameplay.GameplayState.OnKeyBindStateChanged(ViewportBoundKeyEventArgs args) in _PATH_/space-station-14/Content.Client/Gameplay/GameplayState.cs:line 117
   at Robust.Client.Input.InputManager.ViewportKeyEvent(Control viewport, BoundKeyEventArgs eventArgs) in _PATH_/space-station-14/RobustToolbox/Robust.Client/Input/InputManager.cs:line 453
   at Content.Client.Viewport.ScalingViewport.KeyBindUp(GUIBoundKeyEventArgs args) in _PATH_/space-station-14/Content.Client/Viewport/ScalingViewport.cs:line 144
   at Robust.Client.UserInterface.UserInterfaceManager.<>c.<KeyBindUp>b__132_0(Control c, GUIBoundKeyEventArgs ev) in _PATH_/space-station-14/RobustToolbox/Robust.Client/UserInterface/UserInterfaceManager.Input.cs:line 136
   at Robust.Client.UserInterface.UserInterfaceManager._doGuiInput(Control control, GUIBoundKeyEventArgs guiEvent, Action`2 action, Boolean ignoreStop) in _PATH_/space-station-14/RobustToolbox/Robust.Client/UserInterface/UserInterfaceManager.Input.cs:line 299
   at Robust.Client.UserInterface.UserInterfaceManager.KeyBindUp(BoundKeyEventArgs args) in _PATH_/space-station-14/RobustToolbox/Robust.Client/UserInterface/UserInterfaceManager.Input.cs:line 136
   at Robust.Client.UserInterface.UserInterfaceManager.OnUIKeyBindStateChanged(BoundKeyEventArgs args) in _PATH_/space-station-14/RobustToolbox/Robust.Client/UserInterface/UserInterfaceManager.Input.cs:line 457
   at Robust.Client.Input.InputManager.SetBindState(KeyBinding binding, BoundKeyState state, Boolean uiOnly, Boolean isRepeat) in _PATH_/space-station-14/RobustToolbox/Robust.Client/Input/InputManager.cs:line 412
   at Robust.Client.Input.InputManager.UpBind(KeyBinding binding) in _PATH_/space-station-14/RobustToolbox/Robust.Client/Input/InputManager.cs:line 375
   at Robust.Client.Input.InputManager.KeyUp(KeyEventArgs args) in _PATH_/space-station-14/RobustToolbox/Robust.Client/Input/InputManager.cs:line 326
   at Robust.Client.GameController.KeyUp(KeyEventArgs keyEvent) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameController/GameController.Input.cs:line 20
   at Robust.Client.Graphics.Clyde.Clyde.DispatchSingleEvent(DEventBase ev) in _PATH_/space-station-14/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.Events.cs:line 50
   at Robust.Client.Graphics.Clyde.Clyde.DispatchEvents() in _PATH_/space-station-14/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.Events.cs:line 31
   at Robust.Client.Graphics.Clyde.Clyde.ProcessInput(FrameEventArgs frameEventArgs) in _PATH_/space-station-14/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs:line 392
   at Robust.Client.GameController.Input(FrameEventArgs frameEventArgs) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameController/GameController.cs:line 489
   at Robust.Client.GameController.<StartupContinue>b__58_2(Object sender, FrameEventArgs args) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameController/GameController.cs:line 240
   at Robust.Shared.Timing.GameLoop.Run() in _PATH_/space-station-14/RobustToolbox/Robust.Shared/Timing/GameLoop.cs:line 187
   at Robust.Client.GameController.ContinueStartupAndLoop(DisplayMode mode) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 162
   at Robust.Client.GameController.GameThreadMain(DisplayMode mode) in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 147
   at Robust.Client.GameController.<>c__DisplayClass100_0.<Run>b__0() in _PATH_/space-station-14/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 106

Reproduction Spawn Ash, Spawn Beaker. Push Ash into a Beaker. See client log for error.

deltanedas commented 1 month ago

solution: implement predicted deletion :trollface:

luizwritescode commented 1 month ago

adding to what deltanedas said, this is the method the client calls way before the server gets a chance to even enque the entity for deletion

     public override void QueueDeleteEntity(EntityUid? uid)
        {
            if (uid == null || uid == EntityUid.Invalid)
                return;

            if (IsClientSide(uid.Value))
            {
                base.QueueDeleteEntity(uid);
                return;
            }

            if (ShuttingDown)
                return;

            // Client-side entity deletion is not supported and will cause errors.
            if (_client.RunLevel == ClientRunLevel.Connected || _client.RunLevel == ClientRunLevel.InGame)
                LogManager.RootSawmill.Error($"Predicting the queued deletion of a networked entity: {ToPrettyString(uid.Value)}. Trace: {Environment.StackTrace}");
       }

my first idea was have the client reconcile predicted deletions with the actual game state if they are not confirmed by the server, but this is a complex task that requires deep understanding of the game's networking architechture.