13
0
geforkt von Mirrors/Velocity

Changes 1.16-pre4 and Logic fixes

Dieser Commit ist enthalten in:
Five (Xer) 2020-06-11 23:39:16 +02:00
Ursprung 8d159408ba
Commit 78b442a852
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F306B10E6330E7
2 geänderte Dateien mit 11 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -35,7 +35,7 @@ public enum ProtocolVersion {
MINECRAFT_1_15(573, "1.15"), MINECRAFT_1_15(573, "1.15"),
MINECRAFT_1_15_1(575, "1.15.1"), MINECRAFT_1_15_1(575, "1.15.1"),
MINECRAFT_1_15_2(578, "1.15.2"), MINECRAFT_1_15_2(578, "1.15.2"),
MINECRAFT_1_16(725, "1.16"); MINECRAFT_1_16(727, "1.16");
private final int protocol; private final int protocol;
private final String name; private final String name;

Datei anzeigen

@ -18,7 +18,10 @@ import com.velocitypowered.api.event.permission.PermissionsSetupEvent;
import com.velocitypowered.api.event.player.GameProfileRequestEvent; import com.velocitypowered.api.event.player.GameProfileRequestEvent;
import com.velocitypowered.api.proxy.server.RegisteredServer; import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.util.GameProfile; import com.velocitypowered.api.util.GameProfile;
import com.velocitypowered.api.util.UuidUtils;
import com.velocitypowered.proxy.VelocityServer; import com.velocitypowered.proxy.VelocityServer;
import com.velocitypowered.proxy.config.PlayerInfoForwarding;
import com.velocitypowered.proxy.config.VelocityConfiguration;
import com.velocitypowered.proxy.connection.MinecraftConnection; import com.velocitypowered.proxy.connection.MinecraftConnection;
import com.velocitypowered.proxy.connection.MinecraftSessionHandler; import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
@ -41,6 +44,7 @@ import java.security.GeneralSecurityException;
import java.security.KeyPair; import java.security.KeyPair;
import java.util.Arrays; import java.util.Arrays;
import java.util.Optional; import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
import net.kyori.text.Component; import net.kyori.text.Component;
@ -253,10 +257,14 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
mcConnection.write(new SetCompression(threshold)); mcConnection.write(new SetCompression(threshold));
mcConnection.setCompressionThreshold(threshold); mcConnection.setCompressionThreshold(threshold);
} }
VelocityConfiguration configuration = server.getConfiguration();
UUID playerUniqueId = player.getUniqueId();
if (configuration.getPlayerInfoForwardingMode() == PlayerInfoForwarding.NONE) {
playerUniqueId = UuidUtils.generateOfflinePlayerUuid(player.getUsername());
}
ServerLoginSuccess success = new ServerLoginSuccess(); ServerLoginSuccess success = new ServerLoginSuccess();
success.setUsername(player.getUsername()); success.setUsername(player.getUsername());
success.setUuid(player.getUniqueId()); success.setUuid(playerUniqueId);
mcConnection.write(success); mcConnection.write(success);
mcConnection.setAssociation(player); mcConnection.setAssociation(player);