Commit Graph
21 Commits
Author SHA1 Message Date
MagicBotandClaude Opus 5.5 3fbf07c2cb Delete object descendants in Java instead of through the parent FK cascade
The object.parent foreign key (ref_parent, ON DELETE CASCADE) is dropped
in World Boot Plan 2.4: static zones and buildings leave the DB, so rows
under them get negative parents that no object row holds. deleteObjectTree
deletes an object and every row below it by parent in one transaction,
which is what the cascade did. Used by the building, guild, mob, NPC and
zone delete paths (city destroy relies on it for the city, NPCs and mobs).

Value changes: none; the same rows are deleted, and the FK is still in
place until the 2.4 migration runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:31:02 -04:00
MagicBotandClaude Opus 5.5 c66ce6e777 Build static zones from the zone tree at world server boot
ZoneManager.loadZones builds the 1,062 static zones from
maps/<MB_WORLD_MAPID>.tree through Zone.createStaticZone, flagged static
and keeping their positive tree UIDs (negative IDs come with W10 in 2.4).
Player-city zones still load from obj_zone (template 0). Boot aborts on a
missing tree file, a missing CZONE template or a missing parent.
GET_ALL_ZONES is kept until the removal task.

Value changes vs obj_zone (parity: scripts/task14_zone_parity.py):
- 44 zones: x/z offsets take the live values; obj_zone had them rounded
  to whole units (e.g. 279: 192.0 -> 192.48, 274: -238.0 -> -237.653).
- Static zones no longer write their hash to obj_zone at boot; the hash
  is computed in memory (same value).
- min/max level 30/60 for the 50 icon zones now comes from constants
  (no client data carries zone levels); same values as obj_zone.
Everything else identical: parent (except the unused root parent),
template, name, peace flag, y offset, icons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:07:21 -04:00
MagicBotandClaude Opus 5.5 4299b27422 Build zone templates from CZONE instead of static_zone_templates
ZoneManager._zone_templates now holds the parser's CZoneTemplate: every
CZONE template plus the player-city template 0, still built in code.
Zone and Terrain read the mbEnums sea level and terrain types instead of
strings. The static_zone_templates loader goes with the old map type;
the table stays until Task 4.2.

Parity: all 861 templates, every column the server read (type, name,
peace, radii, blends, sea level and type, water, terrain gen, type,
max_y, image) identical to the JSON. Value changes: none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:28:58 -04:00
MagicBotandClaude Opus 5.5 731425e85a Refuse DB writes for static world objects
DbManager.refuseStaticWrite logs the handler method and its caller and
stops the write (W3). It guards every write whose row belongs to a
Building, Zone, City, Guild, Mob or NPC: 69 handler methods, including
friends/condemned/patrol lists, guard minions, NPC profits and guild
banish/alliance lists. ID-only methods look the object up in the cache.
Writes that only reference a static object (character guild history,
another guild's alliance row) are not guarded.

Value changes: none; nothing is flagged static yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:45:31 -04:00
MagicBot ab96cfcda4 Header update 2026-07-26 19:08:44 -04:00
MagicBot 634f1478ce Removed custom exception candy 2024-05-12 13:36:47 -04:00
MagicBot c1ee6f5b52 Renamed class to not conflict with the java.lang version. 2024-04-05 07:59:44 -04:00
MagicBot 59190e33c9 Template added for player cities (0) 2023-10-20 17:09:27 -04:00
MagicBot 091b1a1d5b Start refactor to use templates 2023-10-20 17:01:42 -04:00
MagicBot 14ba9d0f7f SQL statement set. 2023-10-20 16:36:08 -04:00
MagicBot cf2bf2dacf DBhandler created for templates 2023-10-20 16:11:55 -04:00
MagicBot 602f8bc843 Cleanup building initialization 2023-10-18 10:33:58 -04:00
MagicBot 5ed21f9b76 Refactored Zone to new system 2023-10-18 08:33:49 -04:00
MagicBot 34024c9fb4 New handlers created 2023-10-17 08:45:33 -04:00
MagicBot a17b9fdd13 Zone extents derived from zone 2023-10-09 06:04:37 -04:00
MagicBot e0387dce00 class and table schema now conform to JSON 2023-09-20 15:53:41 -04:00
MagicBot 46b3db033b Inlined empty getters 2023-09-20 15:43:01 -04:00
MagicBot 9bbdef224d Project cleanup pre merge. 2023-07-15 09:23:48 -04:00
MagicBot 6dd7315786 Garbage cleanup in SetZone().
Package reformat.
2023-05-23 10:27:03 -04:00
MagicBot f7da137e0f Refactor to remove abstraction 2023-05-23 09:57:17 -04:00
MagicBot bbfdde57a3 Initial Repository Push 2022-04-30 09:41:17 -04:00