geforkt von SteamWar/BungeeCore
Add debug messages for fabric checks
Dieser Commit ist enthalten in:
Ursprung
27750d4e71
Commit
3d57f9ca80
@ -59,7 +59,7 @@ public class Fabric extends BasicListener {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (System.currentTimeMillis() - entry.getValue() > TimeUnit.SECONDS.toMillis(20)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ public class Fabric extends BasicListener {
|
|||||||
if (!Storage.fabricCheckedPlayers.containsKey(player)) {
|
if (!Storage.fabricCheckedPlayers.containsKey(player)) {
|
||||||
synchronized (Storage.fabricExpectPluginMessage) {
|
synchronized (Storage.fabricExpectPluginMessage) {
|
||||||
if (Storage.fabricExpectPluginMessage.containsKey(player)) {
|
if (Storage.fabricExpectPluginMessage.containsKey(player)) {
|
||||||
banPlayer(user, player);
|
banPlayer(user, player, "Was not fabric checked but send message nonetheless");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ public class Fabric extends BasicListener {
|
|||||||
Utils.VarInt varInt = Utils.readVarInt(data,0);
|
Utils.VarInt varInt = Utils.readVarInt(data,0);
|
||||||
|
|
||||||
if(data.length != varInt.length + varInt.value) {
|
if(data.length != varInt.length + varInt.value) {
|
||||||
banPlayer(user,player);
|
banPlayer(user,player, "Invalid message length");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public class Fabric extends BasicListener {
|
|||||||
try{
|
try{
|
||||||
dataString = new String(data, StandardCharsets.UTF_8);
|
dataString = new String(data, StandardCharsets.UTF_8);
|
||||||
}catch (UnsupportedCharsetException exception) {
|
}catch (UnsupportedCharsetException exception) {
|
||||||
banPlayer(user, player);
|
banPlayer(user, player, "Unsupported charset");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ public class Fabric extends BasicListener {
|
|||||||
try {
|
try {
|
||||||
array = new JsonParser().parse(dataString).getAsJsonArray();
|
array = new JsonParser().parse(dataString).getAsJsonArray();
|
||||||
}catch (JsonSyntaxException exception) {
|
}catch (JsonSyntaxException exception) {
|
||||||
banPlayer(user, player);
|
banPlayer(user, player, "Invalid json");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,12 +126,12 @@ public class Fabric extends BasicListener {
|
|||||||
boolean isSorted = isSortedAlphabetically(mods);
|
boolean isSorted = isSortedAlphabetically(mods);
|
||||||
|
|
||||||
if(!isSorted) {
|
if(!isSorted) {
|
||||||
banPlayer(user, player);
|
banPlayer(user, player, "Mods are not sorted alphabetically");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!neededModsContained(mods)) {
|
if(!neededModsContained(mods)) {
|
||||||
banPlayer(user, player);
|
banPlayer(user, player, "Needed mods are not contained");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ public class Fabric extends BasicListener {
|
|||||||
if (Storage.fabricCheckedPlayers.containsKey(player)) {
|
if (Storage.fabricCheckedPlayers.containsKey(player)) {
|
||||||
long current = Storage.fabricCheckedPlayers.get(player);
|
long current = Storage.fabricCheckedPlayers.get(player);
|
||||||
if (current != dataString.hashCode()) {
|
if (current != dataString.hashCode()) {
|
||||||
banPlayer(user, player);
|
banPlayer(user, player, "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -176,11 +176,11 @@ public class Fabric extends BasicListener {
|
|||||||
.count() == neededMods.size();
|
.count() == neededMods.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void banPlayer(SteamwarUser user, ProxiedPlayer player) {
|
public void banPlayer(SteamwarUser user, ProxiedPlayer player, String reason) {
|
||||||
user.punishPerma(Punishment.PunishmentType.Ban,
|
user.punishPerma(Punishment.PunishmentType.Ban,
|
||||||
Message.parse("MODIFICATION_BAN_MESSAGE", player, user.getUserName(), user.getId()),
|
Message.parse("MODIFICATION_BAN_MESSAGE", player, user.getUserName(), user.getId()),
|
||||||
0);
|
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) {
|
public static void remove(ProxiedPlayer player) {
|
||||||
|
@ -615,7 +615,7 @@ RANK_NEEDED_FIGHTS_LEFT={0} §8(§e{1}§7 fights needed§8)
|
|||||||
|
|
||||||
#Fabric Mod Sender
|
#Fabric Mod Sender
|
||||||
MODIFICATION_BAN_MESSAGE=You tried to bypass / modify the FabricModSender!
|
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!
|
MODIFICATION_CHECK_SUCCESS=§eYour mods have been checked and you are now allowed to join arenas!
|
||||||
|
|
||||||
#Arena Merging
|
#Arena Merging
|
||||||
|
@ -595,7 +595,7 @@ RANK_NEEDED_FIGHTS_LEFT={0} §8(§7noch §e{1}§7 Kämpfe nötig§8)
|
|||||||
|
|
||||||
#Fabric Mod Sender
|
#Fabric Mod Sender
|
||||||
MODIFICATION_BAN_MESSAGE=Du hast probiert den FabricModSender zu umgehen / zu modifizieren!
|
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!
|
MODIFICATION_CHECK_SUCCESS=§eDeine Mods wurden geprüft und du darfst nun auf Arenen joinen!
|
||||||
|
|
||||||
#Arena Merging
|
#Arena Merging
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren