mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-29 16:07:14 +00:00
feat(character): keep and save the tooltip flags (SetTooltipFlag, char@ttip)
The client sends SetTooltipFlag (469: bFlag, then the tooltip, 2 live packets, both tooltip 24) when a tooltip has been shown, and follows it with SetFlag for the same ID. DLU dropped it and never wrote char@ttip, so the client's tooltip bits reset on every load. - SetTooltipFlag message struct and handler: the bit is set or cleared on the CharacterComponent exactly as the client does it (LWOCharacterComponent::SendMessage 0x00d34330): tooltips above 127 are ignored, set = 1 << tooltip, clear = mask ~1 << tooltip (which also clears the lower bits), shifts of 64 or more give 0. - Saved as char@ttip, a 64-bit value (the client reads it with GetLongLongValue in LoadFromSaveData 0x00ca4910). Live wrote it on every character (226 live charxmls: "0" or "16777216" = tooltip 24). Old saves without it load with 0. Check in game: on a new character, trigger a first-time tooltip (e.g. the one about an item or a new area), change zones and log out and back in: the character loads normally and the same tooltip does not come back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -193,6 +193,7 @@ namespace {
|
||||
{ PICKUP_CURRENCY, []() { return std::make_unique<PickupCurrency>(); } },
|
||||
{ MODIFY_PLAYER_ZONE_STATISTIC, []() { return std::make_unique<ModifyPlayerZoneStatistic>(); } },
|
||||
{ UPDATE_PLAYER_STATISTIC, []() { return std::make_unique<UpdatePlayerStatistic>(); } },
|
||||
{ SET_TOOLTIP_FLAG, []() { return std::make_unique<SetTooltipFlag>(); } },
|
||||
{ REPORT_BUG, []() { return std::make_unique<ReportBug>(); } },
|
||||
{ VERIFY_ACK, []() { return std::make_unique<VerifyAck>(); } },
|
||||
|
||||
|
||||
@@ -75,6 +75,22 @@ namespace GameMessages {
|
||||
return bitStream.Read(reputation);
|
||||
}
|
||||
|
||||
void SetTooltipFlag::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(bFlag);
|
||||
bitStream.Write(iToolTip);
|
||||
}
|
||||
|
||||
bool SetTooltipFlag::Deserialize(RakNet::BitStream& bitStream) {
|
||||
VALIDATE_READ(bitStream.Read(bFlag));
|
||||
VALIDATE_READ(bitStream.Read(iToolTip));
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetTooltipFlag::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
||||
auto* const characterComponent = entity.GetComponent<CharacterComponent>();
|
||||
if (characterComponent) characterComponent->SetTooltipFlag(iToolTip, bFlag);
|
||||
}
|
||||
|
||||
void ToggleGMInvis::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(bStateOut);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,18 @@ namespace GameMessages {
|
||||
int64_t reputation{};
|
||||
};
|
||||
|
||||
// Client -> server. The client sets or clears a tooltip's bit in its own flags, then sends SetFlag for the same
|
||||
// ID; the server keeps the bits and saves them as char@ttip, which the client reads on load.
|
||||
struct SetTooltipFlag : public NetGameMsg {
|
||||
SetTooltipFlag() : NetGameMsg(MessageType::Game::SET_TOOLTIP_FLAG) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
void Handle(Entity& entity, const SystemAddress& sysAddr) override;
|
||||
|
||||
bool bFlag{};
|
||||
int32_t iToolTip{};
|
||||
};
|
||||
|
||||
// Server -> client, broadcast.
|
||||
struct ToggleGMInvis : public NetGameMsg {
|
||||
ToggleGMInvis() : NetGameMsg(MessageType::Game::TOGGLE_GM_INVIS) {}
|
||||
|
||||
Reference in New Issue
Block a user