Core/Housing: add owned room removal persistence API
This commit is contained in:
@@ -14,9 +14,9 @@ class Player;
|
|||||||
|
|
||||||
namespace Housing
|
namespace Housing
|
||||||
{
|
{
|
||||||
// Read/validation layer for housing_room_entity. Stage 5 deliberately keeps
|
// Persistence/validation layer for housing_room_entity. Room template creation
|
||||||
// room mutation and opcode activation out until HouseRoom client data is safe
|
// remains fail-closed until the verified 12.1.0.69587 HouseRoom store is loaded;
|
||||||
// for build 12.1.0.69587.
|
// ownership-safe removal does not depend on trusting a client-supplied template id.
|
||||||
class TC_GAME_API RoomPersistence
|
class TC_GAME_API RoomPersistence
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -25,10 +25,17 @@ namespace Housing
|
|||||||
std::vector<RoomState> LoadOwnedRooms(Player const* player, ObjectGuid const& houseGuid) const;
|
std::vector<RoomState> LoadOwnedRooms(Player const* player, ObjectGuid const& houseGuid) const;
|
||||||
Result LoadOwnedRoom(Player const* player, ObjectGuid const& roomGuid, RoomState& state) 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;
|
bool IsSafePersistedRoom(RoomState const& state) const;
|
||||||
|
|
||||||
// Fail-closed gate for future room mutation handlers. The DB2Storage table
|
// Fail-closed gate for future room creation/mutation handlers. The DB2Storage
|
||||||
// hash is assigned only after a successful load, so a disabled/stale
|
// table hash is assigned only after a successful load, so a disabled/stale
|
||||||
// HouseRoom store can never be mistaken for ready client data.
|
// HouseRoom store can never be mistaken for ready client data.
|
||||||
bool IsRoomTemplateStoreReady() const;
|
bool IsRoomTemplateStoreReady() const;
|
||||||
bool IsKnownRoomTemplate(uint32 houseRoomId) const;
|
bool IsKnownRoomTemplate(uint32 houseRoomId) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user