mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-21 11:35:16 +01:00
Update ViaVersion, try to fix UserConnection#sendRawPacket
This commit is contained in:
parent
53be441e01
commit
2f0ea9d55e
@ -36,7 +36,7 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
shade ('us.myles:viaversion:1.4.1') { transitive = false }
|
shade ('us.myles:viaversion:1.4.2-SNAPSHOT') { transitive = false }
|
||||||
implementation 'org.dimdev:mixin:0.7.11-SNAPSHOT'
|
implementation 'org.dimdev:mixin:0.7.11-SNAPSHOT'
|
||||||
compile 'org.dimdev.rift:Rift:1.0.1:dev'
|
compile 'org.dimdev.rift:Rift:1.0.1:dev'
|
||||||
}
|
}
|
||||||
|
@ -37,17 +37,19 @@ public class VRInHandler extends ByteToMessageDecoder {
|
|||||||
// Transform
|
// Transform
|
||||||
ByteBuf newPacket = msg.alloc().buffer();
|
ByteBuf newPacket = msg.alloc().buffer();
|
||||||
|
|
||||||
try {
|
if (id != PacketWrapper.PASSTHROUGH_ID) {
|
||||||
PacketWrapper wrapper = new PacketWrapper(id, msg, user);
|
try {
|
||||||
ProtocolInfo protInfo = user.get(ProtocolInfo.class);
|
PacketWrapper wrapper = new PacketWrapper(id, msg, user);
|
||||||
protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper);
|
ProtocolInfo protInfo = user.get(ProtocolInfo.class);
|
||||||
wrapper.writeToBuffer(newPacket);
|
protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper);
|
||||||
msg = newPacket;
|
wrapper.writeToBuffer(newPacket);
|
||||||
} catch (Exception e) {
|
msg = newPacket;
|
||||||
if (!(e instanceof CancelException))
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
if (!(e instanceof CancelException))
|
||||||
msg.clear();
|
e.printStackTrace();
|
||||||
throw e;
|
msg.clear();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import io.netty.channel.socket.SocketChannel;
|
|||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
|
import us.myles.ViaVersion.util.PipelineUtil;
|
||||||
|
|
||||||
|
|
||||||
public class VRUserConnection extends UserConnection {
|
public class VRUserConnection extends UserConnection {
|
||||||
@ -28,14 +29,14 @@ public class VRUserConnection extends UserConnection {
|
|||||||
final Channel channel = this.getChannel();
|
final Channel channel = this.getChannel();
|
||||||
if (currentThread) {
|
if (currentThread) {
|
||||||
try {
|
try {
|
||||||
channel.pipeline().context("decoder").fireChannelRead(copy);
|
PipelineUtil.getContextBefore("decoder", channel.pipeline()).fireChannelRead(copy);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
channel.eventLoop().submit(() -> {
|
channel.eventLoop().submit(() -> {
|
||||||
try {
|
try {
|
||||||
channel.pipeline().context("decoder").fireChannelRead(copy);
|
PipelineUtil.getContextBefore("decoder", channel.pipeline()).fireChannelRead(copy);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -55,7 +56,7 @@ public class VRUserConnection extends UserConnection {
|
|||||||
packet.release();
|
packet.release();
|
||||||
final Channel channel = this.getChannel();
|
final Channel channel = this.getChannel();
|
||||||
try {
|
try {
|
||||||
channel.pipeline().context("decoder").fireChannelRead(copy);
|
PipelineUtil.getContextBefore("decoder", channel.pipeline()).fireChannelRead(copy);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user