mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
Fix chat sender names via name queries
This commit is contained in:
parent
bcfc075e1e
commit
e4cd7433d7
1 changed files with 12 additions and 0 deletions
|
|
@ -3739,6 +3739,11 @@ void GameHandler::handleMessageChat(network::Packet& packet) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If still unknown, proactively query the server so the UI can show names soon after.
|
||||||
|
if (data.senderName.empty()) {
|
||||||
|
queryPlayerName(data.senderGuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add to chat history
|
// Add to chat history
|
||||||
|
|
@ -4825,6 +4830,13 @@ void GameHandler::handleNameQueryResponse(network::Packet& packet) {
|
||||||
auto player = std::static_pointer_cast<Player>(entity);
|
auto player = std::static_pointer_cast<Player>(entity);
|
||||||
player->setName(data.name);
|
player->setName(data.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Backfill chat history entries that arrived before we knew the name.
|
||||||
|
for (auto& msg : chatHistory) {
|
||||||
|
if (msg.senderGuid == data.guid && msg.senderName.empty()) {
|
||||||
|
msg.senderName = data.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue