Archiviert
1
0

Add debug messages for fabric checks

Dieser Commit ist enthalten in:
yoyosource 2022-06-12 18:17:06 +02:00
Ursprung 27750d4e71
Commit 3d57f9ca80
3 geänderte Dateien mit 12 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -59,7 +59,7 @@ public class Fabric extends BasicListener {
continue;
}
if (System.currentTimeMillis() - entry.getValue() > TimeUnit.SECONDS.toMillis(20)) {
banPlayer(SteamwarUser.get(entry.getKey()), entry.getKey());
banPlayer(SteamwarUser.get(entry.getKey()), entry.getKey(), "Expected message not received");
return;
}
}
@ -82,7 +82,7 @@ public class Fabric extends BasicListener {
if (!Storage.fabricCheckedPlayers.containsKey(player)) {
synchronized (Storage.fabricExpectPluginMessage) {
if (Storage.fabricExpectPluginMessage.containsKey(player)) {
banPlayer(user, player);
banPlayer(user, player, "Was not fabric checked but send message nonetheless");
return;
}
}
@ -95,7 +95,7 @@ public class Fabric extends BasicListener {
Utils.VarInt varInt = Utils.readVarInt(data,0);
if(data.length != varInt.length + varInt.value) {
banPlayer(user,player);
banPlayer(user,player, "Invalid message length");
return;
}
@ -106,7 +106,7 @@ public class Fabric extends BasicListener {
try{
dataString = new String(data, StandardCharsets.UTF_8);
}catch (UnsupportedCharsetException exception) {
banPlayer(user, player);
banPlayer(user, player, "Unsupported charset");
return;
}
@ -115,7 +115,7 @@ public class Fabric extends BasicListener {
try {
array = new JsonParser().parse(dataString).getAsJsonArray();
}catch (JsonSyntaxException exception) {
banPlayer(user, player);
banPlayer(user, player, "Invalid json");
return;
}
@ -126,12 +126,12 @@ public class Fabric extends BasicListener {
boolean isSorted = isSortedAlphabetically(mods);
if(!isSorted) {
banPlayer(user, player);
banPlayer(user, player, "Mods are not sorted alphabetically");
return;
}
if(!neededModsContained(mods)) {
banPlayer(user, player);
banPlayer(user, player, "Needed mods are not contained");
return;
}
@ -139,7 +139,7 @@ public class Fabric extends BasicListener {
if (Storage.fabricCheckedPlayers.containsKey(player)) {
long current = Storage.fabricCheckedPlayers.get(player);
if (current != dataString.hashCode()) {
banPlayer(user, player);
banPlayer(user, player, "");
return;
}
} else {
@ -176,11 +176,11 @@ public class Fabric extends BasicListener {
.count() == neededMods.size();
}
public void banPlayer(SteamwarUser user, ProxiedPlayer player) {
public void banPlayer(SteamwarUser user, ProxiedPlayer player, String reason) {
user.punishPerma(Punishment.PunishmentType.Ban,
Message.parse("MODIFICATION_BAN_MESSAGE", player, user.getUserName(), user.getId()),
0);
BungeeCore.log(Level.SEVERE,Message.parse("MODIFICATION_BAN_LOG", player, user.getUserName()));
BungeeCore.log(Level.SEVERE,Message.parse("MODIFICATION_BAN_LOG", player, user.getUserName(), reason));
}
public static void remove(ProxiedPlayer player) {

Datei anzeigen

@ -615,7 +615,7 @@ RANK_NEEDED_FIGHTS_LEFT={0} §8(§e{1}§7 fights needed§8)
#Fabric Mod Sender
MODIFICATION_BAN_MESSAGE=You tried to bypass / modify the FabricModSender!
MODIFICATION_BAN_LOG={0} has tried to edit / bypass the FabricModSender!
MODIFICATION_BAN_LOG={0} has tried to edit / bypass the FabricModSender! Reason: {1}
MODIFICATION_CHECK_SUCCESS=§eYour mods have been checked and you are now allowed to join arenas!
#Arena Merging

Datei anzeigen

@ -595,7 +595,7 @@ RANK_NEEDED_FIGHTS_LEFT={0} §8(§7noch §e{1}§7 Kämpfe nötig§8)
#Fabric Mod Sender
MODIFICATION_BAN_MESSAGE=Du hast probiert den FabricModSender zu umgehen / zu modifizieren!
MODIFICATION_BAN_LOG={0} hat probiert den Fabric Mod Sender zu editieren / umzugehen!
MODIFICATION_BAN_LOG={0} hat probiert den Fabric Mod Sender zu editieren / umzugehen! Grund: {1}
MODIFICATION_CHECK_SUCCESS=§eDeine Mods wurden geprüft und du darfst nun auf Arenen joinen!
#Arena Merging