mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: improve calendar lockout and char rename messages
- SMSG_CALENDAR_RAID_LOCKOUT_ADDED: show dungeon name (from Map.dbc)
and difficulty label (Normal/Heroic/25-Man/25-Man Heroic)
- SMSG_CALENDAR_RAID_LOCKOUT_REMOVED: show dungeon name instead of raw
map ID; now emits a chat message (was silent/LOG_DEBUG only)
- SMSG_CHAR_RENAME: map result codes 1-7 to human-readable strings
("Name already in use.", "Name too short.", etc.) instead of
"Character rename failed (error N)."
This commit is contained in:
parent
2c72d8462d
commit
2be793cfba
1 changed files with 30 additions and 6 deletions
|
|
@ -2261,7 +2261,20 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
if (result == 0) {
|
||||
addSystemChatMessage("Character name changed to: " + newName);
|
||||
} else {
|
||||
addSystemChatMessage("Character rename failed (error " + std::to_string(result) + ").");
|
||||
// ResponseCodes for name changes (shared with char create)
|
||||
static const char* kRenameErrors[] = {
|
||||
nullptr, // 0 = success
|
||||
"Name already in use.", // 1
|
||||
"Name too short.", // 2
|
||||
"Name too long.", // 3
|
||||
"Name contains invalid characters.", // 4
|
||||
"Name contains a profanity.", // 5
|
||||
"Name is reserved.", // 6
|
||||
"Character name does not meet requirements.", // 7
|
||||
};
|
||||
const char* errMsg = (result < 8) ? kRenameErrors[result] : nullptr;
|
||||
addSystemChatMessage(errMsg ? std::string("Rename failed: ") + errMsg
|
||||
: "Character rename failed.");
|
||||
}
|
||||
LOG_INFO("SMSG_CHAR_RENAME: result=", result, " newName=", newName);
|
||||
}
|
||||
|
|
@ -7458,10 +7471,14 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
uint32_t mapId = packet.readUInt32();
|
||||
uint32_t difficulty = packet.readUInt32();
|
||||
/*uint64_t resetTime =*/ packet.readUInt64();
|
||||
char buf[128];
|
||||
std::snprintf(buf, sizeof(buf),
|
||||
"Calendar: Raid lockout added for map %u (difficulty %u).", mapId, difficulty);
|
||||
addSystemChatMessage(buf);
|
||||
std::string mapLabel = getMapName(mapId);
|
||||
if (mapLabel.empty()) mapLabel = "map #" + std::to_string(mapId);
|
||||
static const char* kDiff[] = {"Normal","Heroic","25-Man","25-Man Heroic"};
|
||||
const char* diffStr = (difficulty < 4) ? kDiff[difficulty] : nullptr;
|
||||
std::string msg = "Calendar: Raid lockout added for " + mapLabel;
|
||||
if (diffStr) msg += std::string(" (") + diffStr + ")";
|
||||
msg += '.';
|
||||
addSystemChatMessage(msg);
|
||||
LOG_DEBUG("SMSG_CALENDAR_RAID_LOCKOUT_ADDED: mapId=", mapId, " difficulty=", difficulty);
|
||||
}
|
||||
packet.setReadPos(packet.getSize());
|
||||
|
|
@ -7474,7 +7491,14 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
/*uint64_t eventId =*/ packet.readUInt64();
|
||||
uint32_t mapId = packet.readUInt32();
|
||||
uint32_t difficulty = packet.readUInt32();
|
||||
(void)mapId; (void)difficulty;
|
||||
std::string mapLabel = getMapName(mapId);
|
||||
if (mapLabel.empty()) mapLabel = "map #" + std::to_string(mapId);
|
||||
static const char* kDiff[] = {"Normal","Heroic","25-Man","25-Man Heroic"};
|
||||
const char* diffStr = (difficulty < 4) ? kDiff[difficulty] : nullptr;
|
||||
std::string msg = "Calendar: Raid lockout removed for " + mapLabel;
|
||||
if (diffStr) msg += std::string(" (") + diffStr + ")";
|
||||
msg += '.';
|
||||
addSystemChatMessage(msg);
|
||||
LOG_DEBUG("SMSG_CALENDAR_RAID_LOCKOUT_REMOVED: mapId=", mapId,
|
||||
" difficulty=", difficulty);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue