Skip to content

Commit

Permalink
fix: send velocity syncproxy tab only while in PLAY state (#1469)
Browse files Browse the repository at this point in the history
SyncProxy velocity currently sends tab updates even when the players are
in CONFIGURATION state, causing them to disconnect

Updated velocity to 3.3.0-SNAPSHOT (from 3.1.1) to get access to new API
Added if to velocity SyncProxyManagement to only send tab updates to
players in PLAY state

Player doesn't get kicked after reentering configuration and syncproxy
sending a tab update

Fixes #1467
  • Loading branch information
DasBabyPixel authored and derklaro committed Aug 7, 2024
1 parent 7b5cd2d commit 701875f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ logback = "1.5.6"

# platform api versions
sponge = "9.0.0"
velocity = "3.1.1"
velocity = "3.3.0-SNAPSHOT"
waterdogpe = "1.2.4"
nukkitX = "1.0-SNAPSHOT"
minestom = "d5c6126a6b"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package eu.cloudnetservice.modules.syncproxy.platform.velocity;

import com.velocitypowered.api.network.ProtocolState;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer;
import eu.cloudnetservice.driver.event.EventManager;
Expand Down Expand Up @@ -87,6 +88,11 @@ public void registerService(@NonNull ServiceRegistry registry) {

@Override
public void playerTabList(@NonNull Player player, @Nullable String header, @Nullable String footer) {
if (player.getProtocolState() != ProtocolState.PLAY) {
// prevent tab list updates if player is in an invalid state. Issue #1467
return;
}

if (header == null || footer == null) {
player.getTabList().clearHeaderAndFooter();
} else {
Expand Down

0 comments on commit 701875f

Please sign in to comment.