QuiltMC / quilt-standard-libraries

A set of libraries to assist in making Quilt mods.
Apache License 2.0
152 stars 85 forks source link

Check if the current task is correct before finishing it when receiving `minecraft:register` packet #364

Closed deirn closed 6 months ago

deirn commented 7 months ago

It is possible to send minecraft:register packet in a other task than SendChannelsTask, but every time the server receives it it tries to finish that task, this makes it disconnect. https://github.com/QuiltMC/quilt-standard-libraries/blob/e95b44020498e61ad7175f303814549405b6868b/library/core/networking/src/main/java/org/quiltmc/qsl/networking/impl/server/ServerConfigurationNetworkAddon.java#L80-L88

The one that finishes the task on pong packet is checked as intended. https://github.com/QuiltMC/quilt-standard-libraries/blob/e95b44020498e61ad7175f303814549405b6868b/library/core/networking/src/main/java/org/quiltmc/qsl/networking/mixin/AbstractServerPacketHandlerMixin.java#L59-L66

Changing the first one to also check for instance should fix the issue.

OroArmor commented 7 months ago

Ah, thank you! For some reason, I totally forgot about that case. Should be a fairly easy fix!