mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Typo fixes
This commit is contained in:
20
README.md
20
README.md
@ -12,7 +12,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi
|
|||||||
* Forge/Sponge message support
|
* Forge/Sponge message support
|
||||||
* Premium UUID support
|
* Premium UUID support
|
||||||
* Forward skins
|
* Forward skins
|
||||||
* Detect user name changed and will update the existing database record
|
* Detect username changed and will update the existing database record
|
||||||
* BungeeCord support
|
* BungeeCord support
|
||||||
* Auto register new premium players
|
* Auto register new premium players
|
||||||
* Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib
|
* Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib
|
||||||
@ -23,14 +23,14 @@ So they don't need to enter passwords. This is also called auto login (auto-logi
|
|||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
Please use issues for bug reports, suggestions, questions and more. Please check for existing issues. Existing issues
|
Please use issues for bug reports, suggestions, questions and more. Please check for existing issues. Existing issues
|
||||||
can be voted up by adding up vote to the original post. Closing issues means that they are marked as resolved. Comments
|
can be voted up by adding up vote to the original post. Closing issues means that they are marked as resolved. Comments
|
||||||
are still allowed and it could be re-opened.
|
are still allowed and it could be re-opened.
|
||||||
|
|
||||||
## Development builds
|
## Development builds
|
||||||
|
|
||||||
Development builds contain the latest changes from the Source-Code. They are bleeding edge and could introduce new bugs,
|
Development builds contain the latest changes from the Source-Code. They are bleeding edge and could introduce new bugs,
|
||||||
but also include features, enhancements and bug fixes that are not yet in a released version. If you click on the left
|
but also include features, enhancements and bug fixes that are not yet in a released version. If you click on the left
|
||||||
side on `Changes`, you can see iterative change sets leading to a specific build.
|
side on `Changes`, you can see iterative change sets leading to a specific build.
|
||||||
|
|
||||||
You can download them from here: https://ci.codemc.org/job/Games647/job/FastLogin/
|
You can download them from here: https://ci.codemc.org/job/Games647/job/FastLogin/
|
||||||
@ -51,17 +51,17 @@ You can download them from here: https://ci.codemc.org/job/Games647/job/FastLogi
|
|||||||
|
|
||||||
## Placeholder
|
## Placeholder
|
||||||
|
|
||||||
This plugin supports `PlaceholderAPI` on `Spigot`. It exports the following variable
|
This plugin supports `PlaceholderAPI` on `Spigot`. It exports the following variable
|
||||||
`%fastlogin_status%`. In BungeeCord environments, the status of a player will be delivered with a delay after the player
|
`%fastlogin_status%`. In BungeeCord environments, the status of a player will be delivered with a delay after the player
|
||||||
already successful joined the server. This takes about a couple of milliseconds. In this case the value
|
already successful joined the server. This takes about a couple of milliseconds. In this case the value
|
||||||
will be `Unknown`.
|
will be `Unknown`.
|
||||||
|
|
||||||
Possible values: `Premium`, `Cracked`, `Unknown`
|
Possible values: `Premium`, `Cracked`, `Unknown`
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* Plugin:
|
* Plugin:
|
||||||
* [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/) or
|
* [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/) or
|
||||||
* [ProtocolSupport](https://www.spigotmc.org/resources/protocolsupport.7201/)
|
* [ProtocolSupport](https://www.spigotmc.org/resources/protocolsupport.7201/)
|
||||||
* [Spigot](https://www.spigotmc.org) 1.8.8+
|
* [Spigot](https://www.spigotmc.org) 1.8.8+
|
||||||
* Java 8+
|
* Java 8+
|
||||||
@ -116,6 +116,6 @@ Put your stats id from the BungeeCord config into this file
|
|||||||
(on the servers where your login plugin is or where player should be able to execute the commands of FastLogin)
|
(on the servers where your login plugin is or where player should be able to execute the commands of FastLogin)
|
||||||
6. Check your database settings in the config of FastLogin on BungeeCord
|
6. Check your database settings in the config of FastLogin on BungeeCord
|
||||||
7. Set proxy and Spigot in offline mode by setting the value onlinemode in your config.yml to false
|
7. Set proxy and Spigot in offline mode by setting the value onlinemode in your config.yml to false
|
||||||
8. You should *always* firewall your Spigot server that it's only accessible through BungeeCord
|
8. You should *always* firewall your Spigot server that it's only accessible through BungeeCord
|
||||||
* https://www.spigotmc.org/wiki/bungeecord-installation/#post-installation
|
* https://www.spigotmc.org/wiki/bungeecord-installation/#post-installation
|
||||||
* BungeeCord doesn't support SQLite per default, so you should change the configuration to MySQL or MariaDB. For that you have to install MariaDB/MySQL on your root server first and put the credentials you made in the FastLogin config files.
|
* BungeeCord doesn't support SQLite per default, so you should change the configuration to MySQL or MariaDB. For that you have to install MariaDB/MySQL on your root server first and put the credentials you made in the FastLogin config files.
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<!--This have to be in lowercase because it's used by plugin.yml-->
|
<!--This has to be in lowercase because it's used by plugin.yml-->
|
||||||
<artifactId>fastlogin.bukkit</artifactId>
|
<artifactId>fastlogin.bukkit</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
@ -144,7 +144,7 @@
|
|||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- PaperSpigot API for correcting usercache usage -->
|
<!-- PaperSpigot API for correcting user cache usage -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
|
@ -69,11 +69,11 @@ public class BukkitLoginSession extends LoginSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the verify token the server sent to the client.
|
* Gets the verify-token the server sent to the client.
|
||||||
*
|
*
|
||||||
* Empty if it's a BungeeCord connection
|
* Empty if it's a BungeeCord connection
|
||||||
*
|
*
|
||||||
* @return the verify token from the server
|
* @return verify token from the server
|
||||||
*/
|
*/
|
||||||
public synchronized byte[] getVerifyToken() {
|
public synchronized byte[] getVerifyToken() {
|
||||||
return verifyToken.clone();
|
return verifyToken.clone();
|
||||||
|
@ -91,7 +91,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
core.load();
|
core.load();
|
||||||
|
|
||||||
if (getServer().getOnlineMode()) {
|
if (getServer().getOnlineMode()) {
|
||||||
//we need to require offline to prevent a loginSession request for a offline player
|
//we need to require offline to prevent a loginSession request for an offline player
|
||||||
logger.error("Server has to be in offline mode");
|
logger.error("Server has to be in offline mode");
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
return;
|
return;
|
||||||
@ -149,7 +149,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
|
|
||||||
pluginManager.registerEvents(new ConnectionListener(this), this);
|
pluginManager.registerEvents(new ConnectionListener(this), this);
|
||||||
|
|
||||||
//if server is using paper - we need to add one more listener to correct the usercache usage
|
//if server is using paper - we need to add one more listener to correct the user cache usage
|
||||||
if (PaperLib.isPaper()) {
|
if (PaperLib.isPaper()) {
|
||||||
pluginManager.registerEvents(new PaperCacheListener(this), this);
|
pluginManager.registerEvents(new PaperCacheListener(this), this);
|
||||||
}
|
}
|
||||||
@ -218,22 +218,22 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
|||||||
return loginSession;
|
return loginSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BukkitLoginSession getSession(InetSocketAddress addr) {
|
public BukkitLoginSession getSession(InetSocketAddress address) {
|
||||||
String id = getSessionId(addr);
|
String id = getSessionId(address);
|
||||||
return loginSession.get(id);
|
return loginSession.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSessionId(InetSocketAddress addr) {
|
public String getSessionId(InetSocketAddress address) {
|
||||||
return addr.getAddress().getHostAddress() + ':' + addr.getPort();
|
return address.getAddress().getHostAddress() + ':' + address.getPort();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putSession(InetSocketAddress addr, BukkitLoginSession session) {
|
public void putSession(InetSocketAddress address, BukkitLoginSession session) {
|
||||||
String id = getSessionId(addr);
|
String id = getSessionId(address);
|
||||||
loginSession.put(id, session);
|
loginSession.put(id, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeSession(InetSocketAddress addr) {
|
public void removeSession(InetSocketAddress address) {
|
||||||
String id = getSessionId(addr);
|
String id = getSessionId(address);
|
||||||
loginSession.remove(id);
|
loginSession.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,11 +121,11 @@ public class CrazyLoginHook implements AuthPlugin<Player> {
|
|||||||
public boolean forceRegister(Player player, String password) {
|
public boolean forceRegister(Player player, String password) {
|
||||||
CrazyLoginDataDatabase crazyDatabase = crazyLoginPlugin.getCrazyDatabase();
|
CrazyLoginDataDatabase crazyDatabase = crazyLoginPlugin.getCrazyDatabase();
|
||||||
|
|
||||||
//this executes a sql query and accesses only thread safe collections so we can run it async
|
//this executes a sql query and accesses only thread safe collections, so we can run it async
|
||||||
LoginPlayerData playerData = crazyLoginPlugin.getPlayerData(player.getName());
|
LoginPlayerData playerData = crazyLoginPlugin.getPlayerData(player.getName());
|
||||||
if (playerData == null) {
|
if (playerData == null) {
|
||||||
//create a fake account - this will be saved to the database with the password=FAILEDLOADING
|
//create a fake account - this will be saved to the database with the password=FAILEDLOADING
|
||||||
//user cannot login with that password unless the admin uses plain text
|
//user cannot log in with that password unless the admin uses plain text
|
||||||
//this automatically marks the player as logged in
|
//this automatically marks the player as logged in
|
||||||
crazyDatabase.save(new LoginPlayerData(player));
|
crazyDatabase.save(new LoginPlayerData(player));
|
||||||
return forceLogin(player);
|
return forceLogin(player);
|
||||||
|
@ -128,7 +128,7 @@ public class BungeeListener implements PluginMessageListener {
|
|||||||
session.setVerified(true);
|
session.setVerified(true);
|
||||||
plugin.putSession(player.getAddress(), session);
|
plugin.putSession(player.getAddress(), session);
|
||||||
|
|
||||||
// only start a new login task if the join event fired earlier. This event then didn
|
// only start a new login task if the join event fired earlier. This event then didn't
|
||||||
boolean result = plugin.getBungeeManager().didJoinEventFired(player);
|
boolean result = plugin.getBungeeManager().didJoinEventFired(player);
|
||||||
plugin.getLog().info("Delaying force login until join event fired?: {}", result);
|
plugin.getLog().info("Delaying force login until join event fired?: {}", result);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -43,7 +43,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
import org.geysermc.floodgate.api.player.FloodgatePlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This listener tells authentication plugins if the player has a premium account and we checked it successfully. So the
|
* This listener tells authentication plugins weather the player has a premium account. So the
|
||||||
* plugin can skip authentication.
|
* plugin can skip authentication.
|
||||||
*/
|
*/
|
||||||
public class ConnectionListener implements Listener {
|
public class ConnectionListener implements Listener {
|
||||||
|
@ -55,7 +55,7 @@ public class EncryptionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a RSA key pair
|
* Generate an RSA key pair
|
||||||
*
|
*
|
||||||
* @return The RSA key pair.
|
* @return The RSA key pair.
|
||||||
*/
|
*/
|
||||||
|
@ -83,7 +83,7 @@ class ProtocolLibLoginSource implements LoginSource {
|
|||||||
|
|
||||||
newPacket.getByteArrays().write(verifyField, verifyToken);
|
newPacket.getByteArrays().write(verifyField, verifyToken);
|
||||||
|
|
||||||
//serverId is a empty string
|
//serverId is an empty string
|
||||||
ProtocolLibrary.getProtocolManager().sendServerPacket(player, newPacket);
|
ProtocolLibrary.getProtocolManager().sendServerPacket(player, newPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
verifyResponse(session);
|
verifyResponse(session);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
//this is a fake packet; it shouldn't be send to the server
|
//this is a fake packet; it shouldn't be sent to the server
|
||||||
synchronized (packetEvent.getAsyncMarker().getProcessingLock()) {
|
synchronized (packetEvent.getAsyncMarker().getProcessingLock()) {
|
||||||
packetEvent.setCancelled(true);
|
packetEvent.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
setPremiumUUID(session.getUuid());
|
setPremiumUUID(session.getUuid());
|
||||||
receiveFakeStartPacket(realUsername);
|
receiveFakeStartPacket(realUsername);
|
||||||
} else {
|
} else {
|
||||||
//user tried to fake a authentication
|
//user tried to fake an authentication
|
||||||
disconnect("invalid-session", true
|
disconnect("invalid-session", true
|
||||||
, "GameProfile {0} ({1}) tried to log in with an invalid session ServerId: {2}"
|
, "GameProfile {0} ({1}) tried to log in with an invalid session ServerId: {2}"
|
||||||
, session.getRequestUsername(), socketAddress, serverId);
|
, session.getRequestUsername(), socketAddress, serverId);
|
||||||
@ -188,7 +188,7 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
|
|
||||||
//https://github.com/bergerkiller/CraftSource/blob/master/net.minecraft.server/LoginListener.java#L182
|
//https://github.com/bergerkiller/CraftSource/blob/master/net.minecraft.server/LoginListener.java#L182
|
||||||
if (!Arrays.equals(requestVerify, EncryptionUtil.decrypt(serverKey.getPrivate(), responseVerify))) {
|
if (!Arrays.equals(requestVerify, EncryptionUtil.decrypt(serverKey.getPrivate(), responseVerify))) {
|
||||||
//check if the verify token are equal to the server sent one
|
//check if the verify-token are equal to the server sent one
|
||||||
disconnect("invalid-verify-token", true
|
disconnect("invalid-verify-token", true
|
||||||
, "GameProfile {0} ({1}) tried to login with an invalid verify token. Server: {2} Client: {3}"
|
, "GameProfile {0} ({1}) tried to login with an invalid verify token. Server: {2} Client: {3}"
|
||||||
, session.getRequestUsername(), packetEvent.getPlayer().getAddress(), requestVerify, responseVerify);
|
, session.getRequestUsername(), packetEvent.getPlayer().getAddress(), requestVerify, responseVerify);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# project data for Bukkit in order to register our plugin with all it components
|
# project data for Bukkit in order to register our plugin with all it's components
|
||||||
# ${-} are variables from Maven (pom.xml) which will be replaced after the build
|
# ${-} are variables from Maven (pom.xml) which will be replaced after the build
|
||||||
name: ${project.parent.name}
|
name: ${project.parent.name}
|
||||||
version: ${project.version}-${git.commit.id.abbrev}
|
version: ${project.version}-${git.commit.id.abbrev}
|
||||||
@ -11,11 +11,11 @@ description: |
|
|||||||
website: ${project.url}
|
website: ${project.url}
|
||||||
dev-url: ${project.url}
|
dev-url: ${project.url}
|
||||||
|
|
||||||
# This plugin don't have to be transformed for compatibility with Minecraft >= 1.13
|
# This plugin doesn't have to be transformed for compatibility with Minecraft >= 1.13
|
||||||
api-version: '1.13'
|
api-version: '1.13'
|
||||||
|
|
||||||
softdepend:
|
softdepend:
|
||||||
# We depend either ProtocolLib or ProtocolSupport
|
# We depend on either ProtocolLib or ProtocolSupport
|
||||||
- ProtocolSupport
|
- ProtocolSupport
|
||||||
- ProtocolLib
|
- ProtocolLib
|
||||||
# Premium variable
|
# Premium variable
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<!--This have to be in lowercase because it's used by plugin.yml-->
|
<!--This has to be in lowercase because it's used by plugin.yml-->
|
||||||
<artifactId>fastlogin.bungee</artifactId>
|
<artifactId>fastlogin.bungee</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
|||||||
PluginManager pluginManager = getProxy().getPluginManager();
|
PluginManager pluginManager = getProxy().getPluginManager();
|
||||||
|
|
||||||
ConnectListener connectListener = new ConnectListener(this, core.getRateLimiter());
|
ConnectListener connectListener = new ConnectListener(this, core.getRateLimiter());
|
||||||
|
|
||||||
pluginManager.registerListener(this, connectListener);
|
pluginManager.registerListener(this, connectListener);
|
||||||
pluginManager.registerListener(this, new PluginMessageListener(this));
|
pluginManager.registerListener(this, new PluginMessageListener(this));
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ public class ConnectListener implements Listener {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
plugin.getLog().error("Failed to set offline uuid of {}", username, ex);
|
plugin.getLog().error("Failed to set offline uuid of {}", username, ex);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
// throw remaining exceptions like outofmemory that we shouldn't handle ourself
|
// throw remaining exceptions like out of memory that we shouldn't handle ourselves
|
||||||
Throwables.throwIfUnchecked(throwable);
|
Throwables.throwIfUnchecked(throwable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class PluginMessageListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//the client shouldn't be able to read the messages in order to know something about server internal states
|
//the client shouldn't be able to read the messages in order to know something about server internal states
|
||||||
//moreover the client shouldn't be able fake a running premium check by sending the result message
|
//moreover the client shouldn't be able to fake a running premium check by sending the result message
|
||||||
pluginMessageEvent.setCancelled(true);
|
pluginMessageEvent.setCancelled(true);
|
||||||
|
|
||||||
if (!(pluginMessageEvent.getSender() instanceof Server)) {
|
if (!(pluginMessageEvent.getSender() instanceof Server)) {
|
||||||
|
@ -50,7 +50,7 @@ public class ForceLoginTask
|
|||||||
private final Server server;
|
private final Server server;
|
||||||
|
|
||||||
//treat player as if they had a premium account, even when they don't
|
//treat player as if they had a premium account, even when they don't
|
||||||
//used for Floodgate auto login/register
|
//use for Floodgate auto login/register
|
||||||
private final boolean forcedOnlineMode;
|
private final boolean forcedOnlineMode;
|
||||||
|
|
||||||
public ForceLoginTask(FastLoginCore<ProxiedPlayer, CommandSender, FastLoginBungee> core,
|
public ForceLoginTask(FastLoginCore<ProxiedPlayer, CommandSender, FastLoginBungee> core,
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
<version>2.0.0-alpha5</version>
|
<version>2.0.0-alpha5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- snakeyaml is present in Bungee, Spigot, Cauldron and so we could use this independent implementation -->
|
<!-- snakeyaml is present in Bungee, Spigot, Cauldron, so we could use this independent implementation -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>net.md-5</groupId>
|
||||||
<artifactId>bungeecord-config</artifactId>
|
<artifactId>bungeecord-config</artifactId>
|
||||||
@ -151,7 +151,7 @@
|
|||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<!-- Old version for velocity -->
|
<!-- Old version for velocity -->
|
||||||
<version>25.1-jre</version>
|
<version>25.1-jre</version>
|
||||||
<!-- Exclude compile time deps not marked as such on upstream -->
|
<!-- Exclude compile time dependencies not marked as such on upstream -->
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.google.code.findbugs</groupId>
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
|
@ -38,8 +38,8 @@ import org.slf4j.Logger;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This limits the number of threads that are used at maximum. Thread creation can be very heavy for the CPU and
|
* This limits the number of threads that are used at maximum. Thread creation can be very heavy for the CPU and
|
||||||
* context switching between threads too. However we need many threads for blocking HTTP and database calls.
|
* context switching between threads too. However, we need many threads for blocking HTTP and database calls.
|
||||||
* Nevertheless this number can be further limited, because the number of actually working database threads
|
* Nevertheless, this number can be further limited, because the number of actually working database threads
|
||||||
* is limited by the size of our database pool. The goal is to separate concerns into processing and blocking only
|
* is limited by the size of our database pool. The goal is to separate concerns into processing and blocking only
|
||||||
* threads.
|
* threads.
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package com.github.games647.fastlogin.core;
|
package com.github.games647.fastlogin.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Limit the number of requests with a maximum size. Each requests expires after the specified time making it available
|
* Limit the number of requests with a maximum size. Each requests expire after the specified time making it available
|
||||||
* for another request.
|
* for another request.
|
||||||
*/
|
*/
|
||||||
public class RateLimiter {
|
public class RateLimiter {
|
||||||
|
@ -72,7 +72,7 @@ public interface AuthPlugin<P> {
|
|||||||
/**
|
/**
|
||||||
* Checks whether an account exists for this player name.
|
* Checks whether an account exists for this player name.
|
||||||
*
|
*
|
||||||
* This check should check if a cracked player account exists
|
* This check should check if a cracked player account exists,
|
||||||
* so we can be sure the premium player doesn't steal the account
|
* so we can be sure the premium player doesn't steal the account
|
||||||
* of that player.
|
* of that player.
|
||||||
*
|
*
|
||||||
|
@ -49,7 +49,7 @@ public abstract class BedrockService<B> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perfrom every packet level check needed on a Bedrock player.
|
* Perform every packet level check needed on a Bedrock player.
|
||||||
*
|
*
|
||||||
* @param username the name of the player
|
* @param username the name of the player
|
||||||
* @param source an instance of LoginSource
|
* @param source an instance of LoginSource
|
||||||
@ -98,7 +98,7 @@ public abstract class BedrockService<B> {
|
|||||||
* username can be found
|
* username can be found
|
||||||
* <br>
|
* <br>
|
||||||
* <i>Falls back to non-prefixed name checks, if ProtocolLib is installed</i>
|
* <i>Falls back to non-prefixed name checks, if ProtocolLib is installed</i>
|
||||||
*
|
*
|
||||||
* @param prefixedUsername the name of the player with the prefix appended
|
* @param prefixedUsername the name of the player with the prefix appended
|
||||||
* @return Bedrock Player if found, null otherwise
|
* @return Bedrock Player if found, null otherwise
|
||||||
*/
|
*/
|
||||||
@ -120,7 +120,7 @@ public abstract class BedrockService<B> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a profile's name starts with the Floodgate prefix, if it's available
|
* Checks if a profile's name starts with the Floodgate prefix, if it's available
|
||||||
* @param profile profile of the conecting player
|
* @param profile profile of the connecting player
|
||||||
* @return true if the username is forbidden
|
* @return true if the username is forbidden
|
||||||
*/
|
*/
|
||||||
public boolean isUsernameForbidden(StoredProfile profile) {
|
public boolean isUsernameForbidden(StoredProfile profile) {
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
# You can access the newest config here:
|
# You can access the newest config here:
|
||||||
# https://github.com/games647/FastLogin/blob/main/core/src/main/resources/config.yml
|
# https://github.com/games647/FastLogin/blob/main/core/src/main/resources/config.yml
|
||||||
|
|
||||||
# This a **very** simple anti bot protection. Recommendation is to use a a dedicated program to approach this
|
# This a **very** simple anti bot protection. Recommendation is to use a dedicated program to approach this
|
||||||
# problem. Low level firewalls like uwf (or iptables direct) are more efficient than a Minecraft plugin. TCP reverse
|
# problem. Low level firewalls like uwf (or iptables direct) are more efficient than a Minecraft plugin. TCP reverse
|
||||||
# proxies could also be used and offload some work even to different host.
|
# proxies could also be used and offload some work even to different host.
|
||||||
#
|
#
|
||||||
# The settings wil limit how many connections this plugin will handle. After hitting this limit. FastLogin will
|
# The settings wil limit how many connections this plugin will handle. After hitting this limit. FastLogin will
|
||||||
# completely ignore incoming connections. Effectively there will be no database requests and network requests.
|
# completely ignore incoming connections. Effectively there will be no database requests and network requests.
|
||||||
# Therefore auto logins won't be possible.
|
# Therefore, auto logins won't be possible.
|
||||||
anti-bot:
|
anti-bot:
|
||||||
# Image the following like bucket. The following is total amount that is allowed in this bucket, while expire
|
# Image the following like bucket. The following is total amount that is allowed in this bucket, while expire
|
||||||
# means how long it takes for every entry to expire.
|
# means how long it takes for every entry to expire.
|
||||||
@ -30,7 +30,7 @@ anti-bot:
|
|||||||
# -> cracked player cannot register an account for the premium player and so cannot the steal the account
|
# -> cracked player cannot register an account for the premium player and so cannot the steal the account
|
||||||
#
|
#
|
||||||
# Furthermore the premium player check have to be made based on the player name
|
# Furthermore the premium player check have to be made based on the player name
|
||||||
# This means if a cracked player connects to the server and we request a paid account login from this player
|
# This means if a cracked player connects to the server, we request a paid account login from this player
|
||||||
# the player just disconnect and sees the message: 'bad login' or 'invalid session'
|
# the player just disconnect and sees the message: 'bad login' or 'invalid session'
|
||||||
# There is no way to change this message
|
# There is no way to change this message
|
||||||
# For more information: https://github.com/games647/FastLogin#why-do-players-have-to-invoke-a-command
|
# For more information: https://github.com/games647/FastLogin#why-do-players-have-to-invoke-a-command
|
||||||
@ -56,9 +56,9 @@ secondAttemptCracked: false
|
|||||||
# New cracked players will be kicked from server. Good if you want switch from offline-mode to online-mode without
|
# New cracked players will be kicked from server. Good if you want switch from offline-mode to online-mode without
|
||||||
# losing players!
|
# losing players!
|
||||||
#
|
#
|
||||||
# Existing cracked and premium players could still join your server. Moreover you could add playernames to a
|
# Existing cracked and premium players could still join your server. Moreover, you could add player names to an
|
||||||
# allowlist.
|
# allow-list.
|
||||||
# So that these cracked players could join too although they are new players.
|
# So that these cracked players could join too, although they are new players.
|
||||||
switchMode: false
|
switchMode: false
|
||||||
|
|
||||||
# If this plugin detected that a player has a premium, it can also set the associated
|
# If this plugin detected that a player has a premium, it can also set the associated
|
||||||
@ -66,14 +66,14 @@ switchMode: false
|
|||||||
# the same player data (inventory, permissions, ...)
|
# the same player data (inventory, permissions, ...)
|
||||||
#
|
#
|
||||||
# Warning: This also means that the UUID will be different if the player is connecting
|
# Warning: This also means that the UUID will be different if the player is connecting
|
||||||
# through a offline mode connection. This **could** cause plugin compatibility issues.
|
# through an offline mode connection. This **could** cause plugin compatibility issues.
|
||||||
#
|
#
|
||||||
# This is a example and doesn't apply for every plugin.
|
# This is an example and doesn't apply for every plugin.
|
||||||
# Example: If you want to ban players who aren't online at the moment, the ban plugin will look
|
# Example: If you want to ban players who aren't online at the moment, the ban plugin will look
|
||||||
# after a offline uuid associated to the player, because the server is in offline mode. Then the premium
|
# after an offline uuid associated to the player, because the server is in offline mode. Then the premium
|
||||||
# players could still join the server, because they have different UUID.
|
# players could still join the server, because they have different UUID.
|
||||||
#
|
#
|
||||||
# Moreover you may want to convert the offline UUID to a premium UUID. This will ensure that the player
|
# Moreover, you may want to convert the offline UUID to a premium UUID. This will ensure that the player
|
||||||
# will have the same inventory, permissions, ... if they switched to premium authentication from offline/cracked
|
# will have the same inventory, permissions, ... if they switched to premium authentication from offline/cracked
|
||||||
# authentication.
|
# authentication.
|
||||||
#
|
#
|
||||||
@ -82,7 +82,7 @@ premiumUuid: false
|
|||||||
|
|
||||||
# This will make an additional check (only for player names which are not in the database) against the mojang servers
|
# This will make an additional check (only for player names which are not in the database) against the mojang servers
|
||||||
# in order to get the premium UUID. If that premium UUID is in the database, we can assume on successful login that the
|
# in order to get the premium UUID. If that premium UUID is in the database, we can assume on successful login that the
|
||||||
# player changed it's username and we just update the name in the database.
|
# player changed its username and then update the name in the database.
|
||||||
# Examples:
|
# Examples:
|
||||||
# #### Case 1
|
# #### Case 1
|
||||||
# autoRegister = false
|
# autoRegister = false
|
||||||
@ -97,10 +97,10 @@ premiumUuid: false
|
|||||||
#
|
#
|
||||||
# Connect the Mojang API and check what UUID the player has (UUID exists => Paid Minecraft account). If that UUID is in
|
# Connect the Mojang API and check what UUID the player has (UUID exists => Paid Minecraft account). If that UUID is in
|
||||||
# the database it's an **existing player** and FastLogin can **assume** the player is premium and changed the username.
|
# the database it's an **existing player** and FastLogin can **assume** the player is premium and changed the username.
|
||||||
# If it's not in the database, it's a new player and **could be a cracked player**. So we just use a offline mode
|
# If it's not in the database, it's a new player and **could be a cracked player**. So we just use an offline mode
|
||||||
# authentication for this player.
|
# authentication for this player.
|
||||||
#
|
#
|
||||||
# **Limitation**: Cracked players who uses the new username of a paid account cannot join the server if the database
|
# **Limitation**: Cracked players who use the new username of a paid account cannot join the server if the database
|
||||||
# contains the old name. (Example: The owner of the paid account no longer plays on the server, but changed the username
|
# contains the old name. (Example: The owner of the paid account no longer plays on the server, but changed the username
|
||||||
# in the meanwhile).
|
# in the meanwhile).
|
||||||
#
|
#
|
||||||
@ -110,7 +110,7 @@ premiumUuid: false
|
|||||||
#
|
#
|
||||||
# We will always request a premium authentication if the username is unknown to us, but is in use by a paid Minecraft
|
# We will always request a premium authentication if the username is unknown to us, but is in use by a paid Minecraft
|
||||||
# account. This means it's kind of a more aggressive check like nameChangeCheck = true and autoRegister = false, because
|
# account. This means it's kind of a more aggressive check like nameChangeCheck = true and autoRegister = false, because
|
||||||
# it request a premium authentication which are completely new to us, that even the premium UUID is not in our database.
|
# it requests a premium authentication which are completely new to us, that even the premium UUID is not in our database.
|
||||||
#
|
#
|
||||||
# **Limitation**: see below
|
# **Limitation**: see below
|
||||||
#
|
#
|
||||||
@ -121,14 +121,14 @@ premiumUuid: false
|
|||||||
# Based on autoRegister it checks if the player name is premium and login using a premium authentication. After that
|
# Based on autoRegister it checks if the player name is premium and login using a premium authentication. After that
|
||||||
# fastlogin receives the premium UUID and can update the database record.
|
# fastlogin receives the premium UUID and can update the database record.
|
||||||
#
|
#
|
||||||
# **Limitation from autoRegister**: New offline players who uses the username of an existing Minecraft cannot join the
|
# **Limitation from autoRegister**: New offline players who use the username of an existing Minecraft cannot join the
|
||||||
# server.
|
# server.
|
||||||
nameChangeCheck: false
|
nameChangeCheck: false
|
||||||
|
|
||||||
# If your players have a premium account and a skin associated to their account, this plugin
|
# If your players have a premium account and a skin associated to their account, this plugin
|
||||||
# can download the data and set it to the online player.
|
# can download the data and set it to the online player.
|
||||||
#
|
#
|
||||||
# Keep in mind that this will only works if the player:
|
# Keep in mind that this will only work if the player:
|
||||||
# * is the owner of the premium account
|
# * is the owner of the premium account
|
||||||
# * the server connection is established through a premium connection (paid account authentication)
|
# * the server connection is established through a premium connection (paid account authentication)
|
||||||
# * has a skin
|
# * has a skin
|
||||||
@ -188,7 +188,7 @@ auto-register-unknown: false
|
|||||||
autoLogin: true
|
autoLogin: true
|
||||||
|
|
||||||
# Floodgate configuration
|
# Floodgate configuration
|
||||||
# Connecing through Floodgate requires player's to sign in via their Xbox Live account
|
# Connecting through Floodgate requires player's to sign in via their Xbox Live account
|
||||||
# !!!!!!!! WARNING: FLOODGATE SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!!
|
# !!!!!!!! WARNING: FLOODGATE SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!!
|
||||||
# Enabling any of these settings might lead to people gaining unauthorized access to other's accounts!
|
# Enabling any of these settings might lead to people gaining unauthorized access to other's accounts!
|
||||||
|
|
||||||
@ -212,8 +212,8 @@ autoLoginFloodgate: false
|
|||||||
# However, some plugins (such as AuthMe) rely on names instead of UUIDs to identify a player which might cause issues.
|
# However, some plugins (such as AuthMe) rely on names instead of UUIDs to identify a player which might cause issues.
|
||||||
# In the case of AuthMe (and other auth plugins), both the Java and the Bedrock player will have the same password.
|
# In the case of AuthMe (and other auth plugins), both the Java and the Bedrock player will have the same password.
|
||||||
#
|
#
|
||||||
# To prevent conflits from two different players having the same name, it is highly recommended to use a 'username-prefix'
|
# To prevent conflicts from two different players having the same name, it is highly recommended using a
|
||||||
# in floodgate/config.yml
|
# 'username-prefix' in floodgate/config.yml
|
||||||
# Note: 'username-prefix' is currently broken when used with FastLogin and ProtocolLib.
|
# Note: 'username-prefix' is currently broken when used with FastLogin and ProtocolLib.
|
||||||
# A solution to this is to enable 'floodgatePrefixWorkaround' below.
|
# A solution to this is to enable 'floodgatePrefixWorkaround' below.
|
||||||
#
|
#
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# Second line
|
# Second line
|
||||||
# Third line'
|
# Third line'
|
||||||
|
|
||||||
# If you want to disable a message, you can just set it to a empty value.
|
# If you want to disable a message, you can just set it to an empty value.
|
||||||
# In this case no message will be sent
|
# In this case no message will be sent
|
||||||
# Example:
|
# Example:
|
||||||
# bla: ''
|
# bla: ''
|
||||||
@ -55,7 +55,7 @@ auto-login: '&2Auto logged in'
|
|||||||
|
|
||||||
# FastLogin attempted to auto register user. The user account is registered to protect it from cracked players
|
# FastLogin attempted to auto register user. The user account is registered to protect it from cracked players
|
||||||
# If FastLogin is respecting auth plugin IP limit - the registration may have failed, however the message is still displayed
|
# If FastLogin is respecting auth plugin IP limit - the registration may have failed, however the message is still displayed
|
||||||
# The password can be used if the mojang servers are down and you still want your premium users to login (PLANNED)
|
# The password can be used if the mojang servers are down, and you still want your premium users to login (PLANNED)
|
||||||
auto-register: '&2Tried auto registering with password: &7%password&2. You may want change it?'
|
auto-register: '&2Tried auto registering with password: &7%password&2. You may want change it?'
|
||||||
|
|
||||||
# GameProfile is not able to toggle the premium state of other players
|
# GameProfile is not able to toggle the premium state of other players
|
||||||
@ -70,12 +70,12 @@ no-console: '&4You are not a player. You cannot toggle the premium state for YOU
|
|||||||
wait-on-proxy: '&6Sending request... (Do not forget to follow the BungeeCord setup guide)'
|
wait-on-proxy: '&6Sending request... (Do not forget to follow the BungeeCord setup guide)'
|
||||||
|
|
||||||
# When ProtocolLib is enabled and the plugin is unable to continue handling a login request after a requested premium
|
# When ProtocolLib is enabled and the plugin is unable to continue handling a login request after a requested premium
|
||||||
# authentication. In this state the client expects a success packet with a encrypted connection or disconnect packet.
|
# authentication. In this state the client expects a success packet with an encrypted connection or disconnect packet.
|
||||||
# So we kick the player, if we cannot encrypt the connection. In other situation (example: premium name check),
|
# So we kick the player, if we cannot encrypt the connection. In other situation (example: premium name check),
|
||||||
# the player will be just authenticated as cracked
|
# the player will be just authenticated as cracked
|
||||||
error-kick: '&4Error occurred'
|
error-kick: '&4Error occurred'
|
||||||
|
|
||||||
# The server sends a verify token within the premium authentication request. If this doesn't match on response,
|
# The server sends a verify-token within the premium authentication request. If this doesn't match on response,
|
||||||
# it could be another client sending malicious packets
|
# it could be another client sending malicious packets
|
||||||
invalid-verify-token: '&4Invalid token'
|
invalid-verify-token: '&4Invalid token'
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class RateLimiterTest {
|
|||||||
* Too many requests
|
* Too many requests
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void shoudBlock() {
|
public void shouldBlock() {
|
||||||
int size = 3;
|
int size = 3;
|
||||||
|
|
||||||
// fill the size
|
// fill the size
|
||||||
|
6
pom.xml
6
pom.xml
@ -30,7 +30,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.github.games647</groupId>
|
<groupId>com.github.games647</groupId>
|
||||||
<!--This have to be in lowercase because it's used by plugin.yml-->
|
<!--This has to be in lowercase because it's used by plugin.yml-->
|
||||||
<artifactId>fastlogin</artifactId>
|
<artifactId>fastlogin</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
|
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
|
||||||
<description>
|
<description>
|
||||||
Automatically login premium (paid accounts) player on a offline mode server
|
Automatically login premium (paid accounts) player on an offline mode server
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -105,7 +105,7 @@
|
|||||||
<licenseSets>
|
<licenseSets>
|
||||||
<licenseSet>
|
<licenseSet>
|
||||||
<multi>
|
<multi>
|
||||||
<!-- Machine readable representation -->
|
<!-- Machine-readable representation -->
|
||||||
<preamble>SPDX-License-Identifier: MIT</preamble>
|
<preamble>SPDX-License-Identifier: MIT</preamble>
|
||||||
<header>LICENSE</header>
|
<header>LICENSE</header>
|
||||||
</multi>
|
</multi>
|
||||||
|
Reference in New Issue
Block a user