LoginSecurity icon indicating copy to clipboard operation
LoginSecurity copied to clipboard

Login Failure When Player's Logout World is not the default.

Open leeadama opened this issue 7 years ago • 3 comments

If the last world used is the same as the default world, login works without any issues. If not then:

Receive the following warning in the console and the login doesn't happen. There is no error presented to the Player, it simply continues repeating the "Please Login" message.

Tried the latest test build #17 and it still happens.

Here's the log: https://pastebin.com/pguPpgHk

Regarding the 'Warning" I was able to find this posting stating that Teleports should not be done Asynchronously

https://www.spigotmc.org/threads/help.92977/

I barely know what that means I just included it for completeness.

leeadama avatar Mar 11 '18 10:03 leeadama

Well, I had Zero (0) experience in Plugins for Bukkit/Spigot but with a lot of googling I managed to find and fix the problem with multiworld support. It was the fact that the AuthAction method was being run in a background thread. Bukkit's API is not threadsafe. I disabled the background thread and cleaned it up a little bit. Tested working on my Spigot 1.12.2 server. Here is a link to both the patch file (diff) and the compiled .jar file. http://www.mediafire.com/file/d5f10nd702ux30n/LoginSecurity-Fixed-MultiWorld.zip

leeadama avatar Mar 19 '18 05:03 leeadama

@leeadama A lot of things in LoginSecurity are run on the background thread. I do this for performance reasons.

LoginSecurity communicates with a databases when players sign in, this can take several milliseconds, even more when you are using a MySQL database. If we run this on the main thread, the server will be doing nothing while its retrieving this data, instead of processing chunks, entities and other plugins.

Naturally, this is bad and decreases TPS.

However, you can't run everything on the background thread, because the server itself, like you said, is singlethreaded. So whenever any entity/item/world action is performed, it switches back to the main thread.

If the user is teleported asynchronously, that's a mistake on my part. I will fix it in the next version.

lenis0012 avatar Apr 22 '18 06:04 lenis0012

I understand the need for background processes, but in the case of Teleporting the API specifically states that it should never be done in a background thread.

You might want to take a look at the patch file (diff) that I included in the .ZIP download of the modified version. It should give you a starting point at least.

I've been using my modified version for quite a wile now and it's been perfect.

Thanks for the great plugin!,

Lee


From: lenis0012 [email protected] Sent: Saturday, April 21, 2018 11:48 PM To: lenis0012/LoginSecurity-2 Cc: leeadama; Mention Subject: Re: [lenis0012/LoginSecurity-2] Login Failure When Player's Logout World is not the default. (#123)

@leeadamahttps://github.com/leeadama A lot of things in LoginSecurity are run on the background thread. I do this for performance reasons.

LoginSecurity communicates with a databases when players sign in, this can take several milliseconds, even more when you are using a MySQL database. If we run this on the main thread, the server will be doing nothing while its retrieving this data, instead of processing chunks, entities and other plugins.

Naturally, this is bad and decreases FPS.

However, you can't run everything on the background thread, because the server itself, like you said, is singlethreaded. So whenever any entity/item/world action is performed, it switches back to the main thread.

If the user is teleported asynchronously, that's a mistake on my part. I will fix it in the next version.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/lenis0012/LoginSecurity-2/issues/123#issuecomment-383359712, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALYVNfcglzu6GciYqBFWe-ISN3ydm6Crks5trCfIgaJpZM4SlpSi.

leeadama avatar Apr 22 '18 19:04 leeadama