From b1b35fe025f745f73051027bbd12399973890b33 Mon Sep 17 00:00:00 2001 From: Myles Date: Fri, 18 Mar 2016 21:59:13 +0000 Subject: [PATCH 1/2] Bump version --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 52c286fe0..434339da3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ViaVersion 0.6.5 +# ViaVersion 0.6.6 [![Build Status](https://travis-ci.org/MylesIsCool/ViaVersion.svg?branch=master)](https://travis-ci.org/MylesIsCool/ViaVersion) **Allows the connection of 1.9 clients to 1.8** diff --git a/pom.xml b/pom.xml index 518a2e605..dc4cbd873 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ us.myles viaversion - 0.6.6-SNAPSHOT + 0.6.7-SNAPSHOT jar ViaVersion From 704c876772078a29c5ba7aae2e7c529957f576aa Mon Sep 17 00:00:00 2001 From: Myles Date: Sat, 19 Mar 2016 20:45:07 +0000 Subject: [PATCH 2/2] One line of code can make holes in the world, one line can fix them. (Fixes packet mem leak, also adds useful secret displayleaks command :) ) --- .../myles/ViaVersion/commands/ViaVersionCommand.java | 10 +++++++++- .../us/myles/ViaVersion/handlers/ViaDecodeHandler.java | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java b/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java index 43b29f2a1..0605f548f 100644 --- a/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java +++ b/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java @@ -1,5 +1,6 @@ package us.myles.ViaVersion.commands; +import io.netty.util.ResourceLeakDetector; import lombok.RequiredArgsConstructor; import org.bukkit.Bukkit; import org.bukkit.command.Command; @@ -42,6 +43,13 @@ public class ViaVersionCommand implements CommandExecutor { } else if (args[0].equalsIgnoreCase("debug")) { plugin.setDebug(!plugin.isDebug()); sender.sendMessage(color("&6Debug mode is now " + (plugin.isDebug() ? "&aenabled" : "&cdisabled"))); + } else if (args[0].equalsIgnoreCase("displayleaks")) { + if (ResourceLeakDetector.getLevel() != ResourceLeakDetector.Level.ADVANCED) { + ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.ADVANCED); + } else { + ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); + } + sender.sendMessage(color("&6Leak detector is now " + (ResourceLeakDetector.getLevel() == ResourceLeakDetector.Level.ADVANCED ? "&aenabled" : "&cdisabled"))); } else if (args[0].equalsIgnoreCase("dontbugme")) { boolean newValue = !plugin.getConfig().getBoolean("checkforupdates", true); plugin.getConfig().set("checkforupdates", newValue); @@ -62,7 +70,7 @@ public class ViaVersionCommand implements CommandExecutor { return false; } - public void sendHelp(CommandSender sender){ + public void sendHelp(CommandSender sender) { sender.sendMessage(color("&aViaVersion &c" + ViaVersion.getInstance().getVersion())); sender.sendMessage(color("&6Commands:")); sender.sendMessage(color("&2/viaversion list &7- &6Shows lists of all 1.9 clients and 1.8 clients.")); diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java b/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java index 0082c4201..c4483c2d2 100644 --- a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java +++ b/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java @@ -47,6 +47,8 @@ public class ViaDecodeHandler extends ByteToMessageDecoder { if (e.getCause() instanceof Exception) { throw (Exception) e.getCause(); } + } finally { + bytebuf.release(); } } }