Skip to content

Conversation

@Pospelove
Copy link
Contributor

@Pospelove Pospelove commented Dec 11, 2025

Important

Introduces splash attack detection in OnWeaponHit() to limit rapid attacks on multiple targets, updating MpActor to track hit times and count recent hits.

  • Behavior:
    • Adds splash attack detection in OnWeaponHit() in ActionListener.cpp to handle rapid attacks on multiple targets.
    • Limits splash attacks to kMaxSplashTargets (4) within kSplashTimeWindow (0.1s).
    • Logs splash attack detection and ignores attacks if too many targets are hit recently.
  • Models:
    • Modifies MpActor to track last hit times per target and overall in MpActor.cpp.
    • Adds CountRecentHits() to count hits within a time window.
  • Functions:
    • Updates GetLastHitTime() and SetLastHitTime() in MpActor to handle target-specific hit times.
    • Adds CountRecentHits() to MpActor to support splash attack logic.

This description was created by Ellipsis for d02408f. You can customize this summary. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to d02408f in 1 minute and 55 seconds. Click for details.
  • Reviewed 151 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. skymp5-server/cpp/server_guest_lib/MpActor.cpp:694
  • Draft comment:
    In GetLastHitTime, if no matching target is found the default time_point (epoch) is returned. Confirm that this default is intended, as it can result in a large duration.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is asking the PR author to "confirm" something, which violates the rule: "Do NOT ask the PR author to confirm their intention, to explain, to double-check things, to ensure the behavior is intended." The comment doesn't identify a definite bug - returning epoch as a sentinel value is a common pattern in C++ when dealing with time points. The author likely intended this behavior as a way to indicate "no hit found." The comment is speculative ("can result in a large duration") rather than pointing to actual problematic code. This type of comment should be deleted according to the rules. Could there be a legitimate concern here? If callers compute durations from this epoch time point, they would get very large durations. However, without seeing the calling code, I can't determine if this is actually a problem. The author may have intentionally used epoch as a sentinel value that callers check for. Even if there's a potential issue with how callers use this return value, the comment violates the explicit rule against asking authors to confirm intentions. The rules state I need "STRONG EVIDENCE that the comment is correct" to keep it. Without seeing caller code that mishandles the epoch return value, I don't have strong evidence of a bug. The comment is speculative and asks for confirmation rather than pointing to a definite issue. This comment should be deleted because it asks the PR author to confirm their intention rather than identifying a clear code issue. It's speculative about potential problems without demonstrating actual problematic usage. The rules explicitly prohibit comments that ask authors to verify, confirm, or ensure their intentions.
2. skymp5-server/cpp/server_guest_lib/MpActor.cpp:718
  • Draft comment:
    SetLastHitTime uses a linear search on a list capped at 16 entries. This is acceptable given the cap, but consider a comment or alternative if future requirements might increase the number of entries.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
3. skymp5-server/cpp/server_guest_lib/MpActor.cpp:1998
  • Draft comment:
    CountRecentHits iterates the entire hit list without cleaning up old entries. Given the maximum size is 16, this is likely acceptable, but consider cleanup for clarity if behavior changes.
  • Reason this comment was not posted:
    Confidence changes required: 40% <= threshold 50% None
4. skymp5-server/cpp/server_guest_lib/ActionListener.cpp:1150
  • Draft comment:
    The splash attack detection logic—using timePassedAnyTarget and CountRecentHits—appears reasonable. Ensure that the chosen thresholds (kSplashTimeWindow=0.1s and kMaxSplashTargets=4) are tuned to avoid false positives.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None

Workflow ID: wflow_y1B9MCiD5HZttUTg

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

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.

1 participant