Skip to content

Speed hack improvements): implement walk and attack speedhack anti-cheat checks#813

Open
Rhefew wants to merge 1 commit into
MUnique:masterfrom
Rhefew:feature/speedhack-anti-cheat
Open

Speed hack improvements): implement walk and attack speedhack anti-cheat checks#813
Rhefew wants to merge 1 commit into
MUnique:masterfrom
Rhefew:feature/speedhack-anti-cheat

Conversation

@Rhefew

@Rhefew Rhefew commented Jul 5, 2026

Copy link
Copy Markdown

This PR introduces real-time anti-cheat checks for player movement (walking) and skill casting (attacks) to identify and prevent speed-hacking.

Walk Speed Checks:

  • Keeps a rolling history of the player's recent walks (_recentWalks).
  • Computes expected travel times using the player's dynamic client movement speed (factoring in underwater stats, safezone overrides, and speed attributes).
  • Automatically flags walks that occur too rapidly or have abnormal start coordinate offsets, warps/rubberbands players back, and records warning violations leading to an account ban if limits are exceeded.

Attack Speed Checks:

  • Compares attack/skill cast intervals against the expected timing of the player's current Stats.AttackSpeed attribute.
  • Applies checks across normal hits, targeted skills, and area skills.
    Verification & Unit Tests:
  • Adds SpeedHackAntiCheatTests.cs covering safezone bypasses, normal/mount speed variations, warp resets, attack speedhack detection, and automatic account bans.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces server-side anti-cheat mechanisms to prevent speed-hacking in both movement and combat. By validating player actions against expected thresholds and implementing a penalty system that includes rubberbanding and account bans, the changes ensure game integrity and discourage malicious client modifications.

Highlights

  • Walk Speed Anti-Cheat: Implemented a rolling history of movement and travel time validation to detect and penalize players moving faster than their attributes allow.
  • Attack Speed Anti-Cheat: Integrated a token bucket rate limiter to validate attack and skill casting intervals against player stats.
  • Automated Testing: Added comprehensive unit tests covering walk speed hacks, attack speed hacks, safezone bypasses, and automatic account banning.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces speed hack and attack speed hack detection mechanisms for players, using a token bucket rate limiter for attacks and a cumulative Chebyshev path length check for walking speed. The feedback highlights critical thread-safety issues, as several shared fields and queues are accessed concurrently without synchronization. Additionally, a logic error in the walk speed check was identified where capping the expected step delay at 50ms could lead to false-positive bans for legitimate high-speed characters. Finally, the reviewer pointed out some unused constants and properties that should be cleaned up.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs
Comment thread src/GameLogic/Player.cs
Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Player.cs Outdated
@Rhefew Rhefew force-pushed the feature/speedhack-anti-cheat branch 3 times, most recently from e2f252e to 284ab67 Compare July 5, 2026 09:10
@Rhefew Rhefew force-pushed the feature/speedhack-anti-cheat branch from 284ab67 to fefed4f Compare July 5, 2026 09:15
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