Load PromotionClass from the promotion runes instead of static_rune_promotion
LoadAllPromotions builds one PromotionClass per promotion CLASS rune (22, 2504-2526 without 2522) and caches it, then runs the DB loader, which skips cached ids, so only the CSR/admin rows 2901-2911 still come from static_rune_promotion (decision: DB fallback). The world server calls it in place of GET_ALL_PROMOTIONS; the login server now preloads promotions too, so character load there gets the same cached objects. The SQL loader stays until task 2.11. Value changes: Templar 2516 manaMod 14 -> 15 (decision: JSON, D2). description NULL -> rune_dsc blurb (unread). All other fields unchanged; final parity before the switch (scripts/p22.py): 22 promotion rows, 0 differences in name, token, health, stamina and the 163 allowed rune tokens. The static_rune_promotion comparator is removed; it would only compare the JSON with itself now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e91c803a32
commit
957293165b
4 files changed
+21
-50
No files matched your search
@@ -16,6 +16,7 @@ import engine.net.ByteBufferWriter;
|
||||
import engine.parsers.cache.CObjectIndex;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.util.Hasher;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -162,6 +163,24 @@ public class PromotionClass extends AbstractGameObject {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
public static void LoadAllPromotions() {
|
||||
|
||||
int loadedCount = 0;
|
||||
|
||||
for (RuneTemplate rune : RuneTemplate._runes.values()) {
|
||||
if (!isPromotionRune(rune))
|
||||
continue;
|
||||
|
||||
DbManager.addToCache(new PromotionClass(rune));
|
||||
loadedCount++;
|
||||
}
|
||||
|
||||
Logger.info("Loaded " + loadedCount + " promotion classes from runes");
|
||||
|
||||
// The CSR/admin rows 2901+ have no promotion rune; the DB loader skips ids already cached
|
||||
DbManager.PromotionQueries.GET_ALL_PROMOTIONS();
|
||||
}
|
||||
|
||||
public static void serializeForClientMsg(PromotionClass promotionClass, ByteBufferWriter writer) {
|
||||
writer.putInt(3); // For BaseClass
|
||||
writer.putInt(0); // Pad
|
||||
|
||||
Reference in new issue
Block a user