HackPacketCheck.txt

Per-opcode anti-cheat packet rules. For each incoming packet, the server looks up the row keyed by opcode (and optional subcode), validates the encryption flag, then applies a two-threshold rate limiter: log-and-reject at MinCount, disconnect at MaxCount.

File Location#

Data/Hack/HackPacketCheck.txt

Loaded once at GameServer startup. Changes require a restart.

Format#

Plain text, whitespace-delimited, one packet rule per row. Comment lines start with //. File ends with end.

//Index   Value   Encrypt   MaxDelay   MinCount   MaxCount   //Comment
0         *       0         2000       3          5          //Chat message - anti spam
19        *       0         150        25         40         //Skill attack

Columns#

ColumnTypeEffect
Indexint 0-255Packet opcode (also used for extended opcode headers like 0xF1, 0xF3, etc.)
Valueint or *Subcode filter. * = applies to all subcodes, number = match that subcode only. You may define a wildcard row plus specific subcode rows for the same opcode; the specific row wins for matching subcodes
Encrypt0, 1, or *0 = packet must arrive unencrypted, 1 = packet must arrive with valid encryption, * = no encryption check
MaxDelayint msRate-limiting window length. 0 disables the rate limiter for this row
MinCountintLog-and-reject threshold. The MinCount+1-th packet in the window is dropped and logged. 0 disables this check
MaxCountintDisconnect threshold. The MaxCount+1-th packet in the window drops the connection. 0 disables this check

Rate-Limit Math#

For each packet arrival:

  1. If the opcode has no row in this file, log an "unknown packet" hack entry and disconnect.
  2. If Encrypt is 0 or 1 and the packet's actual encryption does not match, log and disconnect.
  3. Serial check (always on, independent of this file): if the packet's serial is invalid, log and disconnect.
  4. If the current time is past the window (MaxDelay ms since the first packet of the window), reset the counter and timestamp.
  5. Increment the counter. If it now exceeds MinCount, log and reject the packet. If it also exceeds MaxCount, additionally disconnect.
  6. Otherwise accept the packet.

Example: Index=0, MaxDelay=2000, MinCount=3, MaxCount=5 accepts the first 3 chat packets per 2-second window, drops the 4th and 5th with a hack log entry, and disconnects on the 6th.

Packet Categories#

The shipped file groups opcodes by function. Categories are cosmetic comments only; the engine treats every row independently.

RangeCategory
0x00-0x0FLogin / character
0x10-0x1EMovement / action (combat 0x13-0x1A has the tightest limits)
0x1F-0x2FItem / inventory
0x30-0x3FNPC / shop
0x40-0x4FParty / guild
0x50-0x5FTrade
0x80-0x8FStorage
0xC0-0xCFChat
0xEC, 0xF1, 0xF3Extended / GDS / system handlers

Examples#

0         *       0         2000       3          5          //Chat message

Chat allows 3 messages per 2-second window. The 4th and 5th are dropped with a hack log entry. The 6th disconnects.

Relationship to Common.dat Hack Settings#

Common.dat Hack Settings govern behavioral anti-cheat (attack speed reporting, potion spam tracking, combo timing, serial seeds). This file governs packet-level rate limits and the encryption/plaintext contract.

Movement speed hacking is handled by always-on detectors (not configurable via either file).

Cross-File Dependencies#

ValueRelated in
Encrypt=1 rowsUse the encryption blobs at Data/Hack/Dec1.dat and Enc2.dat
Hack log linesGated by Common.dat WriteHackLog
Behavioral anti-cheatCommon.dat Hack Settings
Chat spam filtersFilter.txt complements the opcode-0 rate limiter by blocking disallowed words

Common Issues#

  • Legit players randomly disconnected during combat - MaxCount too low on opcode 19 (skill attack) or 20 (normal attack); raise in small increments.
  • All packets for an opcode rejected after adding a row - row uses Encrypt=0 while the client sends that opcode encrypted, or vice versa. Set Encrypt=* to disable the check.
  • Opcode disconnects immediately with "unknown" in hack log - opcode has no row at all. Every handled opcode must have at least one entry (wildcard row is fine).
  • Chat spam not blocked - opcode 0 row has MaxDelay=0 or both count thresholds too high. Combine with Filter.txt for word-level filtering.
  • Encrypt=1 packets always rejected - encryption blobs missing or corrupt in Data/Hack/, or the client build does not encrypt this opcode.
  • Warnings flood the log with no useful signal - MinCount set too low; raise it to reduce noise while keeping MaxCount at the disconnect threshold.
  • File edits ignored - a row has fewer than 6 columns; the parser aborts on the malformed row (error popup at startup). Check the server console for the script error line number.
  • Different players hit limits at different times - rate window is per-player, measured from their own most recent window reset. There are no shared/global limits in this file.

Last updated April 21, 2026