Skip to content

Conversation

@mzl310
Copy link

@mzl310 mzl310 commented Jan 13, 2026

Lag mode
It has some bugs
@1zun4 required me to use PacketQueueManager, but after I used it, my lag mode caused post vl on grimac

@mzl310 mzl310 closed this Jan 13, 2026
@master7720
Copy link

why close?

@mzl310 mzl310 reopened this Jan 13, 2026
@mzl310
Copy link
Author

mzl310 commented Jan 13, 2026

2026-01-13.13-58-15.mp4

@1zun4
Copy link
Member

1zun4 commented Jan 13, 2026

Thank you. I will look into it soon.

@1zun4 1zun4 self-requested a review January 13, 2026 12:31
@mzl310
Copy link
Author

mzl310 commented Jan 14, 2026

Finally I found the reason of the grim post vl problem: the client tick isn't synchronized with the packet tick(the packet tick is slower than the client tick)
The previous code uses tickHandler, and it causes the premature sending of packets. If we send the interact packet after that before sending the next ping packet, we will be flagged by grim
I gress so

private val packetHandler = handler<PacketEvent> { event ->
val packet = event.packet

if (packet is ClientboundSetEntityMotionPacket && packet.id == player.id){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (packet is ClientboundSetEntityMotionPacket && packet.id == player.id){
if (packet is ClientboundSetEntityMotionPacket && packet.id == player.id) {


@Suppress("unused")
private val queuePacketHandler = handler<QueuePacketEvent>{ event ->
if (!isLagging || event.origin != TransferOrigin.INCOMING || event.packet is ClientboundKeepAlivePacket){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!isLagging || event.origin != TransferOrigin.INCOMING || event.packet is ClientboundKeepAlivePacket){
if (!isLagging || event.origin != TransferOrigin.INCOMING || event.packet is ClientboundKeepAlivePacket) {


@Suppress("unused")
private val tickPacketProcessHandler = handler<TickPacketProcessEvent> {
if (isLagging){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (isLagging){
if (isLagging) {

private val tickPacketProcessHandler = handler<TickPacketProcessEvent> {
if (isLagging){
lagTicks--
if (lagTicks == 0){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (lagTicks == 0){
if (lagTicks == 0) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants