mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Removed HudType references from the database.
This commit is contained in:
		@@ -346,7 +346,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                out.append("0:"); // DATS
 | 
					                out.append("0:"); // DATS
 | 
				
			||||||
                out.append("0:"); // DATS
 | 
					                out.append("0:"); // DATS
 | 
				
			||||||
                out.append("0:"); // DATS
 | 
					                out.append("0:"); // DATS
 | 
				
			||||||
                out.append("STANDARD").append(":"); // HUD
 | 
					                out.append(":");
 | 
				
			||||||
                out.append("0:"); // Fishing
 | 
					                out.append("0:"); // Fishing
 | 
				
			||||||
                out.append("0:"); // FishingXp
 | 
					                out.append("0:"); // FishingXp
 | 
				
			||||||
                out.append("0:"); // Blast Mining
 | 
					                out.append("0:"); // Blast Mining
 | 
				
			||||||
@@ -609,7 +609,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                                // Introduction of HUDType
 | 
					                                // Introduction of HUDType
 | 
				
			||||||
                                // Version 1.1.06
 | 
					                                // Version 1.1.06
 | 
				
			||||||
                                // commit 78f79213cdd7190cd11ae54526f3b4ea42078e8a
 | 
					                                // commit 78f79213cdd7190cd11ae54526f3b4ea42078e8a
 | 
				
			||||||
                                newLine.append("STANDARD").append(":");
 | 
					                                newLine.append(":");
 | 
				
			||||||
                                oldVersion = "1.1.06";
 | 
					                                oldVersion = "1.1.06";
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (character.length <= 35) {
 | 
					                            if (character.length <= 35) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -130,6 +130,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
        MobHealthbarType mobHealthbarType = profile.getMobHealthbarType();
 | 
					        MobHealthbarType mobHealthbarType = profile.getMobHealthbarType();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        saveLogin(userId, ((int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)));
 | 
					        saveLogin(userId, ((int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)));
 | 
				
			||||||
 | 
					        saveHuds(userId, (mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()));
 | 
				
			||||||
        saveLongs(
 | 
					        saveLongs(
 | 
				
			||||||
                "UPDATE " + tablePrefix + "cooldowns SET "
 | 
					                "UPDATE " + tablePrefix + "cooldowns SET "
 | 
				
			||||||
                    + "  mining = ?, woodcutting = ?, unarmed = ?"
 | 
					                    + "  mining = ?, woodcutting = ?, unarmed = ?"
 | 
				
			||||||
@@ -354,7 +355,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                    + "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
 | 
					                    + "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
 | 
				
			||||||
                    + "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
 | 
					                    + "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
 | 
				
			||||||
                    + "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
 | 
					                    + "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
 | 
				
			||||||
                    + "h.hudtype, h.mobhealthbar "
 | 
					                    + "h.mobhealthbar "
 | 
				
			||||||
                    + "FROM " + tablePrefix + "users u "
 | 
					                    + "FROM " + tablePrefix + "users u "
 | 
				
			||||||
                    + "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
 | 
					                    + "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
 | 
				
			||||||
                    + "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
 | 
					                    + "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
 | 
				
			||||||
@@ -422,7 +423,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                    + "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
 | 
					                    + "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, "
 | 
				
			||||||
                    + "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
 | 
					                    + "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, "
 | 
				
			||||||
                    + "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
 | 
					                    + "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
 | 
				
			||||||
                    + "h.hudtype, h.mobhealthbar "
 | 
					                    + "h.mobhealthbar "
 | 
				
			||||||
                    + "FROM " + tablePrefix + "users u "
 | 
					                    + "FROM " + tablePrefix + "users u "
 | 
				
			||||||
                    + "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
 | 
					                    + "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
 | 
				
			||||||
                    + "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
 | 
					                    + "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
 | 
				
			||||||
@@ -631,7 +632,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                + "UNIQUE KEY `user` (`user`)) DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
 | 
					                + "UNIQUE KEY `user` (`user`)) DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
 | 
				
			||||||
        write("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "huds` ("
 | 
					        write("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "huds` ("
 | 
				
			||||||
                + "`user_id` int(10) unsigned NOT NULL,"
 | 
					                + "`user_id` int(10) unsigned NOT NULL,"
 | 
				
			||||||
                + "`hudtype` varchar(50) NOT NULL DEFAULT 'STANDARD',"
 | 
					 | 
				
			||||||
                + "`mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "',"
 | 
					                + "`mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "',"
 | 
				
			||||||
                + "PRIMARY KEY (`user_id`)) "
 | 
					                + "PRIMARY KEY (`user_id`)) "
 | 
				
			||||||
                + "DEFAULT CHARSET=latin1;");
 | 
					                + "DEFAULT CHARSET=latin1;");
 | 
				
			||||||
@@ -732,6 +732,10 @@ public final class SQLDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                write("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party` ;");
 | 
					                write("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party` ;");
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            case DROPPED_SPOUT:
 | 
				
			||||||
 | 
					                write("ALTER TABLE `" + tablePrefix + "huds` DROP COLUMN `hudtype` ;");
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            case KILL_ORPHANS:
 | 
					            case KILL_ORPHANS:
 | 
				
			||||||
                mcMMO.p.getLogger().info("Killing orphans");
 | 
					                mcMMO.p.getLogger().info("Killing orphans");
 | 
				
			||||||
                write(
 | 
					                write(
 | 
				
			||||||
@@ -1118,14 +1122,13 @@ public final class SQLDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void saveHuds(int userId, String hudType, String mobHealthBar) {
 | 
					    private void saveHuds(int userId, String mobHealthBar) {
 | 
				
			||||||
        PreparedStatement statement = null;
 | 
					        PreparedStatement statement = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET hudtype = ?, mobhealthbar = ? WHERE user_id = ?");
 | 
					            statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ? WHERE user_id = ?");
 | 
				
			||||||
            statement.setString(1, hudType);
 | 
					            statement.setString(1, mobHealthBar);
 | 
				
			||||||
            statement.setString(2, mobHealthBar);
 | 
					            statement.setInt(2, userId);
 | 
				
			||||||
            statement.setInt(3, userId);
 | 
					 | 
				
			||||||
            statement.execute();
 | 
					            statement.execute();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        catch (SQLException ex) {
 | 
					        catch (SQLException ex) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,5 +7,6 @@ public enum DatabaseUpdateType {
 | 
				
			|||||||
    MOB_HEALTHBARS,
 | 
					    MOB_HEALTHBARS,
 | 
				
			||||||
    PARTY_NAMES,
 | 
					    PARTY_NAMES,
 | 
				
			||||||
    KILL_ORPHANS,
 | 
					    KILL_ORPHANS,
 | 
				
			||||||
 | 
					    DROPPED_SPOUT
 | 
				
			||||||
    ;
 | 
					    ;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user