games647 / FastLogin

Checks if a minecraft player has a valid paid account. If so, they can skip offline authentication automatically. (premium auto login)
https://www.spigotmc.org/resources/fastlogin.14153
MIT License
482 stars 119 forks source link

autoLogin or autoRegister not working in Purpur 1.21 #1224

Closed Pandemonious closed 1 week ago

Pandemonious commented 1 week ago

What happened?

When running purpur 1.21, it doesn't seem to be auto-registering premium users.

At first, I thought it was an issue with fastlogin or protocollib in general with 1.21. I noticed that logging in as a premium account, despite the settings in the config.yml, was not working, and also that the server was not preventing me from logging in as an offline "imposter" version of my premium account.

First, I used my experimental build running Purpur 1.21 build 2256, fastlogin build 1322, authme build 2631, and protocollib build 723. I tried to just use AuthMe /register and set a password, then do /premium. That worked. I was then able to login while bypassing the authme password, and it was successfully blocking offline imposters. At this point I figured it was an issue with the auto registration

Then I tried doing it running Paper 1.21 build 44, same plugins, and everything worked properly. At this point, I was concerned that the autoRegister was not working since I upgraded from Paper to Purpur, and it was only working for premium accounts that had already been added to the fastlogin.db. This was a concern for me since I didn't realize that the only thing preventing cracked imposters from connecting is a username match in the database (according to your notes). Prior, I thought it was able to get the UUID from the client to compare with mojang.

Anyways, so third, I tried doing it running Purpur 1.20.4 build 2176, with older releases of those plugins like a few months or so old, and once again everything worked properly. So I believe that the issue is specific to purpur or one of its constituent elements for the latest experimental 1.21 versions.

Steps to reproduce

  1. Set up the latest build of Purpur 1.21, set online-mode to false, and add the appropriate versions of Fastlogin, AuthMe, and Protocollib.
  2. In fastlogin config: set autoRegister to true, set nameChangeCheck to true
  3. Try to login as a premium account.

When logging in as a premium account, I expect it to auto assign a generated password and create an entry for the Authme db, while also adding an entry to the fastlogin db with premium enabled. No input from the player.

Instead, premium users are being prompted for a password by Authme, and no observed changes happen to the databases until a premium player invokes /premium

On a side note: is it true that it's not possible to tell a cracked account from a premium account without the fastlogin.db? Isn't a security key sent with the UUID from the client before the server fetches that data from mojang for comparison? It may be good if no cracked accounts that can be found on https://mcuuid.net/ or something would be allowed to connect.

Plugin list

AuthMe, ProtocolLib, FastLogin

Configuration file

only those two settings changed

Server log

[10:57:16] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] [10:57:16] [ServerMain/INFO]: Loaded 1290 recipes [10:57:16] [ServerMain/INFO]: Loaded 1399 advancements [10:57:16] [Server thread/INFO]: Starting minecraft server version 1.21 [10:57:16] [Server thread/INFO]: Loading properties [10:57:16] [Server thread/INFO]: This server is running Purpur version 1.21-2256-ver/1.21@de2e7a7 (2024-07-05T05:29:05Z) (Implementing API version 1.21-R0.1-SNAPSHOT) [10:57:17] [Server thread/INFO]: Server Ping Player Sample Count: 12 [10:57:17] [Server thread/INFO]: Using 4 threads for Netty based IO [10:57:17] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 7 worker threads, and population gen parallelism of 7 threads [10:57:17] [Server thread/INFO]: Default game type: SURVIVAL [10:57:17] [Server thread/INFO]: Generating keypair [10:57:17] [Server thread/INFO]: Starting Minecraft server on *:25565 [10:57:17] [Server thread/INFO]: Using epoll channel type [10:57:17] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. [10:57:17] [Server thread/INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity. [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loading 17 libraries... please wait [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/ch/jalu/injector/1.0/injector-1.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/javax/inject/javax.inject/1/javax.inject-1.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/javax/annotation/javax.annotation-api/1.3.1/javax.annotation-api-1.3.1.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/net/ricecode/string-similarity/1.0.0/string-similarity-1.0.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/maxmind/geoip2/geoip2/4.2.0/geoip2-4.2.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/maxmind/db/maxmind-db/3.1.0/maxmind-db-3.1.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/fasterxml/jackson/core/jackson-databind/2.16.0/jackson-databind-2.16.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/fasterxml/jackson/core/jackson-core/2.16.0/jackson-core-2.16.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/fasterxml/jackson/core/jackson-annotations/2.16.0/jackson-annotations-2.16.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/javatar/javatar/2.5/javatar-2.5.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/apache/commons/commons-email/1.6.0/commons-email-1.6.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/sun/mail/jakarta.mail/1.6.7/jakarta.mail-1.6.7.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/zaxxer/HikariCP/5.1.0/HikariCP-5.1.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/slf4j/slf4j-simple/2.0.13/slf4j-simple-2.0.13.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/ch/jalu/datasourcecolumns/0.1.2/datasourcecolumns-0.1.2.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/mysql/mysql-connector-j/8.4.0/mysql-connector-j-8.4.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/google/protobuf/protobuf-java/3.25.1/protobuf-java-3.25.1.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/mariadb/jdbc/mariadb-java-client/3.4.0/mariadb-java-client-3.4.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/github/waffle/waffle-jna/3.3.0/waffle-jna-3.3.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/slf4j/jcl-over-slf4j/2.0.7/jcl-over-slf4j-2.0.7.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/github/ben-manes/caffeine/caffeine/2.9.3/caffeine-2.9.3.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/google/errorprone/error_prone_annotations/2.10.0/error_prone_annotations-2.10.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/postgresql/postgresql/42.7.3/postgresql-42.7.3.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/checkerframework/checker-qual/3.42.0/checker-qual-3.42.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/de/rtner/PBKDF2/1.1.4/PBKDF2-1.1.4.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/picketbox/picketbox/4.0.21.Final/picketbox-4.0.21.Final.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/de/mkammerer/argon2-jvm-nolibs/2.11/argon2-jvm-nolibs-2.11.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/at/favre/lib/bcrypt/0.10.2/bcrypt-0.10.2.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/at/favre/lib/bytes/1.5.0/bytes-1.5.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/com/warrenstrange/googleauth/1.5.0/googleauth-1.5.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/commons-codec/commons-codec/1.14/commons-codec-1.14.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/ch/jalu/configme/1.3.1/configme-1.3.1.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/bstats/bstats-bukkit/3.0.2/bstats-bukkit-3.0.2.jar [10:57:17] [Server thread/INFO]: [SpigotLibraryLoader] [AuthMe] Loaded library /home/jacob/Desktop/purpurfastlogintest2/libraries/org/bstats/bstats-base/3.0.2/bstats-base-3.0.2.jar [10:57:17] [Server thread/INFO]: [FastLogin] Initialize logging service [10:57:17] [Server thread/INFO]: [FastLogin] Using optimized green threads with Java 21 [10:57:17] [Server thread/INFO]: [ProtocolLib] Loading server plugin ProtocolLib v5.3.0-SNAPSHOT-723 [10:57:17] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.21.0) has not yet been tested! Proceed with caution. [10:57:18] [Server thread/INFO]: [AuthMe] Loading server plugin AuthMe v5.7.0-SNAPSHOT-b2631 [10:57:18] [Server thread/INFO]: [spark] Loading server plugin spark v1.10.73 [10:57:18] [Server thread/INFO]: [FastLogin] Loading server plugin FastLogin v1.12-SNAPSHOT-bdd7af8 [10:57:18] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it [10:57:18] [Server thread/INFO]: [ProtocolLib] Enabling ProtocolLib v5.3.0-SNAPSHOT-723 [10:57:18] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE! [10:57:18] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware. [10:57:18] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose. [10:57:18] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file. [10:57:18] [Server thread/INFO]: Preparing level "world" [10:57:18] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld [10:57:18] [Server thread/INFO]: Time elapsed: 339 ms [10:57:18] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether [10:57:18] [Server thread/INFO]: Time elapsed: 23 ms [10:57:18] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end [10:57:18] [Server thread/INFO]: Time elapsed: 27 ms [10:57:18] [Server thread/INFO]: [AuthMe] Enabling AuthMe v5.7.0-SNAPSHOT-b2631 [10:57:18] [Server thread/INFO]: [AuthMe] SQLite Setup finished [10:57:18] [Server thread/INFO]: [AuthMe] No supported permissions system found! Permissions are disabled! [10:57:19] [Server thread/INFO]: [AuthMe] AuthMe 5.7.0-SNAPSHOT build n.2631 successfully enabled! [10:57:19] [Server thread/INFO]: [spark] Enabling spark v1.10.73 [10:57:19] [Server thread/INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring [10:57:19] [Server thread/INFO]: [spark] Starting background profiler... [10:57:19] [Server thread/INFO]: [FastLogin] Enabling FastLogin v1.12-SNAPSHOT-bdd7af8 [10:57:19] [Server thread/WARN]: [FastLogin] Disabling Minecraft proxy configuration. Assuming direct connections from now on. [10:57:19] [Server thread/INFO]: [fastlogin.hikari.HikariDataSource] FastLogin - Starting... [10:57:19] [Server thread/INFO]: [fastlogin.hikari.HikariDataSource] FastLogin - Start completed. [10:57:20] [Server thread/INFO]: Running delayed init tasks

[10:57:20] [Server thread/INFO]: [FastLogin] Hooking into auth plugin: AuthMeHook [10:57:27] [Protocol Worker #1 - FastLogin - [recv: ENCRYPTION_BEGIN[class=ServerboundKeyPacket, id=1], START[class=ServerboundHelloPacket, id=0], send: ]/INFO]: [FastLogin] New packet START[class=ServerboundHelloPacket, id=0] from com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler@7bcbf6bc [10:57:27] [/INFO]: [FastLogin] Requesting premium login for registered player: gamerboi12_mc [10:57:27] [Protocol Worker #1 - FastLogin - [recv: ENCRYPTION_BEGIN[class=ServerboundKeyPacket, id=1], START[class=ServerboundHelloPacket, id=0], send: ]/INFO]: [FastLogin] New packet ENCRYPTION_BEGIN[class=ServerboundKeyPacket, id=1] from com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler@7bcbf6bc [10:57:27] [/INFO]: [FastLogin] Enabling onlinemode encryption for /127.0.0.1:53288 [10:57:27] [/INFO]: [FastLogin] Profile gamerboi12_mc has a verified premium account [10:57:27] [User Authenticator #0/INFO]: UUID of player gamerboi12_mc is 4ad34b5d-b57c-3003-bcab-3646fc959aac [10:57:27] [Server thread/INFO]: gamerboi12_mc joined the game [10:57:28] [Server thread/INFO]: gamerboi12_mc[/127.0.0.1:53288] logged in with entity id 67 at ([world]2.416069357154681, 70.0, 114.44300413423483) [10:57:28] [Craft Scheduler Thread - 3 - FastLogin/INFO]: [FastLogin] Logging player gamerboi12_mc in [10:57:28] [Craft Scheduler Thread - 3 - AuthMe/INFO]: [AuthMe] The user gamerboi12_mc has 2 accounts: [10:57:28] [Craft Scheduler Thread - 3 - AuthMe/INFO]: [AuthMe] §7notliquor, §agamerboi12_mc§7. [10:57:28] [Craft Scheduler Thread - 3 - AuthMe/INFO]: [AuthMe] gamerboi12_mc logged in 127.0.0.1 [10:57:33] [Server thread/INFO]: gamerboi12_mc lost connection: Disconnected [10:57:33] [Server thread/INFO]: gamerboi12_mc left the game [10:57:35] [Protocol Worker #1 - FastLogin - [recv: ENCRYPTION_BEGIN[class=ServerboundKeyPacket, id=1], START[class=ServerboundHelloPacket, id=0], send: ]/INFO]: [FastLogin] New packet START[class=ServerboundHelloPacket, id=0] from com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler@25c54d0 [10:57:35] [/INFO]: [FastLogin] Requesting premium login for registered player: gamerboi12_mc [10:57:35] [Server thread/INFO]: /127.0.0.1:42616 lost connection: Disconnected [10:57:56] [Server thread/INFO]: Stopping the server [10:57:56] [Server thread/INFO]: Stopping server [10:57:56] [Server thread/INFO]: [FastLogin] Disabling FastLogin v1.12-SNAPSHOT-bdd7af8 [10:57:56] [Server thread/INFO]: [FastLogin] Safely shutting down scheduler. This could take up to one minute. [10:57:56] [Server thread/INFO]: [fastlogin.hikari.HikariDataSource] FastLogin - Shutdown initiated... [10:57:56] [Server thread/INFO]: [fastlogin.hikari.HikariDataSource] FastLogin - Shutdown completed. [10:57:56] [Server thread/ERROR]: Error occurred while disabling FastLogin v1.12-SNAPSHOT-bdd7af8 java.util.ConcurrentModificationException: null at java.base/java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:?] at java.base/java.util.HashMap$ValueIterator.next(Unknown Source) ~[?:?] at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:52) ~[guava-32.1.2-jre.jar:?] at com.google.common.collect.Iterators$ConcatenatedIterator.hasNext(Iterators.java:1400) ~[guava-32.1.2-jre.jar:?] at ProtocolLib.jar/com.comphenix.protocol.async.AsyncFilterManager.unregisterAsyncHandlers(AsyncFilterManager.java:289) ~[ProtocolLib.jar:?] at ProtocolLib.jar/com.comphenix.protocol.async.AsyncFilterManager.unregisterAsyncHandlers(AsyncFilterManager.java:283) ~[ProtocolLib.jar:?] at FastLoginBukkit.jar/com.github.games647.fastlogin.bukkit.FastLoginBukkit.onDisable(FastLoginBukkit.java:198) ~[FastLoginBukkit.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:291) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:237) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:161) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:97) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:541) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:612) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:1061) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:881) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1392) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:332) ~[purpur-1.21.jar:1.21-2256-de2e7a7] at java.base/java.lang.Thread.run(Unknown Source) ~[?:?] [10:57:56] [Server thread/INFO]: [spark] Disabling spark v1.10.73 [10:57:56] [Server thread/INFO]: [AuthMe] Disabling AuthMe v5.7.0-SNAPSHOT-b2631 [10:57:56] [Server thread/INFO]: [AuthMe] Waiting for 0 tasks to finish [10:57:56] [Server thread/INFO]: [AuthMe] AuthMe 5.7.0-SNAPSHOT-b2631 disabled! [10:57:56] [Server thread/INFO]: [ProtocolLib] Disabling ProtocolLib v5.3.0-SNAPSHOT-723 [10:57:56] [Server thread/INFO]: Saving players [10:57:56] [Server thread/INFO]: Saving worlds [10:57:56] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld [10:57:56] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world' [10:57:56] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world' [10:57:56] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Saved 537 block chunks, 537 entity chunks, 0 poi chunks in world 'world' in 0.44s [10:57:57] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.05s [10:57:57] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end' [10:57:57] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.01s [10:57:57] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved [10:57:57] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [10:57:57] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [10:57:57] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved

Plugin version

https://ci.codemc.io/job/Games647/job/FastLogin/1322/

Platform

Spigot

Relevance

games647 commented 1 week ago

On a side note: is it true that it's not possible to tell a cracked account from a premium account without the fastlogin.db?

Maybe we should summarize FastLogin implementation a bit. You can understand the FastLogin database more like preference decision. Players opt-in to the auto login process, although you can change it using the configuration (like autoRegister or switchMode). There two reasons for this. First, it verifies that as an existing user you have access to the password of the auth plugin account. Second, cracked players are not locked out. The decision whether to enable online mode has made based on the username (the database or configuration changes). If we request it from a offline player, the client itself will disconnect and we cannot change the disconnect message. You could make it that you detect the failure and allow a second attempt, but this is a bad user experience in my opinion. Therefore, standard behavior is offline with opt-in, because the available data is limited like connection details, username and that's it.

Nevertheless, I found a new way to detect premium status of players during login, which doesn't have this limitation. The new process doesn't need the database anymore; Only if you want to disable or selectively enable it. It's currently unpublished as part of #1206. It requires a lot of rework, because many features of FastLogin will be redundant and the changes requires some special code for each Minecraft version.

It may be good if no cracked accounts that can be found on https://mcuuid.net/ or something would be allowed to connect.

That's exactly what autoRegister does. It checks if the username is registered. Nevertheless, people tend to use already existing usernames. Such players will still disconnect.

Isn't a security key sent with the UUID from the client before the server fetches that data from mojang for comparison?

Something similar happens during the verification. The FAQ shows a bit the order of the login process.

  1. Client->Server: Client requests to join server with a given username
  2. Server: Make decision if we should request onlinemode
    • Existing user? Did they enabled it (database)?
    • Is the username registered at Mojang (if autoRegister is enabled)
  3. Server->Client: Request client to enable online mode
  4. Client->Mojang: Player tells Mojang that it wants to join that server
  5. Client->Server: Mojang allowed my request with the following data
  6. Server->Mojang: Does that player really made this request (verification) Here, the server receives the current UUID, skin data on successs
  7. Server->Client: All good, you can join with first data

Step 3 is important here where an offline player would just disconnect.

Pandemonious commented 1 week ago

Thank you for your detailed response.

I tried your latest release, and it is now working!

Nevertheless, looking forward to Big Release 2.0