Little changes (look comments)
This commit is contained in:
@@ -41,6 +41,7 @@ public class VotifierListener implements Listener, PluginMessageListener {
|
|||||||
if (!rs1.next()) {
|
if (!rs1.next()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int money = 25;
|
||||||
addPlayerMoney(25, vote);
|
addPlayerMoney(25, vote);
|
||||||
int playerId;
|
int playerId;
|
||||||
playerId = rs1.getInt("id");
|
playerId = rs1.getInt("id");
|
||||||
@@ -52,7 +53,7 @@ public class VotifierListener implements Listener, PluginMessageListener {
|
|||||||
if (lastVoteDate > ((System.currentTimeMillis() / 1000) - (60 * 60 * 24))) {
|
if (lastVoteDate > ((System.currentTimeMillis() / 1000) - (60 * 60 * 24))) {
|
||||||
votesInRow++;
|
votesInRow++;
|
||||||
if (votesInRow == 10) {
|
if (votesInRow == 10) {
|
||||||
addPlayerMoney(50, vote);
|
money += 50;
|
||||||
votesInRow = 0;
|
votesInRow = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -62,6 +63,7 @@ public class VotifierListener implements Listener, PluginMessageListener {
|
|||||||
} else {
|
} else {
|
||||||
Core.getMySql().queryUpdate("INSERT INTO `voteUsers`(`playerId`, `dateOfLastVote`, `votesInARow`) VALUES (SELECT id FROM `players` WHERE name = '" + vote.getUsername() + "'," + timestampInt + ",1)");
|
Core.getMySql().queryUpdate("INSERT INTO `voteUsers`(`playerId`, `dateOfLastVote`, `votesInARow`) VALUES (SELECT id FROM `players` WHERE name = '" + vote.getUsername() + "'," + timestampInt + ",1)");
|
||||||
}
|
}
|
||||||
|
addPlayerMoney(money, vote);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
Errors.reportException(ex);
|
Errors.reportException(ex);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user