AuthMe / AuthMeReloaded

The best authentication plugin for the Bukkit/Spigot API!
https://www.spigotmc.org/resources/authmereloaded.6269/
GNU General Public License v3.0
616 stars 514 forks source link

Fix: Teleporting Players to Spawn on Login with teleportUnAuthedToSpawn=true #2823

Open Subu19 opened 3 months ago

Subu19 commented 3 months ago

Issue: When changing the config option teleportUnAuthedToSpawn=true during midgame, players were teleported to spawn on their next login. It only happens once after the update.

Patch: AuthMe now checks the player's last logout location from Essentials if it is not found in the AuthMe database. This ensures players are teleported to their last known location instead of the spawn point when the configuration is changed mid-game.

ghost commented 3 months ago

if there are no essentials

Subu19 commented 3 months ago

if there are no essentials

You are right, this solution only works if Essentials is installed. The original code looks okay, it does try to teleport to LimboPlayer's original location after logging in if the last location is not found in the authme's database. I don't know if this was intentional or not, LamboPlayer is initiated after teleporting the player. We could fix this issue if we store the original location of the player in LimboPlayer.

ghost commented 3 months ago

https://github.com/F3F5/SpawnAuth my solution