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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user