if (GoogleSignIn.hasPermissions(this.googleSignInAccount, gso.getScopeArray())) {
Games.getPlayersClient(context, this.googleSignInAccount).getCurrentPlayer().addOnSuccessListener((player) -> {
this.curPlayer = player;
this.parseUserInfo();
if (this.userInfo != null) {
this.actionResult(2, “auto login success!”);
} else {
this.actionResult(5, “user info is empty!”);
}
}).addOnFailureListener((e) -> {
this.actionResult(5, e.getLocalizedMessage());
});
} else {
this.actionResult(31, "not login!");
}
private void parseUserInfo() {
if (this.curPlayer != null) {
try {
Hashtable<String, String> account = new Hashtable();
account.put(“userDisplayName”, this.curPlayer.getDisplayName());
account.put(“userName”, this.curPlayer.getName());
account.put(“userPlayerId”, this.curPlayer.getPlayerId());
account.put(“userTitle”, this.curPlayer.getTitle());
account.put(“userRetrievedTimestamp”, String.valueOf(this.curPlayer.getRetrievedTimestamp()));
account.put(“userBannerImageLandscapeUri”, this.curPlayer.getBannerImageLandscapeUrl());
account.put(“userBannerImagePortraitUri”, this.curPlayer.getBannerImagePortraitUrl());
account.put(“userIconImageUri”, this.curPlayer.getIconImageUrl());
account.put(“userHiResImageUri”, this.curPlayer.getHiResImageUrl());
account.put(“userCurrentPlayerInfo”, ((CurrentPlayerInfo)Objects.requireNonNull(this.curPlayer.getCurrentPlayerInfo())).toString());
account.put(“userRelationshipInfo”, ((PlayerRelationshipInfo)Objects.requireNonNull(this.curPlayer.getRelationshipInfo())).toString());
this.userInfo = account;
} catch (Exception var2) {
}
}
}
从代码看好像是登录成功了,但为什么解的时候就为空了呢?