feat: write the character attributes live saved and the client reads

LWOCharacterComponent::LoadFromSaveData (0x00ca4910) reads them, and live
saves had every one (450 of 450 characters saved at least once):
- cm, the most coins a character can hold: 9223372036854775807 on every
  live save, the client's own value without it. Written when missing, an
  existing one is kept, and nothing caps the coins by it.
- edit (editor level), gid and gn (guild id and name).
- mldt (when the property moderation notice was last shown): 0 when
  missing, as most live saves.
- v and vd: the votes left and the day they are for (GetVotesLeft /
  AdjustVotesLeft). Read back; a new day fills them up to the 3 of
  WorldConfig's character_votes_per_day.
- lrx.. lrrw: the last respawn point reached, once one was reached in the
  world.
- lzcs: the checksum of the zone in lzid.

Saves without them load as before. stime is not written: live kept the
session's seconds in it and the time before the session in time, which
would change what time means in existing saves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 14:50:33 -06:00
parent 95e0746441
commit dc5f13cdbc
4 changed files with 125 additions and 0 deletions

View File

@@ -368,6 +368,11 @@ public:
void SetTooltipFlag(int32_t tooltip, bool flag);
uint64_t GetTooltipFlags() const { return m_TooltipFlags; }
// WorldConfig's character_votes_per_day
static constexpr int32_t VOTES_PER_DAY = 3;
int32_t GetVotesLeft() const { return m_VotesLeft; }
uint64_t GetVoteDay() const { return m_VoteDay; }
uint64_t GetTotalTimePlayed() const { return m_TotalTimePlayed; };
/**
@@ -408,6 +413,11 @@ private:
// The tooltips the player has seen, one bit each (char@ttip)
uint64_t m_TooltipFlags{};
// The votes the character has left today (char@v) and the day, in days since 1970, they were last filled up on
// (char@vd), as LWOCharacterComponent::LoadFromSaveData (0x00ca4910) reads them for GetVotesLeft
int32_t m_VotesLeft = VOTES_PER_DAY;
uint64_t m_VoteDay{};
/**
* The lifetime reputation earned by the entity
*/