mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
Implement MSG_RAID_READY_CHECK_CONFIRM and MSG_RAID_READY_CHECK_FINISHED
Track individual member ready/not-ready responses in chat and summarize results when all members have responded to the ready check.
This commit is contained in:
parent
95e8fcb88e
commit
3f64f81ec0
2 changed files with 37 additions and 5 deletions
|
|
@ -1786,7 +1786,9 @@ private:
|
||||||
uint32_t lfgTimeInQueueMs_= 0; // ms already in queue
|
uint32_t lfgTimeInQueueMs_= 0; // ms already in queue
|
||||||
|
|
||||||
// Ready check state
|
// Ready check state
|
||||||
bool pendingReadyCheck_ = false;
|
bool pendingReadyCheck_ = false;
|
||||||
|
uint32_t readyCheckReadyCount_ = 0;
|
||||||
|
uint32_t readyCheckNotReadyCount_ = 0;
|
||||||
std::string readyCheckInitiator_;
|
std::string readyCheckInitiator_;
|
||||||
|
|
||||||
// Faction standings (factionId → absolute standing value)
|
// Faction standings (factionId → absolute standing value)
|
||||||
|
|
|
||||||
|
|
@ -2724,7 +2724,9 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
case Opcode::MSG_RAID_READY_CHECK: {
|
case Opcode::MSG_RAID_READY_CHECK: {
|
||||||
// Server is broadcasting a ready check (someone in the raid initiated it).
|
// Server is broadcasting a ready check (someone in the raid initiated it).
|
||||||
// Payload: empty body, or optional uint64 initiator GUID in some builds.
|
// Payload: empty body, or optional uint64 initiator GUID in some builds.
|
||||||
pendingReadyCheck_ = true;
|
pendingReadyCheck_ = true;
|
||||||
|
readyCheckReadyCount_ = 0;
|
||||||
|
readyCheckNotReadyCount_ = 0;
|
||||||
readyCheckInitiator_.clear();
|
readyCheckInitiator_.clear();
|
||||||
if (packet.getSize() - packet.getReadPos() >= 8) {
|
if (packet.getSize() - packet.getReadPos() >= 8) {
|
||||||
uint64_t initiatorGuid = packet.readUInt64();
|
uint64_t initiatorGuid = packet.readUInt64();
|
||||||
|
|
@ -2745,10 +2747,38 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
LOG_INFO("MSG_RAID_READY_CHECK: initiator=", readyCheckInitiator_);
|
LOG_INFO("MSG_RAID_READY_CHECK: initiator=", readyCheckInitiator_);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Opcode::MSG_RAID_READY_CHECK_CONFIRM:
|
case Opcode::MSG_RAID_READY_CHECK_CONFIRM: {
|
||||||
// Another member responded to the ready check — consume.
|
// guid (8) + uint8 isReady (0=not ready, 1=ready)
|
||||||
packet.setReadPos(packet.getSize());
|
if (packet.getSize() - packet.getReadPos() < 9) { packet.setReadPos(packet.getSize()); break; }
|
||||||
|
uint64_t respGuid = packet.readUInt64();
|
||||||
|
uint8_t isReady = packet.readUInt8();
|
||||||
|
if (isReady) ++readyCheckReadyCount_;
|
||||||
|
else ++readyCheckNotReadyCount_;
|
||||||
|
auto nit = playerNameCache.find(respGuid);
|
||||||
|
std::string rname;
|
||||||
|
if (nit != playerNameCache.end()) rname = nit->second;
|
||||||
|
else {
|
||||||
|
auto ent = entityManager.getEntity(respGuid);
|
||||||
|
if (ent) rname = std::static_pointer_cast<game::Unit>(ent)->getName();
|
||||||
|
}
|
||||||
|
if (!rname.empty()) {
|
||||||
|
char rbuf[128];
|
||||||
|
std::snprintf(rbuf, sizeof(rbuf), "%s is %s.", rname.c_str(), isReady ? "Ready" : "Not Ready");
|
||||||
|
addSystemChatMessage(rbuf);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case Opcode::MSG_RAID_READY_CHECK_FINISHED: {
|
||||||
|
// Ready check complete — summarize results
|
||||||
|
char fbuf[128];
|
||||||
|
std::snprintf(fbuf, sizeof(fbuf), "Ready check complete: %u ready, %u not ready.",
|
||||||
|
readyCheckReadyCount_, readyCheckNotReadyCount_);
|
||||||
|
addSystemChatMessage(fbuf);
|
||||||
|
pendingReadyCheck_ = false;
|
||||||
|
readyCheckReadyCount_ = 0;
|
||||||
|
readyCheckNotReadyCount_ = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Opcode::SMSG_RAID_INSTANCE_INFO:
|
case Opcode::SMSG_RAID_INSTANCE_INFO:
|
||||||
handleRaidInstanceInfo(packet);
|
handleRaidInstanceInfo(packet);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue