Skip to content

fix: record say and yell chat again, filter out the private one - #30

Merged
Helias merged 1 commit into
mainfrom
fix/replay-say-yell-only
Aug 7, 2026
Merged

Helias merged 1 commit into
mainfrom
fix/replay-say-yell-only

Conversation

@Helias

@Helias Helias commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

#22 fixed whispers and guild chat leaking into replays (#18), but it did it by dropping SMSG_MESSAGECHAT from the watch list, so says and yells are gone from replays too. Those are worth keeping, everyone in the arena hears them anyway.

So instead of filtering by opcode, this filters by chat type. It's the first byte of the packet, see ChatHandler::BuildChatPacket, so no real parsing needed.

Recorded: say, yell, emote, text emote and the monster variants.
Not recorded: whisper, party, raid, guild, officer, channel, and everything else. That also covers the arena spectator addon, which sends its data as CHAT_MSG_WHISPER + LANG_ADDON.

The check also runs when a replay is loaded from the DB, so old matches recorded back when every chat type went in now play back without the private stuff.

Closes #18

Tested

Needs an in game pass: say/yell during a match should show up in the replay, whisper/party/guild should not, and a replay saved before this change should no longer leak them either.

Summary by CodeRabbit

  • New Features

    • Arena replays now capture local and public chat messages.
  • Bug Fixes

    • Excludes empty, private, and addon chat messages from newly recorded replays.
    • Filters private chat messages from existing replays during playback.

PR #22 dropped SMSG_MESSAGECHAT from the watch list entirely, so replays lost
say and yell along with the whispers they were meant to hide.

Keep the opcode and filter on the chat type instead, which is the first byte of
the payload: say, yell and emotes are recorded, whisper, party, guild, officer
and channel are not. The filter also runs when a replay is loaded, so matches
stored before this still play back without the private chat.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Arena replay packet capture now records SMSG_MESSAGECHAT selectively. Local and public non-empty chat is retained, while private, addon, and empty chat is excluded during capture and replay deserialization.

Changes

Arena replay chat filtering

Layer / File(s) Summary
Define replayable chat packets
src/ArenaReplay.cpp
The replay watch list includes SMSG_MESSAGECHAT. IsReplayableChatPacket accepts local and public non-empty chat and rejects private or empty chat.
Apply chat filtering to replay data
src/ArenaReplay.cpp
Packet capture skips rejected chat packets. Replay deserialization applies the same filter to existing replay data.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: laasker

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes restoring public chat recording while filtering private chat messages.
Linked Issues check ✅ Passed The change filters guild, whisper, addon, and other private chat from recording and replay, satisfying issue #18.
Out of Scope Changes check ✅ Passed The changes remain within the chat filtering and replay requirements described in issue #18.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/replay-say-yell-only

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/ArenaReplay.cpp`:
- Around line 172-174: Update the chat capture flow around
IsReplayableChatPacket so public chat events are recorded only once, using a
canonical recipient or deduplicating the event before appending to
record.packets; preserve the existing per-team capture behavior for
team-specific packets.
- Around line 105-117: Update the packet validation around the chat-type switch
in ArenaReplay to parse the length-prefixed message and reject packets whose
emote text is empty before returning true. Preserve the existing allowlist for
non-empty supported chat types and continue returning false for unsupported or
malformed messages.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 03fe46bd-aaa8-49ee-b73b-aab7a74b60b3

📥 Commits

Reviewing files that changed from the base of the PR and between 370f5ec and 79fa9fa.

📒 Files selected for processing (1)
  • src/ArenaReplay.cpp

Comment thread src/ArenaReplay.cpp
Comment on lines +105 to +117
switch (packet.contents()[0])
{
case CHAT_MSG_SAY:
case CHAT_MSG_YELL:
case CHAT_MSG_EMOTE:
case CHAT_MSG_TEXT_EMOTE:
case CHAT_MSG_MONSTER_SAY:
case CHAT_MSG_MONSTER_YELL:
case CHAT_MSG_MONSTER_EMOTE:
return true;
default:
return false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject empty emote messages.

The allowlist checks only the chat type. Player::TextEmote can send an empty CHAT_MSG_EMOTE packet to the other team. That packet passes this switch and is stored for replay. Parse the length-prefixed message and reject empty text before accepting the packet. (raw.githubusercontent.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ArenaReplay.cpp` around lines 105 - 117, Update the packet validation
around the chat-type switch in ArenaReplay to parse the length-prefixed message
and reject packets whose emote text is empty before returning true. Preserve the
existing allowlist for non-empty supported chat types and continue returning
false for unsupported or malformed messages.

Comment thread src/ArenaReplay.cpp
Comment on lines +172 to +174
if (!IsReplayableChatPacket(packet))
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Deduplicate public chat before applying the per-team capture rule.

The capture loop records each watched packet for one reference player per team. Player::Say and Player::Yell broadcast the same SMSG_MESSAGECHAT to TeamFilter::All, so each public message can be stored twice. Capture chat from one canonical recipient or deduplicate the chat event before appending it to record.packets. (raw.githubusercontent.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ArenaReplay.cpp` around lines 172 - 174, Update the chat capture flow
around IsReplayableChatPacket so public chat events are recorded only once,
using a canonical recipient or deduplicating the event before appending to
record.packets; preserve the existing per-team capture behavior for
team-specific packets.

@Helias
Helias merged commit aa0b00e into main Aug 7, 2026
2 checks passed
@Helias
Helias deleted the fix/replay-say-yell-only branch August 7, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watching replays also replays chat messages it shouldn't.

1 participant