Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by KSDpolska, Nov 16, 2017.
Someone can tell me a way that I can know if a player is premium or pirate?
Thanks in advance!
There are a lot of threads with the same question.
If the server is in online mode, all players have to be premium.
Is obviously the server is not in online mode
Yes, indeed isn't online mode.
Please, can you give me a post that give a correct way to do this?
You're not going to get any support in offline mode. If you're running offline mode, you're expected to support yourself.
Thanks for your help.
Offline mode means that the server doesn't connect to Mojang's servers at all.
Therefore, no way to check if they did connect or not. The answer is always "no, they didn't authenticate with mojang".
You could verify the username to see if it exists on Mojang's servers, that would tell you if a player uses an account that actually exists.
But I dont see how that'd be useful, in offline mode, there is no checks to make sure a player is who they say they are.
Actually there is a way, it's not so simple but there is.
You can look at https://www.spigotmc.org/resources/fastlogin.14153/ and try to understand how they do it.
Quote from FastLogin FAQ:
"How does this plugin work?
By using ProtocolLib, this plugin works as a proxy between the client and server. This plugin will fake that the server runs in online mode. It does everything an online mode server would do. This will be for example, generating keys or checking for valid sessions. Because everything is the same compared to an offline mode login after an encrypted connection, we will intercept only login packets of premium players.
Player is connecting to the server.
Plugin checks if the username we received activated the fast login method (i.e. using command)
Run a check if the username is currently used by a paid account. (We don't know yet if the client connecting is premium)
Request an Mojang Session Server authentication
On response check if all data is correct
Encrypt the connection
On success intercept all related login packets and fake a new login packet as a normal offline login"
Make your server to be online-mode: true. This will force all players to be a premium player.
you need 90 messages
3 free plugins
and 30 positive ratings