mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: send CMSG_SET_WATCHED_FACTION when tracking a reputation
setWatchedFactionId() previously only stored the faction locally. Now it also sends CMSG_SET_WATCHED_FACTION with the correct repListId to the server, so the tracked faction persists across sessions.
This commit is contained in:
parent
ae56f2eb80
commit
f4d705738b
2 changed files with 16 additions and 1 deletions
|
|
@ -1800,7 +1800,7 @@ public:
|
|||
|
||||
const std::string& getFactionNamePublic(uint32_t factionId) const;
|
||||
uint32_t getWatchedFactionId() const { return watchedFactionId_; }
|
||||
void setWatchedFactionId(uint32_t id) { watchedFactionId_ = id; }
|
||||
void setWatchedFactionId(uint32_t factionId);
|
||||
uint32_t getLastContactListMask() const { return lastContactListMask_; }
|
||||
uint32_t getLastContactListCount() const { return lastContactListCount_; }
|
||||
bool isServerMovementAllowed() const { return serverMovementAllowed_; }
|
||||
|
|
|
|||
|
|
@ -25737,6 +25737,21 @@ uint32_t GameHandler::getRepListIdByFactionId(uint32_t factionId) const {
|
|||
return (it != factionIdToRepList_.end()) ? it->second : 0xFFFFFFFFu;
|
||||
}
|
||||
|
||||
void GameHandler::setWatchedFactionId(uint32_t factionId) {
|
||||
watchedFactionId_ = factionId;
|
||||
if (state != WorldState::IN_WORLD || !socket) return;
|
||||
// CMSG_SET_WATCHED_FACTION: int32 repListId (-1 = unwatch)
|
||||
int32_t repListId = -1;
|
||||
if (factionId != 0) {
|
||||
uint32_t rl = getRepListIdByFactionId(factionId);
|
||||
if (rl != 0xFFFFFFFFu) repListId = static_cast<int32_t>(rl);
|
||||
}
|
||||
network::Packet pkt(wireOpcode(Opcode::CMSG_SET_WATCHED_FACTION));
|
||||
pkt.writeUInt32(static_cast<uint32_t>(repListId));
|
||||
socket->send(pkt);
|
||||
LOG_DEBUG("CMSG_SET_WATCHED_FACTION: repListId=", repListId, " (factionId=", factionId, ")");
|
||||
}
|
||||
|
||||
std::string GameHandler::getFactionName(uint32_t factionId) const {
|
||||
auto it = factionNameCache_.find(factionId);
|
||||
if (it != factionNameCache_.end()) return it->second;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue