Compare commits

...

2 Commits

Author SHA1 Message Date
6c1699b2c5
fix broken history / geyser support 2023-03-18 20:10:43 +04:00
a58191a961
glomc fork 2023-01-14 12:42:08 +04:00
6 changed files with 17 additions and 13 deletions

View File

@ -18,14 +18,10 @@ 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!
@ -37,9 +33,6 @@ 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,6 +5,8 @@ public interface Configuration {
char getCrackedChar();
String getCrackedCharString();
char getBedrockChar();
boolean doReplaceSpacesWithUnderscore();
boolean useTheContainMethod();

View File

@ -1,5 +1,6 @@
{
"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.1.0</version>
<version>3.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -13,6 +13,7 @@ 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;
@ -21,6 +22,7 @@ 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");
@ -38,6 +40,11 @@ public class ConfigLoader implements Configuration {
return String.valueOf(this.crackedChar);
}
@Override
public char getBedrockChar() {
return this.bedrockChar;
}
@Override
public boolean doReplaceSpacesWithUnderscore() {
return this.replaceSpacesWithUnderscore;
@ -57,4 +64,5 @@ public class ConfigLoader implements Configuration {
public String getOnlineModeDomain() {
return this.onlineModeDomain;
}
}

View File

@ -1,7 +1,5 @@
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;
@ -23,10 +21,8 @@ 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.*;
@ -79,8 +75,12 @@ public class VelocityGalPlugin {
}
}
@Subscribe
@Subscribe(order = PostOrder.LAST)
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);