Core/Housing: add owned room removal persistence API

This commit is contained in:
Gexo91
2026-09-11 23:42:49 +03:00
parent e06b82c20f
commit c6bddb5a37
@@ -14,9 +14,9 @@ class Player;
namespace Housing
{
// Read/validation layer for housing_room_entity. Stage 5 deliberately keeps
// room mutation and opcode activation out until HouseRoom client data is safe
// for build 12.1.0.69587.
// Persistence/validation layer for housing_room_entity. Room template creation
// remains fail-closed until the verified 12.1.0.69587 HouseRoom store is loaded;
// ownership-safe removal does not depend on trusting a client-supplied template id.
class TC_GAME_API RoomPersistence
{
public:
@@ -25,10 +25,17 @@ namespace Housing
std::vector<RoomState> LoadOwnedRooms(Player const* player, ObjectGuid const& houseGuid) const;
Result LoadOwnedRoom(Player const* player, ObjectGuid const& roomGuid, RoomState& state) const;
// Removes one already-persisted room owned by the player. Child live entity
// GUIDs are snapshotted before the transaction so the caller can despawn them
// through Map ownership after persistence succeeds. Placed room decor is
// returned to storage instead of being destroyed.
Result RemoveOwnedRoom(Player const* player, ObjectGuid const& roomGuid, RoomState& removedState,
std::vector<ObjectGuid>& childEntityGuids) const;
bool IsSafePersistedRoom(RoomState const& state) const;
// Fail-closed gate for future room mutation handlers. The DB2Storage table
// hash is assigned only after a successful load, so a disabled/stale
// Fail-closed gate for future room creation/mutation handlers. The DB2Storage
// table hash is assigned only after a successful load, so a disabled/stale
// HouseRoom store can never be mistaken for ready client data.
bool IsRoomTemplateStoreReady() const;
bool IsKnownRoomTemplate(uint32 houseRoomId) const;