Compare commits

..

No commits in common. "6c1699b2c59459d6c2467dc86e5e0817f4377cb7" and "5d995022e732de1779a90621e42dd03b82a783e5" have entirely different histories.

6 changed files with 13 additions and 17 deletions

View File

@ -18,10 +18,14 @@ public class Messages {
1. Mojang / Microsoft api is down\040\040\040\040\040\040\040\040\040
2. Disconnecting when connection to a server faster!
3. Using cracked minecraft (if you are using cracked Minecraft please reconnect!
&6If this a mistake and you own a Minecraft account\040
&cPlease connect to &a&lreset.limework.net\040\040
&2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m""".replace("&", "§");
public final static String RESET_MESSAGE = """
&2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m &2&m
&6- &a&lGovindas Limework&6 -
&aOffline mode has been disabled &l
&cNow try reconnecting to server now!
@ -33,6 +37,9 @@ public class Messages {
&c&l============================
&c&oYou have been found using Offline Minecraft (Cracked)
&cIf this a mistake and you own a Minecraft account\s
&ePlease disconnect from the server and connect to
&eIP: p.limework.net
&c&l============================
""".replace("&", "§");

View File

@ -5,8 +5,6 @@ public interface Configuration {
char getCrackedChar();
String getCrackedCharString();
char getBedrockChar();
boolean doReplaceSpacesWithUnderscore();
boolean useTheContainMethod();

View File

@ -1,6 +1,5 @@
{
"default-cracked-char": "-",
"bedrock-char": "*",
"replace-spaces-with-underscore": true,
"use-the-contain-method": false,
"simple-anti-bot": {

View File

@ -44,7 +44,7 @@
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -13,7 +13,6 @@ import java.util.concurrent.TimeUnit;
public class ConfigLoader implements Configuration {
private final char crackedChar;
private final char bedrockChar;
private final boolean replaceSpacesWithUnderscore;
private final boolean useTheContainMethod;
private final AntiBot antiBot;
@ -22,7 +21,6 @@ public class ConfigLoader implements Configuration {
public ConfigLoader(File file) throws FileNotFoundException {
JsonObject jsonObject = JsonParser.parseReader(new FileReader(file)).getAsJsonObject();
this.crackedChar = (jsonObject.get("default-cracked-char").getAsString().charAt(0));
this.bedrockChar = (jsonObject.get("bedrock-char").getAsString().charAt(0));
this.replaceSpacesWithUnderscore = jsonObject.get("replace-spaces-with-underscore").getAsBoolean();
this.useTheContainMethod = jsonObject.get("use-the-contain-method").getAsBoolean();
JsonObject antiBotJson = jsonObject.getAsJsonObject("simple-anti-bot");
@ -40,11 +38,6 @@ public class ConfigLoader implements Configuration {
return String.valueOf(this.crackedChar);
}
@Override
public char getBedrockChar() {
return this.bedrockChar;
}
@Override
public boolean doReplaceSpacesWithUnderscore() {
return this.replaceSpacesWithUnderscore;
@ -64,5 +57,4 @@ public class ConfigLoader implements Configuration {
public String getOnlineModeDomain() {
return this.onlineModeDomain;
}
}

View File

@ -1,5 +1,7 @@
package net.limework.gal;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.inject.Inject;
import com.velocitypowered.api.event.PostOrder;
import com.velocitypowered.api.event.Subscribe;
@ -21,8 +23,10 @@ import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import static net.limework.gal.utils.PlayerUUIDUtils.*;
@ -75,12 +79,8 @@ public class VelocityGalPlugin {
}
}
@Subscribe(order = PostOrder.LAST)
@Subscribe
public void onGameProfileRequestEvent(GameProfileRequestEvent event) {
if (event.getGameProfile().getName().charAt(0) == config.getBedrockChar()) {
return;
}
if (!event.isOnlineMode()) {
logger.info("handling " + event.getUsername());
String username = getCorrectCrackedUsername(event.getUsername(), config);