Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
a27f74af56
Commit
4217afef59
@ -56,19 +56,15 @@ public class ChatListener extends BasicListener {
|
|||||||
ProxiedPlayer player = (ProxiedPlayer) e.getSender();
|
ProxiedPlayer player = (ProxiedPlayer) e.getSender();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
|
|
||||||
if (message.contains("jndi:ldap")) {
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
||||||
|
if (message.contains("jndi:ldap")) {
|
||||||
SteamwarUser.get(player).punishPerma(Punishment.PunishmentType.Ban, "Versuchte Exploit-Ausnutzung", 0);
|
SteamwarUser.get(player).punishPerma(Punishment.PunishmentType.Ban, "Versuchte Exploit-Ausnutzung", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = sanitize7(message);
|
if (isCommand(player, message))
|
||||||
|
return;
|
||||||
if (message.startsWith("/")) {
|
|
||||||
if(filteredCommand((CommandSender) e.getSender(), message))
|
|
||||||
e.setCancelled(true);
|
|
||||||
} else {
|
|
||||||
e.setCancelled(true);
|
|
||||||
|
|
||||||
Subserver subserver = Subserver.getSubserver(player);
|
Subserver subserver = Subserver.getSubserver(player);
|
||||||
if(subserver != null && subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo()) {
|
if(subserver != null && subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo()) {
|
||||||
@ -79,6 +75,22 @@ public class ChatListener extends BasicListener {
|
|||||||
sendChat(ChatSender.of(player), ChatSender.globalReceivers(), "CHAT_GLOBAL", null, message);
|
sendChat(ChatSender.of(player), ChatSender.globalReceivers(), "CHAT_GLOBAL", null, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isCommand(ProxiedPlayer player, String message) {
|
||||||
|
String command = message.substring(1);
|
||||||
|
boolean isCommand = message.startsWith("/") || (message.startsWith("7") && command.split(" ", 2)[0].matches("[7/]?[A-Za-z]+"));
|
||||||
|
if(isCommand && !ProxyServer.getInstance().getPluginManager().dispatchCommand(player, command)) {
|
||||||
|
if(command.startsWith("7"))
|
||||||
|
command = "/" + command.substring(1);
|
||||||
|
message = "/" + command;
|
||||||
|
|
||||||
|
if(filteredCommand(player, message))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
Chat19.chat(player, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return isCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendChat(ChatSender sender, Stream<ChatSender> receivers, String format, ChatSender msgReceiver, String message) {
|
public static void sendChat(ChatSender sender, Stream<ChatSender> receivers, String format, ChatSender msgReceiver, String message) {
|
||||||
@ -114,8 +126,6 @@ public class ChatListener extends BasicListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = sanitize7(message);
|
|
||||||
|
|
||||||
if(ChatListener.filteredCommand(player, message))
|
if(ChatListener.filteredCommand(player, message))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -167,17 +177,6 @@ public class ChatListener extends BasicListener {
|
|||||||
group.getChatColorCode()));
|
group.getChatColorCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String sanitize7(String message) {
|
|
||||||
String begin = message.split(" ", 2)[0];
|
|
||||||
if(begin.startsWith("7") && begin.substring(1).matches("[A-Za-z]+")){
|
|
||||||
message = "/" + message.substring(1);
|
|
||||||
}else if((begin.startsWith("77") || begin.startsWith("7/") || begin.startsWith("/7")) && begin.substring(2).matches("[A-Za-z]+")){
|
|
||||||
message = "//" + message.substring(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean filteredCommand(CommandSender sender, String message) {
|
private static boolean filteredCommand(CommandSender sender, String message) {
|
||||||
String command = message.split(" ", 2)[0];
|
String command = message.split(" ", 2)[0];
|
||||||
if(command.startsWith("/") && command.contains(":")) {
|
if(command.startsWith("/") && command.contains(":")) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren