Sending Player Teleport Packets desyncs location between client and server
Issue description
My gun plugin uses teleport packets to change players' yaw and pitch to do recoil. This causes AAC5 to print "
Code being used to handle recoil:
public void doPhysicalRecoil(Player player, float yawOffset, float pitchOffset) {
if (yawOffset == 0 || pitchOffset == 0) return;
EntityPlayer nms = ((CraftPlayer) player).getHandle();
nms.yaw += yawOffset;
nms.pitch -= pitchOffset;
PacketPlayOutPosition packetPlayOutPosition = new PacketPlayOutPosition(0.0D, 0.0D, 0.0D, yawOffset, -pitchOffset, this.TELEPORT_FLAGS);
nms.playerConnection.sendPacket(packetPlayOutPosition);
}
Video of issue: https://streamable.com/dds4q1
Core information
Server version: Paper 1.8.8
AAC version: 5.0.6
ProtocolLib version: 4.5.1
Plugin list:
Special environment information
ViaVersion version: 3.2.1
ProtocolSupport version: N/A
ViaBackwards version: N/A
BungeeCord plugins: None Relevant
Configuration
Celebrimbor's optimized config in video but the same exact issue persists on default config
Can the teleport detection thing be changed to work with exemptions for time being so we can just exempt players while shooting? We wanna deploy AAC5 asap because we're having a lot of issues with hackers but have no way to atm.
Try using this overload of sendServerPacket to send teleport packets via protocollib without touching AAC's teleport handler
https://ci.dmulloy2.net/job/ProtocolLib/javadoc/com/comphenix/protocol/ProtocolManager.html#sendServerPacket(org.bukkit.entity.Player,com.comphenix.protocol.events.PacketContainer,boolean)
(with an exemption added)
(that means the second parameter should be set to false)
@konsolas this still happen when I move to protocollib, and give player an extemtion my code: https://pastebin.com/q4SHvZrN
@amadeusmz Why the exemtpion does not work: The exemption is not honored because it is removed just after sending the packet. you'd have to wait with removing the exemption until the player sent his reaction on the teleport packet.
@Janmm14 which packet I have to listen? Why are events not in AAC5? Using exemption that way is risky and players can exploit easily.
@konsolas please fix this bug or give an acceptable solution ASAP. I closed my server to update it to 1.16.5, jobs have been done for weeks but I can't open my server because of this bug. I understand you feel uncomfortable as people are tagging you this much, but please think about my situation.
@konsolas Please fix the bug. It is 7 months long, you know!? 7 months for a bug? Not only us but also many people else need it, too!