feat: store each named pet's LOT in pet_names

pet_names gets a pet_lot column (mysql 80, sqlite 63). The world writes
it whenever it saves a pet name, from the pet entity's LOT, and fills it
in for older rows when the owner loads into a world (from the pets the
game loads for that character, only where it is still missing).

The dashboard's pet name tables read pet_lot instead of scanning the
owner's character XML; pets without it yet show as Unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 03:51:39 -05:00
parent 4735ce4f42
commit 7284422320
14 changed files with 72 additions and 36 deletions

View File

@@ -16,6 +16,8 @@ public:
int32_t approvalStatus{};
// The character that owns the pet (0 when not known). Saving with 0 keeps the owner already stored.
LWOOBJID ownerId{};
// The pet's LOT (0 when not known). Saving with 0 keeps the LOT already stored.
LOT petLot{};
};
// Set the pet name moderation status for the given pet id.
@@ -36,6 +38,9 @@ public:
// Pets whose owner was never recorded (named before owners were saved), and recording one (0: nobody has it)
virtual std::vector<LWOOBJID> GetPetsWithUnknownOwner() = 0;
virtual void SetPetOwner(const LWOOBJID petId, const LWOOBJID ownerId) = 0;
// Record the pet's LOT on its pet_names row, only when the row has none yet (NULL or 0). Does nothing without a row.
virtual void SetPetLotIfMissing(const LWOOBJID petId, const LOT petLot) = 0;
};
#endif //!__IPETNAMES__H__