Debug verified username usage in ProtocolLib

This commit is contained in:
games647
2020-07-10 15:01:29 +02:00
parent c96d64597a
commit b30eb0de29

View File

@ -101,20 +101,21 @@ public class VerifyResponseTask implements Runnable {
InetAddress address = socketAddress.getAddress(); InetAddress address = socketAddress.getAddress();
Optional<Verification> response = resolver.hasJoined(requestedUsername, serverId, address); Optional<Verification> response = resolver.hasJoined(requestedUsername, serverId, address);
if (response.isPresent()) { if (response.isPresent()) {
plugin.getLog().info("GameProfile {} has a verified premium account", requestedUsername); Verification verification = response.get();
String realUsername = response.get().getName(); plugin.getLog().info("Profile {} has a verified premium account: {}", requestedUsername, verification);
String realUsername = verification.getName();
if (realUsername == null) { if (realUsername == null) {
disconnect("invalid-session", true, "Username field null for {}", requestedUsername); disconnect("invalid-session", true, "Username field null for {}", requestedUsername);
return; return;
} }
SkinProperty[] properties = response.get().getProperties(); SkinProperty[] properties = verification.getProperties();
if (properties.length > 0) { if (properties.length > 0) {
session.setSkinProperty(properties[0]); session.setSkinProperty(properties[0]);
} }
session.setVerifiedUsername(realUsername); session.setVerifiedUsername(realUsername);
session.setUuid(response.get().getId()); session.setUuid(verification.getId());
session.setVerified(true); session.setVerified(true);
setPremiumUUID(session.getUuid()); setPremiumUUID(session.getUuid());