Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Commit
5e34fda7e4
10
ISSUE_TEMPLATE.md
Normale Datei
10
ISSUE_TEMPLATE.md
Normale Datei
@ -0,0 +1,10 @@
|
|||||||
|
### What version of ViaVersion are you using? Type /ver viaversion
|
||||||
|
|
||||||
|
### What version of Spigot are you using? Type /ver
|
||||||
|
|
||||||
|
### What plugins are you using? /plugins
|
||||||
|
|
||||||
|
### How does this error happen? login? using an item?
|
||||||
|
|
||||||
|
### Is there an error in the console? Use pastebin.com. Is there a kick message?
|
||||||
|
|
@ -34,10 +34,16 @@ Contributors:
|
|||||||
**Paulomart**
|
**Paulomart**
|
||||||
**gigosaurus**
|
**gigosaurus**
|
||||||
|
|
||||||
|
**Chat: ** https://gitter.im/MylesIsCool/ViaVersion
|
||||||
|
|
||||||
|
We use it to collaborate and solve errors, sign in with github.
|
||||||
|
|
||||||
License:
|
License:
|
||||||
--------
|
--------
|
||||||
|
|
||||||
You may modify this work, all rights are still owned by myself excluding any files in the spacebase package as they belong to the respected contributors. Please credit the original author (myself) when forking etc. (or if it helped you understand the new protocol or netty!)
|
You may modify this work, all rights are still owned by myself excluding any files in the spacebase package as they belong to the respected contributors. Please credit the original author (myself) when forking etc. (or if it helped you understand the new protocol or netty!)
|
||||||
|
|
||||||
|
|
||||||
Thanks!
|
Thanks!
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import us.myles.ViaVersion.ConnectionInfo;
|
|||||||
import us.myles.ViaVersion.transformers.IncomingTransformer;
|
import us.myles.ViaVersion.transformers.IncomingTransformer;
|
||||||
import us.myles.ViaVersion.util.PacketUtil;
|
import us.myles.ViaVersion.util.PacketUtil;
|
||||||
|
|
||||||
import java.nio.channels.ClosedChannelException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ViaDecodeHandler extends ByteToMessageDecoder {
|
public class ViaDecodeHandler extends ByteToMessageDecoder {
|
||||||
@ -45,15 +44,10 @@ public class ViaDecodeHandler extends ByteToMessageDecoder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
if (!(cause.getCause().getCause() instanceof CancelException)
|
if (!(cause.getCause().getCause() instanceof CancelException)) {
|
||||||
&& !(cause.getCause().getCause() instanceof ClosedChannelException)) {
|
if (!(cause.getCause() instanceof CancelException)) {
|
||||||
if (!(cause.getCause() instanceof CancelException)
|
if (!(cause instanceof CancelException)) {
|
||||||
&& !(cause.getCause() instanceof ClosedChannelException)) {
|
super.exceptionCaught(ctx, cause);
|
||||||
if (!(cause instanceof CancelException)
|
|
||||||
&& !(cause instanceof ClosedChannelException)) {
|
|
||||||
if (cause instanceof Exception){
|
|
||||||
cause.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,14 +72,10 @@ public class ViaEncodeHandler extends MessageToByteEncoder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
if (!(cause.getCause().getCause() instanceof CancelException)
|
if (!(cause.getCause().getCause() instanceof CancelException)) {
|
||||||
&& !(cause.getCause().getCause() instanceof ClosedChannelException)) {
|
if (!(cause.getCause() instanceof CancelException)) {
|
||||||
if (!(cause.getCause() instanceof CancelException)
|
if (!(cause instanceof CancelException)) {
|
||||||
&& !(cause.getCause() instanceof ClosedChannelException)) {
|
super.exceptionCaught(ctx, cause);
|
||||||
if (!(cause instanceof CancelException)
|
|
||||||
&& !(cause instanceof ClosedChannelException)) {
|
|
||||||
if (cause instanceof Exception)
|
|
||||||
cause.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,14 @@ package us.myles.ViaVersion.transformers;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.json.simple.parser.JSONParser;
|
||||||
import org.spacehq.mc.protocol.data.game.chunk.Column;
|
import org.spacehq.mc.protocol.data.game.chunk.Column;
|
||||||
import org.spacehq.mc.protocol.util.NetUtil;
|
import org.spacehq.mc.protocol.util.NetUtil;
|
||||||
|
|
||||||
import us.myles.ViaVersion.CancelException;
|
import us.myles.ViaVersion.CancelException;
|
||||||
import us.myles.ViaVersion.ConnectionInfo;
|
import us.myles.ViaVersion.ConnectionInfo;
|
||||||
import us.myles.ViaVersion.ViaVersionPlugin;
|
import us.myles.ViaVersion.ViaVersionPlugin;
|
||||||
@ -492,6 +496,13 @@ public class OutgoingTransformer {
|
|||||||
if (line.startsWith("\""))
|
if (line.startsWith("\""))
|
||||||
line = "{\"text\":" + line + "}";
|
line = "{\"text\":" + line + "}";
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
new JSONParser().parse(line);
|
||||||
|
}
|
||||||
|
catch (org.json.simple.parser.ParseException e) {
|
||||||
|
System.out.println("Invalid JSON String: \"" + line + "\" Please report this issue to the ViaVersion Github!");
|
||||||
|
return "{\"text\":\"\"}";
|
||||||
|
}
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren