diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/server/rcon/thread/RconClient.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/server/rcon/thread/RconClient.java.patch | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/server/rcon/thread/RconClient.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/server/rcon/thread/RconClient.java.patch new file mode 100644 index 0000000000..61ad71d139 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/server/rcon/thread/RconClient.java.patch @@ -0,0 +1,83 @@ +--- a/net/minecraft/server/rcon/thread/RconClient.java ++++ b/net/minecraft/server/rcon/thread/RconClient.java +@@ -9,6 +10,8 @@ + import java.nio.charset.StandardCharsets; + import java.util.Locale; + import net.minecraft.server.ServerInterface; ++// CraftBukkit start ++import net.minecraft.server.dedicated.DedicatedServer; + import net.minecraft.server.rcon.PktUtils; + import org.slf4j.Logger; + +@@ -23,11 +27,14 @@ + private final Socket client; + private final byte[] buf = new byte[1460]; + private final String rconPassword; +- private final ServerInterface serverInterface; ++ // CraftBukkit start ++ private final DedicatedServer serverInterface; ++ private final RconConsoleSource rconConsoleSource; ++ // CraftBukkit end + + RconClient(ServerInterface serverInterface, String rconPassword, Socket client) { + super("RCON Client " + client.getInetAddress()); +- this.serverInterface = serverInterface; ++ this.serverInterface = (DedicatedServer) serverInterface; // CraftBukkit + this.client = client; + + try { +@@ -37,18 +44,17 @@ + } + + this.rconPassword = rconPassword; ++ this.rconConsoleSource = new net.minecraft.server.rcon.RconConsoleSource(this.serverInterface, client.getRemoteSocketAddress()); // CraftBukkit + } + + @Override + public void run() { + try { +- try { +- while (this.running) { +- BufferedInputStream bufferedInputStream = new BufferedInputStream(this.client.getInputStream()); +- int i = bufferedInputStream.read(this.buf, 0, 1460); +- if (10 > i) { +- return; +- } ++ while (true) { ++ // CraftBukkit end ++ if (!this.running) { ++ return; ++ } + + int i1 = 0; + int i2 = PktUtils.intFromByteArray(this.buf, 0, i); +@@ -67,9 +80,9 @@ + String string1 = PktUtils.stringFromByteArray(this.buf, var21, i); + + try { +- this.sendCmdResponse(i3, this.serverInterface.runCommand(string1)); +- } catch (Exception var15) { +- this.sendCmdResponse(i3, "Error executing: " + string1 + " (" + var15.getMessage() + ")"); ++ this.sendCmdResponse(l, this.serverInterface.runCommand(this.rconConsoleSource, s)); // CraftBukkit ++ } catch (Exception exception) { ++ this.sendCmdResponse(l, "Error executing: " + s + " (" + exception.getMessage() + ")"); + } + break; + } +@@ -98,11 +118,11 @@ + } catch (Exception var17) { + LOGGER.error("Exception whilst parsing RCON input", (Throwable)var17); + } +- } finally { +- this.closeSocket(); +- LOGGER.info("Thread {} shutting down", this.name); +- this.running = false; +- } ++ ++ // CraftBukkit start - decompile error: switch try / while statement ++ // return; ++ // } ++ // CraftBukkit end + } + + private void send(int id, int i, String message) throws IOException { |