Compare commits

...

6 Commits

Author SHA1 Message Date
Thorben 86c33c78cb
Merge e4502f3bc2 into e20fec199f 2024-04-27 15:21:24 +08:00
Shane Freeder e20fec199f
Updated Upstream (BungeeCord)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
336333ac #3665: Small improvements to TranslatableComponent
d110f662 #3669: Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.2 to 3.5.3
2024-04-25 21:00:45 +01:00
Thorben e4502f3bc2
Update 0067-Added-ProxyInitializeEvent.patch
Co-authored-by: Janmm14 <Janmm14@users.noreply.github.com>
2023-12-16 16:22:31 +01:00
thsassmann 9793edf2b1 Renamed ProxyInitializeEvent 2023-12-12 18:01:58 +01:00
thsassmann b1178d0e14 Added ProxyReadyEvent 2023-12-10 14:34:13 +01:00
thsassmann 2c62f12815 Added ProxyReadyEvent 2023-12-10 14:11:47 +01:00
2 changed files with 81 additions and 1 deletions

@ -1 +1 @@
Subproject commit 6f70b15e2ea7f01e9d8690e56d476cfcfc68ef2c
Subproject commit 336333acb1e6140556271545c71f784083559dcc

View File

@ -0,0 +1,80 @@
From 434ea68cc47b1b044c12ab15ed1385b8f0d45317 Mon Sep 17 00:00:00 2001
From: thsassmann <thorben@sassmann.nrw>
Date: Sun, 10 Dec 2023 14:10:21 +0100
Subject: [PATCH] Added ProxyInitializeEvent
diff --git a/api/src/main/java/io/github/waterfallmc/waterfall/event/ProxyInitializeEvent.java b/api/src/main/java/io/github/waterfallmc/waterfall/event/ProxyInitializeEvent.java
new file mode 100644
index 00000000..a1af4806
--- /dev/null
+++ b/api/src/main/java/io/github/waterfallmc/waterfall/event/ProxyInitializeEvent.java
@@ -0,0 +1,37 @@
+package io.github.waterfallmc.waterfall.event;
+
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import net.md_5.bungee.api.plugin.Event;
+
+/**
+ * This event is posted when the proxy has completed the startup procedure.<br>
+ * Even if the event is posted, the proxy may be <b>NOT</b> able to accept any connections.<br>
+ * See the {@link ProxyInitializeEvent#isSuccess} method for the actual state.
+ */
+@Data
+@ToString(callSuper = false)
+@EqualsAndHashCode(callSuper = false)
+public class ProxyInitializeEvent extends Event {
+
+ private final boolean isSuccess;
+
+ /**
+ * Constructor
+ * @param isSuccess Is Proxy listening?
+ */
+ public ProxyInitializeEvent(boolean isSuccess) {
+ super();
+ this.isSuccess = isSuccess;
+ }
+
+ /**
+ * Returns if the startup is a success or not.
+ * @return {@code true} if the Proxy is ready.
+ */
+ public boolean isSuccess() {
+ return isSuccess;
+ }
+}
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 01c8a172..abf5d0c8 100644
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
@@ -11,6 +11,7 @@ import com.google.gson.GsonBuilder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration;
import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent;
+import io.github.waterfallmc.waterfall.event.ProxyInitializeEvent;
import io.github.waterfallmc.waterfall.exception.ProxyPluginEnableDisableException;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
@@ -23,7 +24,6 @@ import io.netty.util.ResourceLeakDetector;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
-import java.io.PrintStream;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.charset.StandardCharsets;
@@ -347,6 +347,7 @@ public class BungeeCord extends ProxyServer
@Override
public void operationComplete(ChannelFuture future) throws Exception
{
+ getPluginManager().callEvent(new ProxyInitializeEvent(future.isSuccess()));
if ( future.isSuccess() )
{
listeners.add( future.channel() );
--
2.43.0