fix(pafvelocity): only unlock the player after the connection request is processed

This commit is contained in:
HappyAreaBean 2024-07-02 00:51:20 +08:00
parent 7b7c1d6cb5
commit b676aacbf2
No known key found for this signature in database
GPG Key ID: A027DED558B69688

View File

@ -29,8 +29,11 @@ public class PBServerConnector implements ServerConnector {
@Override
public void connect(Player player, RegisteredServer registeredServer) {
PlayerLocker.lock(player);
player.createConnectionRequest(registeredServer).fireAndForget();
PlayerLocker.unlock(player);
player.createConnectionRequest(registeredServer)
.connectWithIndication()
.whenComplete((result, throwable) -> {
PlayerLocker.unlock(player);
});
}
}