mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Handle SMSG_SERVER_MESSAGE, SMSG_CHAT_SERVER_MESSAGE, SMSG_AREA_TRIGGER_MESSAGE, SMSG_TRIGGER_CINEMATIC
- SMSG_SERVER_MESSAGE: parse type+string, show as [Server] chat message - SMSG_CHAT_SERVER_MESSAGE: parse type+string, show as [Announcement] - SMSG_AREA_TRIGGER_MESSAGE: parse len+string, display as system chat - SMSG_TRIGGER_CINEMATIC: consume silently (no cinematic playback)
This commit is contained in:
parent
3114e80fa8
commit
b4f6ca2ca7
1 changed files with 33 additions and 0 deletions
|
|
@ -2193,6 +2193,39 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Opcode::SMSG_SERVER_MESSAGE: {
|
||||||
|
// uint32 type, string message
|
||||||
|
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||||
|
/*uint32_t msgType =*/ packet.readUInt32();
|
||||||
|
std::string msg = packet.readString();
|
||||||
|
if (!msg.empty()) addSystemChatMessage("[Server] " + msg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Opcode::SMSG_CHAT_SERVER_MESSAGE: {
|
||||||
|
// uint32 type + string text
|
||||||
|
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||||
|
/*uint32_t msgType =*/ packet.readUInt32();
|
||||||
|
std::string msg = packet.readString();
|
||||||
|
if (!msg.empty()) addSystemChatMessage("[Announcement] " + msg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Opcode::SMSG_AREA_TRIGGER_MESSAGE: {
|
||||||
|
// uint32 size, then string
|
||||||
|
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||||
|
/*uint32_t len =*/ packet.readUInt32();
|
||||||
|
std::string msg = packet.readString();
|
||||||
|
if (!msg.empty()) addSystemChatMessage(msg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Opcode::SMSG_TRIGGER_CINEMATIC:
|
||||||
|
// uint32 cinematicId — we don't play cinematics; consume and skip.
|
||||||
|
packet.setReadPos(packet.getSize());
|
||||||
|
LOG_DEBUG("SMSG_TRIGGER_CINEMATIC: skipped");
|
||||||
|
break;
|
||||||
|
|
||||||
case Opcode::SMSG_LOOT_MONEY_NOTIFY: {
|
case Opcode::SMSG_LOOT_MONEY_NOTIFY: {
|
||||||
// Format: uint32 money + uint8 soleLooter
|
// Format: uint32 money + uint8 soleLooter
|
||||||
if (packet.getSize() - packet.getReadPos() >= 4) {
|
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue