Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
177e9b7f4e | ||
|
|
4711ede9bc | ||
|
|
6bd531efc0 | ||
|
|
d6f1bf972e | ||
|
|
3295b1fc89 | ||
|
|
f620e45a9c | ||
|
|
825b61a24e | ||
|
|
dc5d15ba85 |
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a bug to help us fix
|
||||
title: "[BUG REPORT]"
|
||||
about: Report bugs to help us improve our software.
|
||||
title: ""
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
@@ -10,11 +10,21 @@ assignees: ''
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
**Software brand**
|
||||
Please let us know what software you are using.
|
||||
Eg. Spigot 1.18.2, Paper 1.18.2, Tuinity 1.18.2, Pufferfish 1.18.2, etc...
|
||||
Make sure to mention the version of the software.
|
||||
|
||||
**Plugins**
|
||||
Please give us a list of your plugins. Sometimes we run into incompatibilities. Having an overview of the plugins on your server can really help identify the problem quicker.
|
||||
Eg. ViaVersion, ProtocolLib, HolographicDisplays
|
||||
You may also provide a screenshot.
|
||||
|
||||
**How To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
*Example:*
|
||||
1. Login on the 1.16.4 minecraft client.
|
||||
2. Join the server while it is still starting up.
|
||||
1. Join with the 1.18.2 vanilla minecraft client.
|
||||
2. Spam
|
||||
3. ....
|
||||
4. See error
|
||||
|
||||
@@ -24,18 +34,5 @@ A clear and concise description of what you expected to happen.
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**About your server (please complete the following information):**
|
||||
- Spigot: [eg. Paper or Tuinity]
|
||||
We only accept reports that are reproducible
|
||||
on one of the supported spigots.
|
||||
|
||||
- Server Version: [eg. 1.16.4]
|
||||
Feel free to report bugs for versions newer than 1.7.10, even if we
|
||||
don’t support them yet, but be aware that we might have already
|
||||
found the bug and fixed it in a dev build, just before you reported it.
|
||||
Please don’t get frustrated in such cases.
|
||||
|
||||
- Plugins List if possible: [eg. ViaVersion, ProtocolLib, HolographicDisplays]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
+1
-1
@@ -66,7 +66,7 @@ dependencies {
|
||||
}
|
||||
|
||||
group = 'io.github.retrooper'
|
||||
version = '1.8.1'
|
||||
version = '1.8.3'
|
||||
description = 'packetevents'
|
||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
public final class PacketEvents implements Listener, EventManager {
|
||||
private static PacketEvents instance;
|
||||
private static Plugin plugin;
|
||||
private final PEVersion version = new PEVersion(1, 8, 1);
|
||||
private final PEVersion version = new PEVersion(1, 8, 3);
|
||||
private final EventManager eventManager = new PEEventManager();
|
||||
private final PlayerUtils playerUtils = new PlayerUtils();
|
||||
private final ServerUtils serverUtils = new ServerUtils();
|
||||
|
||||
+1
-3
@@ -25,7 +25,6 @@ import io.github.retrooper.packetevents.packetwrappers.NMSPacket;
|
||||
import io.github.retrooper.packetevents.packetwrappers.WrappedPacket;
|
||||
import io.github.retrooper.packetevents.utils.list.ListWrapper;
|
||||
import io.github.retrooper.packetevents.utils.nms.NMSUtils;
|
||||
import io.netty.channel.epoll.EpollSocketChannel;
|
||||
import net.minecraft.util.io.netty.channel.Channel;
|
||||
import net.minecraft.util.io.netty.channel.ChannelFuture;
|
||||
import net.minecraft.util.io.netty.channel.ChannelHandler;
|
||||
@@ -130,8 +129,7 @@ public class EarlyChannelInjectorLegacy implements EarlyInjector {
|
||||
WrappedPacket networkManagerWrapper = new WrappedPacket(new NMSPacket(networkManager), NMSUtils.networkManagerClass);
|
||||
Channel channel = (Channel) networkManagerWrapper.readObject(0, NMSUtils.nettyChannelClass);
|
||||
if (channel == null ||
|
||||
(!(channel.getClass().equals(NioSocketChannel.class))) &&
|
||||
!(channel.getClass().equals(EpollSocketChannel.class))) {
|
||||
(!channel.getClass().equals(NioSocketChannel.class))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -21,7 +21,6 @@ package io.github.retrooper.packetevents.injector.legacy.early;
|
||||
import io.github.retrooper.packetevents.PacketEvents;
|
||||
import io.github.retrooper.packetevents.injector.legacy.PlayerChannelHandlerLegacy;
|
||||
import io.github.retrooper.packetevents.utils.reflection.Reflection;
|
||||
import io.netty.channel.epoll.EpollSocketChannel;
|
||||
import net.minecraft.util.io.netty.channel.Channel;
|
||||
import net.minecraft.util.io.netty.channel.ChannelInitializer;
|
||||
import net.minecraft.util.io.netty.channel.socket.nio.NioSocketChannel;
|
||||
@@ -49,8 +48,7 @@ public class PEChannelInitializerLegacy extends ChannelInitializer<Channel> {
|
||||
protected void initChannel(Channel channel) throws Exception {
|
||||
initChannelMethod.invoke(oldChannelInitializer, channel);
|
||||
PlayerChannelHandlerLegacy channelHandler = new PlayerChannelHandlerLegacy();
|
||||
if (channel.getClass().equals(NioSocketChannel.class)
|
||||
|| channel.getClass().equals(EpollSocketChannel.class)) {
|
||||
if (channel.getClass().equals(NioSocketChannel.class)) {
|
||||
if (channel.pipeline().get("packet_handler") != null) {
|
||||
String handlerName = PacketEvents.get().getHandlerName();
|
||||
if (channel.pipeline().get(handlerName) != null) {
|
||||
|
||||
+1
-3
@@ -21,7 +21,6 @@ package io.github.retrooper.packetevents.injector.legacy.late;
|
||||
import io.github.retrooper.packetevents.PacketEvents;
|
||||
import io.github.retrooper.packetevents.injector.LateInjector;
|
||||
import io.github.retrooper.packetevents.injector.legacy.PlayerChannelHandlerLegacy;
|
||||
import io.netty.channel.epoll.EpollSocketChannel;
|
||||
import net.minecraft.util.io.netty.channel.Channel;
|
||||
import net.minecraft.util.io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -42,8 +41,7 @@ public class LateChannelInjectorLegacy implements LateInjector {
|
||||
PlayerChannelHandlerLegacy playerChannelHandlerLegacy = new PlayerChannelHandlerLegacy();
|
||||
playerChannelHandlerLegacy.player = player;
|
||||
Channel channel = (Channel) PacketEvents.get().getPlayerUtils().getChannel(player);
|
||||
if (channel.getClass().equals(NioSocketChannel.class)
|
||||
|| channel.getClass().equals(EpollSocketChannel.class)) {
|
||||
if (channel.getClass().equals(NioSocketChannel.class)) {
|
||||
channel.pipeline().addBefore("packet_handler", PacketEvents.get().getHandlerName(), playerChannelHandlerLegacy);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -39,12 +39,13 @@ public class PEChannelInitializerModern extends ChannelInitializer<Channel> {
|
||||
|
||||
public static void postInitChannel(Channel channel) {
|
||||
if (channel.getClass().equals(NioSocketChannel.class)
|
||||
|| channel.getClass().equals(EpollSocketChannel.class)) {
|
||||
|| channel.getClass().equals(EpollSocketChannel.class)) {
|
||||
PlayerChannelHandlerModern channelHandler = new PlayerChannelHandlerModern();
|
||||
if (channel.pipeline().get("packet_handler") != null) {
|
||||
String handlerName = PacketEvents.get().getHandlerName();
|
||||
if (channel.pipeline().get(handlerName) != null) {
|
||||
PacketEvents.get().getPlugin().getLogger().warning("[PacketEvents] Attempted to initialize a channel twice!");
|
||||
//Just ignore this to support latest ProtocolLib snapshots.
|
||||
//PacketEvents.get().getPlugin().getLogger().warning("[PacketEvents] Attempted to initialize a channel twice!");
|
||||
} else {
|
||||
channel.pipeline().addBefore("packet_handler", handlerName, channelHandler);
|
||||
}
|
||||
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.github.retrooper.packetevents.injector.modern.early;
|
||||
|
||||
import io.github.retrooper.packetevents.PacketEvents;
|
||||
import io.netty.channel.Channel;
|
||||
import net.kyori.adventure.key.Key;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
public class PaperChannelInjector {
|
||||
public static final boolean PAPER_INJECTION_METHOD = hasPaperInjectionMethod();
|
||||
|
||||
private PaperChannelInjector() {
|
||||
}
|
||||
|
||||
public static void setPaperChannelInitializeListener() throws ReflectiveOperationException {
|
||||
// Call io.papermc.paper.network.ChannelInitializeListenerHolder.addListener(net.kyori.adventure.key.Key, io.papermc.paper.network.ChannelInitializeListener)
|
||||
// Create an interface proxy of ChannelInitializeListener
|
||||
Class<?> listenerClass = Class.forName("io.papermc.paper.network.ChannelInitializeListener");
|
||||
Object channelInitializeListener = Proxy.newProxyInstance(EarlyChannelInjectorModern.class.getClassLoader(), new Class[]{listenerClass}, (proxy, method, args) -> {
|
||||
if (method.getName().equals("afterInitChannel")) {
|
||||
PEChannelInitializerModern.postInitChannel((Channel) args[0]);
|
||||
return null;
|
||||
}
|
||||
return method.invoke(proxy, args);
|
||||
});
|
||||
|
||||
Class<?> holderClass = Class.forName("io.papermc.paper.network.ChannelInitializeListenerHolder");
|
||||
Method addListenerMethod = holderClass.getDeclaredMethod("addListener", Key.class, listenerClass);
|
||||
Key key = Key.key(PacketEvents.get().getHandlerName().toLowerCase(), "injector");
|
||||
addListenerMethod.invoke(null, key, channelInitializeListener);
|
||||
}
|
||||
|
||||
public static void removePaperChannelInitializeListener() throws ReflectiveOperationException {
|
||||
Class<?> holderClass = Class.forName("io.papermc.paper.network.ChannelInitializeListenerHolder");
|
||||
Method addListenerMethod = holderClass.getDeclaredMethod("removeListener", Key.class);
|
||||
Key key = Key.key(PacketEvents.get().getHandlerName().toLowerCase(), "injector");
|
||||
addListenerMethod.invoke(null, key);
|
||||
}
|
||||
|
||||
private static boolean hasPaperInjectionMethod() {
|
||||
try {
|
||||
Class.forName("io.papermc.paper.network.ChannelInitializeListener");
|
||||
return true;
|
||||
} catch (ReflectiveOperationException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
name: packetevents
|
||||
version: 1.8.1
|
||||
version: 1.8.3
|
||||
main: io.github.retrooper.packetevents.PacketEventsPlugin
|
||||
author: retrooper
|
||||
softdepend:
|
||||
|
||||
Reference in new issue
Block a user