|
| 1 | +/* |
| 2 | + * Anti-Cheat / Movement-Validation framework — shared definitions. |
| 3 | + * |
| 4 | + * This header carries only enums and small constants so it can be included |
| 5 | + * widely without pulling heavy dependencies. |
| 6 | + */ |
| 7 | + |
| 8 | +#ifndef MANGOS_ANTICHEAT_DEFINES_H |
| 9 | +#define MANGOS_ANTICHEAT_DEFINES_H |
| 10 | + |
| 11 | +#include "Common.h" |
| 12 | + |
| 13 | +// Types of detected violations. Persisted as the `type` column and used as the |
| 14 | +// index into the (config-driven) scoring weights. |
| 15 | +enum AntiCheatViolationType |
| 16 | +{ |
| 17 | + AC_VIOLATION_NONE = 0, |
| 18 | + AC_VIOLATION_SPEED = 1, // horizontal speed beyond allowed + tolerance |
| 19 | + AC_VIOLATION_TELEPORT = 2, // single-packet jump beyond latency-adjusted max |
| 20 | + AC_VIOLATION_VERTICAL = 3, // unexplained upward Z movement (no jump/levitate/fly) |
| 21 | + AC_VIOLATION_FLAG_CONTRADICT = 4, // movement flags that the server never granted |
| 22 | + AC_VIOLATION_PHYSICS = 5, // position implausible vs terrain/liquid/collision |
| 23 | + AC_VIOLATION_DESYNC = 6, // latency drift / time-sync anomaly (informational) |
| 24 | + AC_VIOLATION_JUMP = 7, // illegal mid-air / infinite jump (re-jump while airborne) |
| 25 | + AC_VIOLATION_FALL = 8, // fall-damage suppression (big drop, no FALL_LAND) |
| 26 | + AC_VIOLATION_BURST = 9, // abnormal burst of movement packets (flood/timing) |
| 27 | + AC_VIOLATION_PACKETTIMING = 10, // client movement timestamp inconsistency |
| 28 | + AC_VIOLATION_SPELL = 11, // cast of a spell the player does not have (injection) |
| 29 | + AC_VIOLATION_ITEM = 12, // illegitimate item use (e.g. using an item in the trade window) |
| 30 | + AC_VIOLATION_INTERACT = 13, // interaction beyond range (remote loot/use/interact attempt) |
| 31 | + AC_VIOLATION_BOT = 14, // bot-like movement (snap-to-waypoint + metronomic timing) |
| 32 | + |
| 33 | + AC_VIOLATION_MAX |
| 34 | +}; |
| 35 | + |
| 36 | +// Escalation actions. Also the meaning of the AntiCheat.Action config ceiling: |
| 37 | +// the manager never applies an action above the configured maximum. |
| 38 | +enum AntiCheatAction |
| 39 | +{ |
| 40 | + AC_ACTION_NONE = 0, // disabled |
| 41 | + AC_ACTION_LOG = 1, // record only (log + DB) |
| 42 | + AC_ACTION_GM_ALERT = 2, // notify online GMs |
| 43 | + AC_ACTION_RUBBERBAND = 3, // teleport player back to last validated position |
| 44 | + AC_ACTION_KICK = 4 // disconnect the session |
| 45 | +}; |
| 46 | + |
| 47 | +// Result of the physics-plausibility stage. |
| 48 | +enum AntiCheatPhysicsResult |
| 49 | +{ |
| 50 | + AC_PHYS_OK = 0, // position is plausible for the current move state |
| 51 | + AC_PHYS_SUSPECT = 1, // borderline; raise confidence but light weight |
| 52 | + AC_PHYS_IMPOSSIBLE = 2 // cannot legitimately occupy this position |
| 53 | +}; |
| 54 | + |
| 55 | +// Normalised movement state derived once from MovementInfo flags, so every |
| 56 | +// detector reasons over the same interpretation rather than re-reading flags. |
| 57 | +enum AntiCheatMoveState |
| 58 | +{ |
| 59 | + AC_MOVE_GROUND = 0, |
| 60 | + AC_MOVE_SWIM = 1, |
| 61 | + AC_MOVE_FALL = 2, |
| 62 | + AC_MOVE_FLY = 3, |
| 63 | + AC_MOVE_TRANSPORT = 4 |
| 64 | +}; |
| 65 | + |
| 66 | +#endif // MANGOS_ANTICHEAT_DEFINES_H |
0 commit comments