Adds visible column to achievements.

This commit is contained in:
Harmonic 2022-05-06 13:00:23 -07:00
parent 4b1d695094
commit 997e605ff6
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,6 @@
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_changename.user_not_found', 'The Habbo %user% does not exist or is not online.'); INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_changename.user_not_found', 'The Habbo %user% does not exist or is not online.');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_changename.done', 'Successfully toggled the name change for the Habbo %user%.'); INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_changename.done', 'Successfully toggled the name change for the Habbo %user%.');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_changename.received', 'Hotel staff requests for you to change your name.\n Please click on your Habbo then click on the "Change Your Name" button.'); INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_changename.received', 'Hotel staff requests for you to change your name.\n Please click on your Habbo then click on the "Change Your Name" button.');
ALTER TABLE `achievements`
ADD `visible` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1' COMMENT 'Is the achievement in use and/or obtainable?';

View File

@ -251,7 +251,7 @@ public class AchievementManager {
} }
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) {
try (Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM achievements")) { try (Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM achievements WHERE visible = 1")) {
while (set.next()) { while (set.next()) {
if (!this.achievements.containsKey(set.getString("name"))) { if (!this.achievements.containsKey(set.getString("name"))) {
this.achievements.put(set.getString("name"), new Achievement(set)); this.achievements.put(set.getString("name"), new Achievement(set));