Commit Graph
53 Commits
Author SHA1 Message Date
MagicBotandClaude Opus 5.5 bb76596a9a Store Building, Mob and NPC rotation as a client-order quaternion
AbstractWorldObject.rot (a Vector3f holding one quaternion part) becomes a
Quaternion. Building drops its separate w field; Mob and NPC serialize
through AbstractCharacter.getClientYaw. DB columns are unchanged and are
converted at load and save: building (w, rotY) map to the quaternion's w and
y, npc_rotation (cos of half the yaw) becomes fromYaw(2 acos(value)).

Wire values are meant to be unchanged; a parity run follows. Behaviour kept
on purpose:
- mob_rotation is still not loaded, so every mob defaults to yaw pi as before
- the slot rotation still reads the product's sin as a cos
- /rotate on NPCs and mobs still treats its input as cos of half the yaw

Value changes: building serializer writes the quaternion's x and z instead
of literal zeros (both are 0 for every building); /info "Rot" for NPCs and
mobs prints the quaternion y (sin of half the yaw) instead of the stored cos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 06:40:59 -04:00
MagicBotandClaude Opus 5.5 35f1738ee4 Read NPC building owners once instead of per building at boot
Building.runAfterLoad ran GET_UID_ENUM for every building (~47k queries).
One query now reads the NPC owner IDs before the building load; runtime
loads also check the NPC cache. City load reads ownerIsNPC before NPCs
are cached, so a pass after the NPC load would not work.

Value changes: none. ownerIsNPC is still true exactly when the owner's
object.type is 'npc' (dev DB: 388 buildings, 24 owners).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 19:16:53 -04:00
MagicBotandClaude Opus 5.5 d586536c74 Create player buildings in memory with a single DB write
Building gets a no-arg constructor, a createBuilding factory (in the style
of Mob.createMob) and persistBuilding, which inserts the row through
building_CREATE, sets the returned UID, caches the object and runs
runAfterLoad. The GET_BUILDINGBYUUID re-select after the insert is gone.

PlaceAssetMsgHandler (createStructure, createBarracks, createWarehouse),
Bane and AddBuildingCmd move onto it.

Value changes:
- floor/level start at -1 and the other unset fields at the obj_building
  column defaults, same as the reloaded row.
- upgradeDateTime keeps milliseconds instead of the DATETIME-rounded value
  (sub-second difference in the upgrade job time).
- Warehouse placement no longer runs runAfterLoad twice, which submitted
  the warehouse upgrade job twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 16:02:10 -04:00
MagicBotandClaude Opus 5.5 e64d64bf18 Keep destroyed warehouse contents in memory so the rubble can be looted
destroyOrDerank nulled city.warehouse on destruction, so the loot click
found no warehouse and returned silently. The destroyed Warehouse is now
held in Warehouse.destroyedWarehouses keyed by the rubble building UUID
until it is looted empty, the rubble is destroyed, or the city places a
new warehouse. Contents are not persisted across a reboot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 09:19:40 -04:00
MagicBot 6017641896 mobai null resolution 2026-10-14 14:36:07 -04:00
MagicBot ab96cfcda4 Header update 2026-07-26 19:08:44 -04:00
MagicBot 24eb9608c3 Logic cleanup pass for protectorate logic 2026-05-10 18:36:43 -04:00
MagicBot 09c9dfbc06 Inlines method. upgraded protection 2026-05-10 10:36:27 -04:00
MagicBot 84347f8290 statAlt used as offset to terrain. 2026-01-13 14:56:06 -05:00
FatBoy aa1fe792a3 Load enforceKOS for buildings 2024-06-26 19:57:50 -05:00
FatBoy 80ccfff635 Building Management compiled to a single method check 2024-06-26 19:27:32 -05:00
MagicBot 96ba17f67a DispatchManager is now an official manager singleton. 2024-05-12 13:14:42 -04:00
MagicBot 916a12a434 City realm id lookup not db load 2024-04-27 11:32:05 -04:00
MagicBot c1ee6f5b52 Renamed class to not conflict with the java.lang version. 2024-04-05 07:59:44 -04:00
MagicBot 12c1cde069 Warehouse deleted from db 2024-03-17 13:21:55 -04:00
MagicBot f3bfdd8a36 Refactor warehouse part two. 2024-03-17 09:47:00 -04:00
MagicBot 97fa583f65 Initial warehouse refactor 2024-03-15 10:01:22 -04:00
MagicBot 2e37bd2472 deposit limits use type lookup 2024-03-14 13:58:51 -04:00
FatBoy c0ee8b82f8 Warehosue cleanup 2024-01-24 20:21:41 -06:00
FatBoy cc1e0d8986 Warehosue cleanup 2024-01-24 20:03:27 -06:00
MagicBot 7ce94a5166 should never pull directly form cache 2023-10-20 09:48:24 -04:00
MagicBot 3a63f98ac3 Error log added 2023-10-20 08:09:42 -04:00
MagicBot 3ef444c128 Cleanup in runafterload 2023-10-19 16:53:15 -04:00
MagicBot eaaba8ab0c Refactored assignment. 2023-10-19 16:48:39 -04:00
MagicBot 1daa45d604 New collection utilized 2023-10-19 16:44:29 -04:00
MagicBot 5858fa4de4 R8 bonus application moved to City 2023-10-19 08:20:28 -04:00
MagicBot 4274e6a148 Cleanup of friend and condemned initialization. 2023-10-19 07:59:44 -04:00
MagicBot beb2b47162 Collection used and old method deleted. 2023-10-18 13:03:40 -04:00
MagicBot 5ac62d60be Collection used and old handler removed. 2023-10-18 12:38:04 -04:00
MagicBot 838776c471 Method made static and moved to manager. 2023-10-18 11:30:22 -04:00
MagicBot 44743b772b Every building does not need a rebuild mine method. 2023-10-18 11:21:29 -04:00
MagicBot 88f67efd51 Want to fail fast here 2023-10-18 11:04:57 -04:00
MagicBot a04bdc147f Parent zone set 2023-10-18 11:03:08 -04:00
MagicBot 145d9bafa0 Removed unused methods 2023-10-18 10:59:50 -04:00
MagicBot d2c00cce70 Removed unused methods 2023-10-18 10:38:55 -04:00
MagicBot 602f8bc843 Cleanup building initialization 2023-10-18 10:33:58 -04:00
MagicBot 0d75e6db9b Start terrain refactor 2023-10-08 09:18:43 -04:00
MagicBot be107c0858 class and table schema now conform to JSON 2023-09-20 16:05:57 -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 8ece4caf1c value is halfExtent 2023-09-17 12:23:06 -04:00
FatBoy cae5c36d84 guards will aggro siege equipment not belonging to the guild 2023-09-09 22:01:59 -05:00
FatBoy 1b92fa76e1 characters that attack city friendly buildings are added to cityOutlaws 2023-09-09 21:48:22 -05:00
MagicBot 5899bb535b Stuck location rotated properly. 2023-07-22 11:02:03 -04:00
MagicBot 9bbdef224d Project cleanup pre merge. 2023-07-15 09:23:48 -04:00
MagicBot e4ddcdeeca Building offset added to loc. 2023-05-13 13:17:47 -04:00
MagicBot a113295058 Player zone radius now reflects 24.3 at 875. 2023-05-05 08:51:49 -04:00
MagicBot 10a6eec3da more Bonus Code removal. 2023-05-02 12:26:34 -04:00
MagicBot 715abf1444 Building Location rotations are now a quaternion. 2023-05-02 09:10:41 -04:00
MagicBot d454878245 BuildingModelBase no longer needed. 2023-04-29 15:15:23 -04:00