Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-1189

Player logging in without an AsyncPlayerPreLoginEvent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None

      So I have a plugin that uses AsyncPlayerPreLoginEvent to load an extra data file for custom variables. While on my server, testing other plugins, I ran into a problem where it would fail a verification check I put in place; my player had essentially logged out twice.

      What really happened was the player had initially logged out, but apparently, not fully. This made it so AsyncPlayerPreLoginEvent never got called to remove the save event scheduled by the PlayerQuitEvent. Then when I went to log out for the second time, the save event had not been processed yet, and so it was attempting to add another save event which is where my verification check threw an error.

      I went through the code of the server and tried to locate exactly how the issue could happen, but wasn't able to fully understand the flow of the code. I found a temporary solution based on what I learned, using the PlayerLoginEvent to check if the AsyncPlayerPreLoginEvent had ever been called.

      I don't know if it's an intended feature, like if a player loses internet temporarily or what, but I figured it doesn't really behave how it should. If this is how it's supposed to work, maybe add another event for when a player logs out completely to avoid any confusion.

            Unassigned Unassigned
            Qatell Qatell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: