Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: client crashes when you attempt to login too fast #2255

Closed
1 task done
WeylonSantana opened this issue May 23, 2024 · 2 comments · Fixed by #2446
Closed
1 task done

bug: client crashes when you attempt to login too fast #2255

WeylonSantana opened this issue May 23, 2024 · 2 comments · Fixed by #2446
Labels
bug Something isn't working verified Issue has been verified as valid/existing.

Comments

@WeylonSantana
Copy link
Contributor

WeylonSantana commented May 23, 2024

Description

the client crashes when you open the client and keep pressing the login button, when it is on the black screen waiting for the gui to appear

Steps to Reproduce

  1. Open client
  2. Do not wait gui show up, keep pressing the login button
  3. crashes

Version with bug

Current

Last version that worked well

Unknown

Affected platforms

Windows

Did you find any workaround?

The problem is in Options.Instance in the LoginWindow's Show() method, which is still null, when the player (extremely impatient by the way) keeps clicking the login button before everything is loaded, for now I leave this workaround

image

An effective solution to avoid this type of happening anywhere else is to release the buttons only when Options.Instance is not null, or only fade in after you have successfully loaded Options

Relevant log output

2024-05-23 12:38:34.257 [Error] NullReferenceException: Object reference not set to an instance of an object.
    Stack:    at Intersect.Client.Interface.Menu.LoginWindow.Show() in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\Interface\Menu\LoginWindow.cs:line 183
   at Intersect.Client.Interface.Menu.MainMenu.SwitchToWindow[TMainMenuWindow]() in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\Interface\Menu\MainMenu.cs:line 232
   at Intersect.Client.Interface.Menu.MainMenuWindow.ButtonLoginOnClicked(Base sender, ClickedEventArgs arguments) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\Interface\Menu\MainMenuWindow.cs:line 97
   at Intersect.Client.Framework.Gwen.Control.Base.OnMouseClickedLeft(Int32 x, Int32 y, Boolean down, Boolean automated) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Control\Base.cs:line 2143
   at Intersect.Client.Framework.Gwen.Control.Button.OnClicked(Int32 x, Int32 y) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Control\Button.cs:line 393
   at Intersect.Client.Framework.Gwen.Control.Button.OnMouseClickedLeft(Int32 x, Int32 y, Boolean down, Boolean automated) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Control\Button.cs:line 362
   at Intersect.Client.Framework.Gwen.Control.Base.InputMouseClickedLeft(Int32 x, Int32 y, Boolean down, Boolean automated) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Control\Base.cs:line 2152
   at Intersect.Client.Framework.Gwen.Input.InputHandler.OnMouseClicked(Base canvas, Int32 mouseButton, Boolean down) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Input\InputHandler.cs:line 401
   at Intersect.Client.Framework.Gwen.Control.Canvas.Input_MouseButton(Int32 button, Boolean down) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Control\Canvas.cs:line 326
   at Intersect.Client.Framework.Gwen.Input.IntersectInput.ProcessMessage(Object message) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client.Framework\Gwen\Input\IntersectInput.cs:line 116
   at Intersect.Client.MonoGame.Input.MonoInput.CheckMouseButton(Keys modifier, ButtonState bs, MouseButtons mb) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\MonoGame\Input\MonoInput.cs:line 201
   at Intersect.Client.MonoGame.Input.MonoInput.Update(TimeSpan elapsed) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\MonoGame\Input\MonoInput.cs:line 342
   at Intersect.Client.Core.Main.Update(TimeSpan deltaTime) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\Core\Main.cs:line 106
   at Intersect.Client.MonoGame.IntersectGame.Update(GameTime gameTime) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\MonoGame\IntersectGame.cs:line 270
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at Microsoft.Xna.Framework.Game.Run()
   at Intersect.Client.MonoGame.IntersectGame.MonoGameRunner.Start(IClientContext context, Action postStartupAction) in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\MonoGame\IntersectGame.cs:line 566
   at Intersect.Client.Core.ClientContext.InternalStart() in D:\a\Intersect-Engine\Intersect-Engine\Intersect.Client\Core\ClientContext.cs:line 41
   at Intersect.Core.ApplicationContext`2.Start(Boolean lockUntilShutdown) in D:\a\Intersect-Engine\Intersect-Engine\Intersect (Core)\Core\ApplicationContext`2.cs:line 239


--------------------------------------------------------------------------------

Duplicate Bug Check

  • This bug report is not a duplicate to the best of my knowledge.
@WeylonSantana WeylonSantana added bug Something isn't working needs verification Pending confirmation that the bug exists by another user. verified Issue has been verified as valid/existing. and removed needs verification Pending confirmation that the bug exists by another user. labels May 23, 2024
@Arufonsu Arufonsu changed the title bug: Client Crashes when you try to login too faster bug: client crashes when you attempt to login too fast May 23, 2024
@lodicolo
Copy link
Member

@WeylonSantana I'm going to need a video for this, I am not fully understanding what's going on. How can you click the login button if the screen is black and you can't see it...?

Also, it should not be clickable in that case, we shouldn't have to fix this in the Login window's code.

@WeylonSantana
Copy link
Contributor Author

explorer_GieW8PtrJS.mp4

The easiest way to reproduce is to keep clicking when the server starts
when it is fully started, and before sending the entire configuration to the client, the buttons are already released bcuz server is already online, so it causes the crash

When I reported the bug I was able to do it by clicking on the position of the login button even when it was on the black screen, with the server offline if i remember correctly, probably before I refactored the file the button did not start disabled and then I must have set it to start disabled, I was not able to reproduce the bug now in the way reported above, now the way to reproduce is with the client already open when the server turns on, before the configuration is sent.

WeylonSantana added a commit to WeylonSantana/Intersect-Engine that referenced this issue Jan 4, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Intersect 0.8.0 Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified Issue has been verified as valid/existing.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants