Skip to content

Conversation

@Smart123s
Copy link
Contributor

@Smart123s Smart123s commented Aug 22, 2021

Summary of your change

Previously registration checks for Floodgate players were made via, authPlugin.isRegistered(username). However, if no auth plugin is installed, that it would have obviously failed. With this PR, if there's no such plugin, it'll try to get the registration status from the SQL Database.

Related issue

Fixes #594

I got a lot of java.lang.IllegalStateException: Cannot reply to EncryptionRequestPacket without profile and access token. errors while trying to join via Bungeecord. It happens randomly (around 50% of the time), if the player is not yet in the Floodgate.getPlayers() list when doing the name conflict checking:
https://github.com/games647/FastLogin/blob/01c9b55d80c93e0df4ad9050519995f4d56db759/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java#L61

This error is unrelated to the files modified in this PR, so I thought that I'd open a second PR with the fix #603 because I couldn't figure it out.

If no auth plugin is installed, rely on StoredProfile
This fixes TuxCoding#594
Floodgate players are offline players, so a special check needs to be
done to save Floodgate players as if they were online players.
@TuxCoding TuxCoding added the enhancement New feature or change request label Aug 23, 2021
@TuxCoding TuxCoding enabled auto-merge August 23, 2021 15:17
@TuxCoding TuxCoding merged commit 172efaf into TuxCoding:main Aug 23, 2021
@Smart123s
Copy link
Contributor Author

I've tested the plugin again (now on a working server), and I got an error on my Paper instance:

[19:34:42 INFO]: UUID of player .Smart123s is 00000000-0000-0000-00...
[19:34:42 INFO]: [floodgate] Floodgate player logged in as .Smart123s joined (UUID: 00000000-0000-0000-00...)
[19:34:42 INFO]: .Smart123s joined the game
[19:34:42 INFO]: .Smart123s[/192.168.1.212:41703] logged in with entity id 294 at ([world]133.5, 65.0, 6.5)
[19:34:42 INFO]: [FastLogin] Player info REGISTER command for .Smart123s from proxy
[19:34:42 INFO]: [FastLogin] Delaying force login until join event fired?: false
[19:34:42 WARN]: [AuthMe] Could not save LimboPlayer for '.Smart123s' [InaccessibleObjectException]: Unable to make private java.util.Collections$EmptyList() accessible: module java.base does not "opens java.util" to unnamed module @157853da
[19:34:43 INFO]: [FastLogin] Player .Smart123s is connecting through Geyser Floodgate.
[19:34:43 WARN]: [FastLogin] Plugin FastLogin v1.11-SNAPSHOT-172efaf generated an exception while executing task 777
java.lang.NullPointerException: Cannot invoke "com.github.games647.fastlogin.core.storage.SQLStorage.loadProfile(String)" because the return value of "com.github.games647.fastlogin.core.shared.FastLoginCore.getStorage()" is null
        at com.github.games647.fastlogin.core.shared.FloodgateManagement.run(FloodgateManagement.java:76) ~[FastLoginBukkit.jar:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-214]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [patched_1.17.1.jar:git-Paper-214]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [patched_1.17.1.jar:git-Paper-214]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
        at java.lang.Thread.run(Thread.java:831) [?:?]

Is it normal that FastLoginCore.getStorage() is null on Paper, if it's running in Bungee mode? I'll add an exclusion if it is.

@TuxCoding
Copy link
Owner

Yes, spigot server doesn't need storage access then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or change request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FastLogin/Floodgate in Bungeecord with no auth plugin on Bungee

2 participants