More bonus work

This commit is contained in:
Shaun Bennett 2015-08-02 19:12:39 -05:00
parent 06be7b2cdd
commit cadd21c18b
4 changed files with 34 additions and 23 deletions

View File

@ -8,10 +8,11 @@ public class BonusClientData {
private Timestamp _dailyTime;
private Date _rankTime;
private Date _voteTime;
private int _rankStreak;
private int _maxRankStreak;
private int _dailyStreak;
private int _maxDailyStreak;
private int _voteStreak;
private int _maxVoteStreak;
private int _tickets;
public Timestamp getDailyTime()
{
@ -43,24 +44,24 @@ public class BonusClientData {
this._voteTime = _voteTime;
}
public void setRankStreak(int rankStreak)
public int getDailyStreak()
{
_rankStreak = rankStreak;
return _dailyStreak;
}
public int getRankStreak()
public void setDailyStreak(int dailyStreak)
{
return _rankStreak;
_dailyStreak = dailyStreak;
}
public void setMaxRankStreak(int maxRankStreak)
public int getMaxDailyStreak()
{
_maxRankStreak = maxRankStreak;
return _maxDailyStreak;
}
public int getMaxRankStreak()
public void setMaxDailyStreak(int maxDailyStreak)
{
return _maxRankStreak;
_maxDailyStreak = maxDailyStreak;
}
public void setVoteStreak(int voteStreak)
@ -82,4 +83,14 @@ public class BonusClientData {
{
return _maxVoteStreak;
}
public int getTickets()
{
return _tickets;
}
public void setTickets(int tickets)
{
_tickets = tickets;
}
}

View File

@ -249,7 +249,7 @@ public class BonusManager extends MiniDbClientPlugin<BonusClientData> {
@Override
public String getQuery(int accountId, String uuid, String name)
{
return "SELECT * FROM bonus WHERE accountId = '" + accountId + "';";
return "SELECT dailytime, ranktime, votetime, dailyStreak, maxDailyStreak, voteStreak, maxVoteStreak, tickets FROM bonus WHERE accountId = '" + accountId + "';";
}
public BonusRepository getRepository()

View File

@ -42,18 +42,18 @@ public class BonusRepository extends RepositoryBase {
{
BonusClientData clientData = new BonusClientData();
Date rankTime = null;
Timestamp dailyTime = null;
while (resultSet.next()) {
rankTime = resultSet.getDate("ranktime");
dailyTime = resultSet.getTimestamp("dailytime");
System.err.println("COUNT---COUNT");
while (resultSet.next())
{
clientData.setDailyTime(resultSet.getTimestamp(1));
clientData.setRankTime(resultSet.getDate(2));
clientData.setVoteTime(resultSet.getDate(3));
clientData.setDailyStreak(resultSet.getInt(4));
clientData.setMaxDailyStreak(resultSet.getInt(5));
clientData.setVoteStreak(resultSet.getInt(6));
clientData.setMaxVoteStreak(resultSet.getInt(7));
clientData.setTickets(resultSet.getInt(8));
}
clientData.setRankTime(rankTime);
clientData.setDailyTime(dailyTime);
return clientData;
}

View File

@ -184,8 +184,8 @@ public class RankBonusButton implements GuiItem, Listener {
BonusAmount bonusAmount = _bonusManager.getRankBonusAmount(_player);
bonusAmount.addLore(lore);
lore.add(C.cYellow + "Current Streak: " + C.cWhite + client.getRankStreak());
lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxRankStreak());
lore.add(C.cYellow + "Current Streak: " + C.cWhite + client.getDailyStreak());
lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxDailyStreak());
lore.add(" ");
lore.add(C.cYellow + "Record Holder: " + C.cWhite + "Phinary");
lore.add(C.cYellow + "Streak: " + C.cWhite + "420");