Write the static ID manifest and check DB references at boot

nextStaticID now takes the object type and a natural manifest key, so no
static ID is handed out without a manifest entry. After the world load the
server diffs maps/<map>.manifest against the previous boot (moved, vanished,
re-targeted IDs), writes the new one (old copy kept as .manifest.prev), and
logs every negative reference in the Task 2.1 columns that no loaded static
object of the right type holds.

Value changes: none in play. Guilds are the only static IDs so far
(-2..-25, keys guild:<first seed key>).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-27 22:27:50 -04:00
1 parent 3b4a60c739
commit b83cde8141
5 files changed
+303 -2

No files matched your search

+5 -1
View File
@@ -69,6 +69,7 @@ public enum DbManager {
public static final dbBlueprintHandler BlueprintQueries = new dbBlueprintHandler();
public static final dbShrineHandler ShrineQueries = new dbShrineHandler();
public static final dbRunegateHandler RunegateQueries = new dbRunegateHandler();
public static final dbStaticWorldHandler StaticWorldQueries = new dbStaticWorldHandler();
public static final dbPetitionHandler PetitionQueries = new dbPetitionHandler();
private static final EnumMap<GameObjectType, ConcurrentHashMap<Integer, AbstractGameObject>> objectCache = new EnumMap<>(GameObjectType.class);
@@ -76,13 +77,16 @@ public enum DbManager {
private static HikariDataSource connectionPool = null;
// Only the static world factories may call this, in the fixed load order (W2); never renumber.
public static int nextStaticID() {
// The key names the object from the data files alone (findings §5, manifest format) and must be unique.
public static int nextStaticID(GameObjectType objectType, String manifestKey) {
int staticID = lastStaticID.decrementAndGet();
if (staticID <= RUNTIME_ID_START)
throw new IllegalStateException("Static world ID " + staticID + " reached the runtime ID range at " + RUNTIME_ID_START);
StaticManifest.addEntry(staticID, objectType, manifestKey);
return staticID;
}