Merge pull request #1506 from menocar/fix

Re-add the getHistory method.
This commit is contained in:
LevelX2 2016-01-31 16:58:55 +01:00
commit ef3fbffe11
4 changed files with 12 additions and 3 deletions

View file

@ -55,7 +55,7 @@ public class SeatView implements Serializable {
this.history = "";
} else {
this.flagName = seat.getPlayer().getUserData().getFlagName();
this.history = seat.getPlayer().getUserData().getMatchHistory() + " " + seat.getPlayer().getUserData().getTourneyHistory();
this.history = seat.getPlayer().getUserData().getHistory();
}
} else {
// Empty seat

View file

@ -551,6 +551,11 @@ public class User {
return "<not available>";
}
public static String userStatsToHistory(ResultProtos.UserStatsProto proto) {
return "Matches:" + userStatsToMatchHistory(proto) +
" Tourneys: " + userStatsToTourneyHistory(proto);
}
public static String userStatsToMatchHistory(ResultProtos.UserStatsProto proto) {
StringBuilder builder = new StringBuilder();
builder.append(proto.getMatches());

View file

@ -205,9 +205,9 @@ public class UserManager {
if (userStats == null) {
return "User " + userName + " not found";
}
return "History of user " + userName + ": " + User.userStatsToMatchHistory(userStats.getProto()) + " " + User.userStatsToTourneyHistory(userStats.getProto());
return "History of user " + userName + ": " + User.userStatsToHistory(userStats.getProto());
}
return "History of user " + userName + ": " + user.getUserData().getMatchHistory() + " " + user.getUserData().getTourneyHistory();
return "History of user " + userName + ": " + user.getUserData().getHistory();
}
public void updateUserHistory() {

View file

@ -171,6 +171,10 @@ public class UserData implements Serializable {
this.autoOrderTrigger = autoOrderTrigger;
}
public String getHistory() {
return "Matches:" + this.matchHistory + " Tourneys:" + this.tourneyHistory;
}
public void setMatchHistory(String history) {
this.matchHistory = history;
}