本文整理了Java中com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication.getSelectedProfile()
方法的一些代码示例,展示了YggdrasilUserAuthentication.getSelectedProfile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YggdrasilUserAuthentication.getSelectedProfile()
方法的具体详情如下:
包路径:com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication
类名称:YggdrasilUserAuthentication
方法名:getSelectedProfile
暂无
代码示例来源:origin: Slowpoke101/FTBLaunch
public static String toString (YggdrasilUserAuthentication y) {
return "YggdrasilAuthenticationService{profiles=" + Arrays.toString(y.getAvailableProfiles()) + ", selectedProfile=" + y.getSelectedProfile() + ", isLoggedIn=" + y.isLoggedIn() + ", userType="
+ y.getUserType() + ", canPlayOnline=" + y.canPlayOnline() + "}";
}
代码示例来源:origin: ATLauncher/ATLauncher
public boolean isValidAuth() {
if (!this.hasAuth()) {
return false;
}
if (!this.auth.isLoggedIn()) {
this.setErrorMessage("Response from Mojang wasn't valid!");
} else if (this.auth.getAuthenticatedToken() == null) {
this.setErrorMessage("No authentication token returned from Mojang!");
} else if (auth.getSelectedProfile() == null && (this.auth.getAvailableProfiles() == null || this.auth
.getAvailableProfiles().length == 0)) {
this.setErrorMessage("There are no paid copies of Minecraft associated with this account!");
} else if (this.auth.getSelectedProfile() == null) {
this.setErrorMessage("No profile selected!");
}
return !this.hasError;
}
代码示例来源:origin: Slowpoke101/FTBLaunch
private static boolean isValid (YggdrasilUserAuthentication authentication) {
boolean ret = true;
if (!authentication.isLoggedIn()) {
Logger.logDebug("authentication not valid");
ret = false;
}
if (authentication.getAuthenticatedToken() == null) {
Logger.logDebug("authentication not valid");
ret = false;
}
if (authentication.getSelectedProfile() == null) {
Logger.logDebug("authentication not valid");
ret = false;
}
return ret;
}
代码示例来源:origin: ATLauncher/ATLauncher
public String getSession(LoginResponse response) {
if (!response.isOffline() && response != null && response.getAuth().isLoggedIn() && response.getAuth()
.canPlayOnline()) {
if (response.getAuth() instanceof YggdrasilUserAuthentication) {
return String.format("token:%s:%s", response.getAuth().getAuthenticatedToken(), UUIDTypeAdapter
.fromUUID(response.getAuth().getSelectedProfile().getId()));
} else {
return response.getAuth().getAuthenticatedToken();
}
}
return "token:0:0";
}
代码示例来源:origin: ATLauncher/ATLauncher
if (response != null && response.hasAuth() && response.isValidAuth()) {
if (accountsComboBox.getSelectedIndex() == 0) {
account = new Account(username, password, response.getAuth().getSelectedProfile().getName(),
response.getAuth().getSelectedProfile().getId().toString(), remember);
App.settings.addAccount(account);
LogManager.info("Added Account " + account);
account = (Account) accountsComboBox.getSelectedItem();
account.setUsername(username);
account.setMinecraftUsername(response.getAuth().getSelectedProfile().getName());
account.setUUID(response.getAuth().getSelectedProfile().getId().toString());
if (remember) {
account.setPassword(password);
代码示例来源:origin: ATLauncher/ATLauncher
this.setUUID(response.getAuth().getSelectedProfile().getId().toString());
response.save();
App.settings.saveAccounts();
代码示例来源:origin: Slowpoke101/FTBLaunch
Logger.logError("Invalid credentials recieved for user: " + user, e);
if (hasMojangData && hasPassword) {
uniqueID = authentication.getSelectedProfile().getId().toString();
if (hasMojangData) {
uniqueID = authentication.getSelectedProfile().getId().toString();
if (uniqueID != null && !uniqueID.isEmpty()) {
Logger.logDebug("Setting UUID");
displayName = authentication.getSelectedProfile().getName();
if ((authentication.isLoggedIn()) && (authentication.canPlayOnline())) {
Logger.logDebug("loggedIn() && CanPlayOnline()");
if ((authentication instanceof YggdrasilUserAuthentication)) {
UserManager.setStore(user, encode(authentication.saveForStorage()));
UserManager.setUUID(user, authentication.getSelectedProfile().getId().toString());//enables use of offline mode later if needed on newer MC Versions
Logger.logDebug("Authentication done, returning LoginResponse");
return new LoginResponse(Integer.toString(authentication.getAgent().getVersion()), "token", displayName, authentication.getAuthenticatedToken(), authentication
.getSelectedProfile().getId().toString(), authentication);
} else if (authentication.getSelectedProfile() == null && (authentication.getAvailableProfiles() != null && authentication.getAvailableProfiles().length != 0)) {
selectedProfile = authentication.getSelectedProfile();
return new LoginResponse(Integer.toString(authentication.getAgent().getVersion()), "token", selectedProfile.getName(), authentication.getAuthenticatedToken(),
selectedProfile.getId().toString(), authentication);
} else if (authentication.getSelectedProfile() == null && (authentication.getAvailableProfiles() != null && authentication.getAvailableProfiles().length == 0)) {
内容来源于网络,如有侵权,请联系作者删除!