Cleanup patches

This commit is contained in:
linsaftw 2021-05-01 00:28:00 -03:00
parent f2671f0f5d
commit ebe244c9ec
2 changed files with 26 additions and 37 deletions

View File

@ -1,4 +1,4 @@
From a60eb8a4096cfa24f46b4747774218fdb36751f0 Mon Sep 17 00:00:00 2001
From 805001ea20a26c3bcff5c81828685cf77b010758 Mon Sep 17 00:00:00 2001
From: Juan Cruz Linsalata <LinsaFTW@users.noreply.github.com>
Date: Mon, 12 Oct 2020 15:40:53 -0300
Subject: [PATCH] FlameCord General Patch
@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord General Patch
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java
new file mode 100644
index 00000000..8957c79a
index 000000000..8957c79ac
--- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java
@@ -0,0 +1,42 @@
@ -55,7 +55,7 @@ index 00000000..8957c79a
\ No newline at end of file
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java
new file mode 100644
index 00000000..650cb302
index 000000000..650cb3028
--- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java
@@ -0,0 +1,72 @@
@ -133,7 +133,7 @@ index 00000000..650cb302
+}
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
new file mode 100644
index 00000000..ebfaa761
index 000000000..ebfaa761c
--- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
@@ -0,0 +1,121 @@
@ -261,7 +261,7 @@ index 00000000..ebfaa761
\ No newline at end of file
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java
new file mode 100644
index 00000000..e82c4844
index 000000000..e82c4844b
--- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java
@@ -0,0 +1,94 @@
@ -360,7 +360,7 @@ index 00000000..e82c4844
+ }
+}
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
index bb39d31b..3318b1de 100644
index bb39d31b8..3318b1de3 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
@@ -1,5 +1,6 @@
@ -383,7 +383,7 @@ index bb39d31b..3318b1de 100644
if ( slice != null )
diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
new file mode 100644
index 00000000..bf6f8538
index 000000000..bf6f85386
--- /dev/null
+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
@@ -0,0 +1,61 @@
@ -449,7 +449,7 @@ index 00000000..bf6f8538
+ }
+}
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
index 5d385706..83d3e9ed 100644
index 5d3857060..83d3e9edd 100644
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
@@ -9,6 +9,10 @@ import com.google.common.collect.Sets;
@ -601,7 +601,7 @@ index 5d385706..83d3e9ed 100644
+ }
}
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index 7b99c466..2c94ef55 100644
index 7b99c466d..2c94ef554 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -1,6 +1,8 @@
@ -632,7 +632,7 @@ index 7b99c466..2c94ef55 100644
}
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 159119c1..7c4c8f8a 100644
index 159119c13..7c4c8f8a0 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration;
@ -666,7 +666,7 @@ index 159119c1..7c4c8f8a 100644
b.connect().addListener( listener );
}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
index e7542b1c..18bab507 100644
index e7542b1c1..18bab507a 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
@@ -16,6 +16,8 @@ import java.util.logging.Level;
@ -697,7 +697,7 @@ index e7542b1c..18bab507 100644
}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java
index 6cd71071..24195ed1 100644
index 6cd71071e..24195ed1b 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java
@@ -1,6 +1,8 @@
@ -728,7 +728,7 @@ index 6cd71071..24195ed1 100644
}
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
index b8e50855..f0b25b53 100644
index b8e508552..7f18b5646 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
@@ -1,6 +1,8 @@
@ -740,18 +740,8 @@ index b8e50855..f0b25b53 100644
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.CorruptedFrameException;
@@ -138,6 +140,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
{
boolean logExceptions = !( handler instanceof PingHandler );
+ // FlameCord - Use flamecord
+ final FlameCord flameCord = FlameCord.getInstance();
+
if ( logExceptions )
{
if ( cause instanceof ReadTimeoutException )
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
index 4996a7b4..1d86aa63 100644
index 4996a7b44..1d86aa63c 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
@@ -1,6 +1,8 @@

View File

@ -1,11 +1,11 @@
From ca9f27058c584094c899099636c5459df82b7290 Mon Sep 17 00:00:00 2001
From a9337cf77d233e0f7429c899ffd374c9d8b73641 Mon Sep 17 00:00:00 2001
From: linsaftw <25271111+linsaftw@users.noreply.github.com>
Date: Fri, 30 Apr 2021 22:54:44 -0300
Subject: [PATCH] Firewall System
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java
index 8957c79a..fd889644 100644
index 8957c79ac..fd889644f 100644
--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java
@@ -6,6 +6,7 @@ import java.util.logging.Logger;
@ -64,7 +64,7 @@ index 8957c79a..fd889644 100644
}
\ No newline at end of file
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java
index 650cb302..b7268e1d 100644
index 650cb3028..b7268e1d3 100644
--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java
@@ -13,7 +13,12 @@ import net.md_5.bungee.config.ConfigurationProvider;
@ -93,7 +93,7 @@ index 650cb302..b7268e1d 100644
if (!configurationExists) {
configurationProvider.save(configuration, configurationFile);
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
index ebfaa761..c88077ad 100644
index ebfaa761c..c88077ade 100644
--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
@@ -82,9 +82,17 @@ public class MessagesConfiguration {
@ -117,7 +117,7 @@ index ebfaa761..c88077ad 100644
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java
new file mode 100644
index 00000000..6a661898
index 000000000..6a661898d
--- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java
@@ -0,0 +1,30 @@
@ -154,7 +154,7 @@ index 00000000..6a661898
\ No newline at end of file
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java
new file mode 100644
index 00000000..8a474758
index 000000000..8a4747588
--- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java
@@ -0,0 +1,116 @@
@ -276,7 +276,7 @@ index 00000000..8a474758
+}
\ No newline at end of file
diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
index bf6f8538..fa0b59c2 100644
index bf6f85386..fa0b59c27 100644
--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
@@ -5,6 +5,7 @@ import java.util.HashSet;
@ -304,7 +304,7 @@ index bf6f8538..fa0b59c2 100644
// FlameCord - Collect ips from servers
final Collection<String> whitelistedAddresses = new HashSet<>();
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
index f0b25b53..5de0414e 100644
index 7f18b5646..5de0414ec 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
@@ -3,6 +3,7 @@ package net.md_5.bungee.netty;
@ -323,12 +323,10 @@ index f0b25b53..5de0414e 100644
import java.util.logging.Level;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.connection.CancelSendSignal;
@@ -140,8 +142,22 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
@@ -140,6 +142,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
{
boolean logExceptions = !( handler instanceof PingHandler );
- // FlameCord - Use flamecord
- final FlameCord flameCord = FlameCord.getInstance();
+ // FlameCord - Don't log firewall exceptions
+ logExceptions = cause instanceof FirewallException ? false : logExceptions;
+
@ -345,11 +343,12 @@ index f0b25b53..5de0414e 100644
+ if (cause instanceof FirewallException) {
+ FlameCord.getInstance().getFirewallManager().logBlocked(ctx.channel().remoteAddress());
+ }
+
if ( logExceptions )
{
if ( cause instanceof ReadTimeoutException )
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
index 1d86aa63..81987ca3 100644
index 1d86aa63c..81987ca39 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
@@ -3,6 +3,7 @@ package net.md_5.bungee.netty;