mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 00:20:16 +00:00
feat: add /who results window with sortable player table
Store structured WhoEntry data from SMSG_WHO responses and show them in a dedicated popup window with Name/Guild/Level/Class/Zone columns. Right-click on any row to Whisper, Invite, Add Friend, or Ignore. Window auto-opens when /who or /whois is typed; shows online count in the title bar. Results persist until the next /who query.
This commit is contained in:
parent
2f0fe302bc
commit
367390a852
4 changed files with 137 additions and 14 deletions
|
|
@ -18352,13 +18352,15 @@ void GameHandler::handleWho(network::Packet& packet) {
|
|||
|
||||
LOG_INFO("WHO response: ", displayCount, " players displayed, ", onlineCount, " total online");
|
||||
|
||||
// Store structured results for the who-results window
|
||||
whoResults_.clear();
|
||||
whoOnlineCount_ = onlineCount;
|
||||
|
||||
if (displayCount == 0) {
|
||||
addSystemChatMessage("No players found.");
|
||||
return;
|
||||
}
|
||||
|
||||
addSystemChatMessage(std::to_string(onlineCount) + " player(s) online:");
|
||||
|
||||
for (uint32_t i = 0; i < displayCount; ++i) {
|
||||
if (packet.getReadPos() >= packet.getSize()) break;
|
||||
std::string playerName = packet.readString();
|
||||
|
|
@ -18373,19 +18375,16 @@ void GameHandler::handleWho(network::Packet& packet) {
|
|||
if (packet.getSize() - packet.getReadPos() >= 4)
|
||||
zoneId = packet.readUInt32();
|
||||
|
||||
const char* className = getClassName(static_cast<Class>(classId));
|
||||
// Store structured entry
|
||||
WhoEntry entry;
|
||||
entry.name = playerName;
|
||||
entry.guildName = guildName;
|
||||
entry.level = level;
|
||||
entry.classId = classId;
|
||||
entry.raceId = raceId;
|
||||
entry.zoneId = zoneId;
|
||||
whoResults_.push_back(std::move(entry));
|
||||
|
||||
std::string msg = " " + playerName;
|
||||
if (!guildName.empty())
|
||||
msg += " <" + guildName + ">";
|
||||
msg += " - Level " + std::to_string(level) + " " + className;
|
||||
if (zoneId != 0) {
|
||||
std::string zoneName = getAreaName(zoneId);
|
||||
if (!zoneName.empty())
|
||||
msg += " [" + zoneName + "]";
|
||||
}
|
||||
|
||||
addSystemChatMessage(msg);
|
||||
LOG_INFO(" ", playerName, " (", guildName, ") Lv", level, " Class:", classId,
|
||||
" Race:", raceId, " Zone:", zoneId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue