Clean up rewardpoints
This commit is contained in:
@@ -28,16 +28,8 @@ CREATE TABLE IF NOT EXISTS `accounts` (
|
||||
`tempban` timestamp NOT NULL DEFAULT '2005-05-11 00:00:00',
|
||||
`greason` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`tos` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`sitelogged` text,
|
||||
`webadmin` int(1) DEFAULT '0',
|
||||
`nick` varchar(20) DEFAULT NULL,
|
||||
`mute` int(1) DEFAULT '0',
|
||||
`email` varchar(45) DEFAULT NULL,
|
||||
`ip` text,
|
||||
`rewardpoints` int(11) NOT NULL DEFAULT '0',
|
||||
`votepoints` int(11) NOT NULL DEFAULT '0',
|
||||
`hwid` varchar(12) NOT NULL DEFAULT '',
|
||||
`language` int(1) NOT NULL DEFAULT '2',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
KEY `ranking1` (`id`,`banned`),
|
||||
|
||||
@@ -10894,33 +10894,6 @@ public class Character extends AbstractCharacterObject {
|
||||
this.commandtext = text;
|
||||
}
|
||||
|
||||
public int getRewardPoints() {
|
||||
try (Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT rewardpoints FROM accounts WHERE id=?;")) {
|
||||
ps.setInt(1, accountid);
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
int point = -1;
|
||||
if (resultSet.next()) {
|
||||
point = resultSet.getInt(1);
|
||||
}
|
||||
return point;
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void setRewardPoints(int value) {
|
||||
try (Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET rewardpoints=? WHERE id=?;")) {
|
||||
ps.setInt(1, value);
|
||||
ps.setInt(2, accountid);
|
||||
ps.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//EVENTS
|
||||
private byte team = 0;
|
||||
private Fitness fitness;
|
||||
|
||||
Reference in New Issue
Block a user