Typo fixes

This commit is contained in:
games647
2022-01-14 12:12:05 +01:00
parent b02a1a54d9
commit 35b493a708
25 changed files with 76 additions and 77 deletions

View File

@ -36,7 +36,7 @@
<relativePath>../pom.xml</relativePath>
</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>
<packaging>jar</packaging>

View File

@ -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
*
* @return the verify token from the server
* @return verify token from the server
*/
public synchronized byte[] getVerifyToken() {
return verifyToken.clone();

View File

@ -91,7 +91,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
core.load();
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");
setEnabled(false);
return;
@ -218,22 +218,22 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
return loginSession;
}
public BukkitLoginSession getSession(InetSocketAddress addr) {
String id = getSessionId(addr);
public BukkitLoginSession getSession(InetSocketAddress address) {
String id = getSessionId(address);
return loginSession.get(id);
}
public String getSessionId(InetSocketAddress addr) {
return addr.getAddress().getHostAddress() + ':' + addr.getPort();
public String getSessionId(InetSocketAddress address) {
return address.getAddress().getHostAddress() + ':' + address.getPort();
}
public void putSession(InetSocketAddress addr, BukkitLoginSession session) {
String id = getSessionId(addr);
public void putSession(InetSocketAddress address, BukkitLoginSession session) {
String id = getSessionId(address);
loginSession.put(id, session);
}
public void removeSession(InetSocketAddress addr) {
String id = getSessionId(addr);
public void removeSession(InetSocketAddress address) {
String id = getSessionId(address);
loginSession.remove(id);
}

View File

@ -121,7 +121,7 @@ public class CrazyLoginHook implements AuthPlugin<Player> {
public boolean forceRegister(Player player, String password) {
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());
if (playerData == null) {
//create a fake account - this will be saved to the database with the password=FAILEDLOADING

View File

@ -128,7 +128,7 @@ public class BungeeListener implements PluginMessageListener {
session.setVerified(true);
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);
plugin.getLog().info("Delaying force login until join event fired?: {}", result);
if (result) {

View File

@ -43,7 +43,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
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.
*/
public class ConnectionListener implements Listener {

View File

@ -55,7 +55,7 @@ public class EncryptionUtil {
}
/**
* Generate a RSA key pair
* Generate an RSA key pair
*
* @return The RSA key pair.
*/

View File

@ -83,7 +83,7 @@ class ProtocolLibLoginSource implements LoginSource {
newPacket.getByteArrays().write(verifyField, verifyToken);
//serverId is a empty string
//serverId is an empty string
ProtocolLibrary.getProtocolManager().sendServerPacket(player, newPacket);
}

View File

@ -101,7 +101,7 @@ public class VerifyResponseTask implements Runnable {
verifyResponse(session);
}
} 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()) {
packetEvent.setCancelled(true);
}
@ -159,7 +159,7 @@ public class VerifyResponseTask implements Runnable {
setPremiumUUID(session.getUuid());
receiveFakeStartPacket(realUsername);
} else {
//user tried to fake a authentication
//user tried to fake an authentication
disconnect("invalid-session", true
, "GameProfile {0} ({1}) tried to log in with an invalid session ServerId: {2}"
, 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
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
, "GameProfile {0} ({1}) tried to login with an invalid verify token. Server: {2} Client: {3}"
, session.getRequestUsername(), packetEvent.getPlayer().getAddress(), requestVerify, responseVerify);

View File

@ -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
name: ${project.parent.name}
version: ${project.version}-${git.commit.id.abbrev}
@ -11,11 +11,11 @@ description: |
website: ${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'
softdepend:
# We depend either ProtocolLib or ProtocolSupport
# We depend on either ProtocolLib or ProtocolSupport
- ProtocolSupport
- ProtocolLib
# Premium variable

View File

@ -36,7 +36,7 @@
<relativePath>../pom.xml</relativePath>
</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>
<packaging>jar</packaging>

View File

@ -102,7 +102,6 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
PluginManager pluginManager = getProxy().getPluginManager();
ConnectListener connectListener = new ConnectListener(this, core.getRateLimiter());
pluginManager.registerListener(this, connectListener);
pluginManager.registerListener(this, new PluginMessageListener(this));

View File

@ -174,7 +174,7 @@ public class ConnectListener implements Listener {
} catch (Exception ex) {
plugin.getLog().error("Failed to set offline uuid of {}", username, ex);
} 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);
}
}

View File

@ -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
//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);
if (!(pluginMessageEvent.getSender() instanceof Server)) {

View File

@ -50,7 +50,7 @@ public class ForceLoginTask
private final Server server;
//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;
public ForceLoginTask(FastLoginCore<ProxiedPlayer, CommandSender, FastLoginBungee> core,

View File

@ -85,7 +85,7 @@
<version>2.0.0-alpha5</version>
</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>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-config</artifactId>
@ -151,7 +151,7 @@
<artifactId>guava</artifactId>
<!-- Old version for velocity -->
<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>
<exclusion>
<groupId>com.google.code.findbugs</groupId>

View File

@ -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
* 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
* 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
* is limited by the size of our database pool. The goal is to separate concerns into processing and blocking only
* threads.
*/

View File

@ -26,7 +26,7 @@
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.
*/
public class RateLimiter {

View File

@ -72,7 +72,7 @@ public interface AuthPlugin<P> {
/**
* 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
* of that player.
*

View File

@ -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 source an instance of LoginSource
@ -120,7 +120,7 @@ public abstract class BedrockService<B> {
/**
* 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
*/
public boolean isUsernameForbidden(StoredProfile profile) {

View File

@ -5,13 +5,13 @@
# You can access the newest config here:
# 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
# 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
# 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:
# 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.
@ -30,7 +30,7 @@ anti-bot:
# -> 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
# 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'
# There is no way to change this message
# 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
# losing players!
#
# Existing cracked and premium players could still join your server. Moreover you could add playernames to a
# allowlist.
# So that these cracked players could join too although they are new players.
# Existing cracked and premium players could still join your server. Moreover, you could add player names to an
# allow-list.
# So that these cracked players could join too, although they are new players.
switchMode: false
# 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, ...)
#
# 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
# 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.
#
# 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
# 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
# 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:
# #### Case 1
# 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
# 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.
#
# **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
# 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
# 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
#
@ -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
# 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.
nameChangeCheck: false
# 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.
#
# 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
# * the server connection is established through a premium connection (paid account authentication)
# * has a skin
@ -188,7 +188,7 @@ auto-register-unknown: false
autoLogin: true
# 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 !!!!!!!!
# 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.
# 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'
# in floodgate/config.yml
# To prevent conflicts from two different players having the same name, it is highly recommended using a
# 'username-prefix' in floodgate/config.yml
# Note: 'username-prefix' is currently broken when used with FastLogin and ProtocolLib.
# A solution to this is to enable 'floodgatePrefixWorkaround' below.
#

View File

@ -14,7 +14,7 @@
# Second 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
# Example:
# 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
# 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?'
# 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)'
# 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),
# the player will be just authenticated as cracked
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
invalid-verify-token: '&4Invalid token'

View File

@ -59,7 +59,7 @@ public class RateLimiterTest {
* Too many requests
*/
@Test
public void shoudBlock() {
public void shouldBlock() {
int size = 3;
// fill the size

View File

@ -30,7 +30,7 @@
<modelVersion>4.0.0</modelVersion>
<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>
<packaging>pom</packaging>
@ -39,7 +39,7 @@
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
<description>
Automatically login premium (paid accounts) player on a offline mode server
Automatically login premium (paid accounts) player on an offline mode server
</description>
<properties>
@ -105,7 +105,7 @@
<licenseSets>
<licenseSet>
<multi>
<!-- Machine readable representation -->
<!-- Machine-readable representation -->
<preamble>SPDX-License-Identifier: MIT</preamble>
<header>LICENSE</header>
</multi>