mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
fix: show zone names in hearthstone bind messages, add playerNameCache to duel challenger
- SMSG_BINDPOINTUPDATE: show zone name in \"Your home has been set to X.\" (was just \"Your home has been set.\") - SMSG_PLAYERBOUND: replace \"map N, zone N\" raw IDs with zone name lookup - SMSG_BINDER_CONFIRM: suppress redundant \"This innkeeper is now your home location.\" since SMSG_PLAYERBOUND fires immediately after with zone context - SMSG_DUEL_REQUESTED: add playerNameCache fallback before hex GUID for challenger name
This commit is contained in:
parent
ecc02595de
commit
9216a6da28
1 changed files with 20 additions and 8 deletions
|
|
@ -2196,17 +2196,19 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
// uint64 binderGuid + uint32 mapId + uint32 zoneId
|
// uint64 binderGuid + uint32 mapId + uint32 zoneId
|
||||||
if (packet.getSize() - packet.getReadPos() < 16) break;
|
if (packet.getSize() - packet.getReadPos() < 16) break;
|
||||||
/*uint64_t binderGuid =*/ packet.readUInt64();
|
/*uint64_t binderGuid =*/ packet.readUInt64();
|
||||||
uint32_t mapId = packet.readUInt32();
|
/*uint32_t mapId =*/ packet.readUInt32();
|
||||||
uint32_t zoneId = packet.readUInt32();
|
uint32_t zoneId = packet.readUInt32();
|
||||||
char buf[128];
|
std::string pbMsg = "Your home location has been set";
|
||||||
std::snprintf(buf, sizeof(buf),
|
std::string zoneName = getAreaName(zoneId);
|
||||||
"Your home location has been set (map %u, zone %u).", mapId, zoneId);
|
if (!zoneName.empty())
|
||||||
addSystemChatMessage(buf);
|
pbMsg += " to " + zoneName;
|
||||||
|
pbMsg += '.';
|
||||||
|
addSystemChatMessage(pbMsg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Opcode::SMSG_BINDER_CONFIRM: {
|
case Opcode::SMSG_BINDER_CONFIRM: {
|
||||||
// uint64 npcGuid — server confirming bind point has been set
|
// uint64 npcGuid — fires just before SMSG_PLAYERBOUND; PLAYERBOUND shows
|
||||||
addSystemChatMessage("This innkeeper is now your home location.");
|
// the zone name so this confirm is redundant. Consume silently.
|
||||||
packet.setReadPos(packet.getSize());
|
packet.setReadPos(packet.getSize());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -3529,7 +3531,12 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
bindPointCallback_(data.mapId, canonical.x, canonical.y, canonical.z);
|
bindPointCallback_(data.mapId, canonical.x, canonical.y, canonical.z);
|
||||||
}
|
}
|
||||||
if (wasSet) {
|
if (wasSet) {
|
||||||
addSystemChatMessage("Your home has been set.");
|
std::string bindMsg = "Your home has been set";
|
||||||
|
std::string zoneName = getAreaName(data.zoneId);
|
||||||
|
if (!zoneName.empty())
|
||||||
|
bindMsg += " to " + zoneName;
|
||||||
|
bindMsg += '.';
|
||||||
|
addSystemChatMessage(bindMsg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_WARNING("Failed to parse SMSG_BINDPOINTUPDATE");
|
LOG_WARNING("Failed to parse SMSG_BINDPOINTUPDATE");
|
||||||
|
|
@ -12034,6 +12041,11 @@ void GameHandler::handleDuelRequested(network::Packet& packet) {
|
||||||
if (auto* unit = dynamic_cast<Unit*>(entity.get())) {
|
if (auto* unit = dynamic_cast<Unit*>(entity.get())) {
|
||||||
duelChallengerName_ = unit->getName();
|
duelChallengerName_ = unit->getName();
|
||||||
}
|
}
|
||||||
|
if (duelChallengerName_.empty()) {
|
||||||
|
auto nit = playerNameCache.find(duelChallengerGuid_);
|
||||||
|
if (nit != playerNameCache.end())
|
||||||
|
duelChallengerName_ = nit->second;
|
||||||
|
}
|
||||||
if (duelChallengerName_.empty()) {
|
if (duelChallengerName_.empty()) {
|
||||||
char tmp[32];
|
char tmp[32];
|
||||||
std::snprintf(tmp, sizeof(tmp), "0x%llX",
|
std::snprintf(tmp, sizeof(tmp), "0x%llX",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue