Added votepoints into db_database.sql (#411)

* Added GM lv0 command to read votepoints and rewardpoints

* Added missing votepoints in sql and tweaked MapleClient

* Fix read from votes

* Fix votepoints sql
This commit is contained in:
Jerry Wang
2019-02-23 23:17:11 +10:00
committed by Ronan Lana
parent 895326e819
commit 1772910a52
4 changed files with 43 additions and 4 deletions

View File

@@ -1160,12 +1160,12 @@ public class MapleClient {
int points = 0;
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("SELECT `votes` FROM accounts WHERE id = ?");
PreparedStatement ps = con.prepareStatement("SELECT `votepoints` FROM accounts WHERE id = ?");
ps.setInt(1, accId);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
points = rs.getInt("votes");
points = rs.getInt("votepoints");
}
ps.close();
rs.close();
@@ -1196,7 +1196,7 @@ public class MapleClient {
private void saveVotePoints() {
try {
Connection con = DatabaseConnection.getConnection();
try (PreparedStatement ps = con.prepareStatement("UPDATE accounts SET votes = ? WHERE id = ?")) {
try (PreparedStatement ps = con.prepareStatement("UPDATE accounts SET votepoints = ? WHERE id = ?")) {
ps.setInt(1, votePoints);
ps.setInt(2, accId);
ps.executeUpdate();