Drop the server-made mobbase rows and the dead mobbase columns
The 406 ID <> loadID mobbases (15000-17266) were junk: no RUNE file, nothing on dev references them. MobBase now always reads its core fields from the race rune and logs an error if the rune is missing; the loader skips any ID <> loadID rows still present. GetClassType only matched those IDs, so it always returned 2518 and is replaced by the constant. DB: MBDATA/JSON-Refactor-Plan/sql/3.6-mobbase-cleanup.sql deletes the rows, the 10 orphan static_npc_mobbase_effects rows (17061/17122/17154) and drops 13 columns no longer read: lootTableID, name, level, health, atr, defense, minDmg, maxDmg, noaggro, raceType, fsm, notEnemy, enemy. Value changes: none for the 2375 loaded mobbases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c811ba9f4e
commit
ccc9d9f0ed
3 files changed
+14
-46
No files matched your search
@@ -15,7 +15,6 @@ import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.MobBase;
|
||||
import engine.objects.MobBaseEffects;
|
||||
import engine.objects.MobBaseStats;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -42,7 +41,7 @@ public class dbMobBaseHandler extends dbHandlerBase {
|
||||
return mobBase;
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mobbase` WHERE `ID`=?")) {
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mobbase` WHERE `ID`=? AND `ID` = `loadID`")) {
|
||||
|
||||
preparedStatement.setInt(1, id);
|
||||
|
||||
@@ -60,10 +59,11 @@ public class dbMobBaseHandler extends dbHandlerBase {
|
||||
public ArrayList<MobBase> GET_ALL_MOBBASES() {
|
||||
|
||||
ArrayList<MobBase> mobbaseList = new ArrayList<>();
|
||||
int runeCount = 0;
|
||||
|
||||
// ID <> loadID rows were junk server-made mobbases (15000-17266); skip them on databases that still have them.
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mobbase`;")) {
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mobbase` WHERE `ID` = `loadID`;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
mobbaseList = getObjectsFromRs(rs, 1000);
|
||||
@@ -72,12 +72,7 @@ public class dbMobBaseHandler extends dbHandlerBase {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
for (MobBase mobBase : mobbaseList)
|
||||
if (mobBase.getObjectUUID() == mobBase.getLoadID() && RuneTemplate._runes.containsKey(mobBase.getLoadID()))
|
||||
runeCount++;
|
||||
|
||||
Logger.info("Loaded " + mobbaseList.size() + " mobbases: " + runeCount + " from runes, "
|
||||
+ (mobbaseList.size() - runeCount) + " server-made from the DB");
|
||||
Logger.info("Loaded " + mobbaseList.size() + " mobbases");
|
||||
|
||||
return mobbaseList;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user