Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two critical behavior diffs which break ac checks #1008

Open
NexiusTailer opened this issue Oct 20, 2024 · 0 comments
Open

Two critical behavior diffs which break ac checks #1008

NexiusTailer opened this issue Oct 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NexiusTailer
Copy link
Contributor

NexiusTailer commented Oct 20, 2024

Describe the bug
There are a couple of problems in omp server behavior which produce false detections for the server-side anticheat and actually can be (and should be) fixed on the side of omp server itself.

The first issue appears when the player was in spectating mode and leaves from it, the server instantly sets him PLAYER_STATE_NONE which must not be used anywhere except as a bare "just-after-connection" state (when no any other state were set before), because this is the only documented behavior in samp server for this state. Setting it between two other states while playing leads to ruining anticheat logic if it tries to make sane checks (like checks for skipping PLAYER_STATE_SPAWNED, when cheaters send onfoot sync just after connection). The place where this kludge is located is probably here.

The second issue was found recently, but seems it persist for a long time too, it's when the server gives a player any non-bullet weapon (for example, brass knuckles or any melee like chainsaw, flowers etc) with ammo set to 0. After player received such weapon in hands, he can switch his current weapon to any other slot and then switch back to new weapon to hold it again. Just after these actions GetPlayerWeapon, GetPlayerAmmo and other functions will return 0 as server cleared the whole slot from both weapon and ammo, probably because ammo was already 0 so it considers the weapon also disappeared and thus can be cleared from data, but it's not.

To reproduce the first issue

  1. Toggle a player spectating mode, set some other player for him to spec on
  2. Toggle it off by the server or wait until the one he's spectating on will left the game, so our player will be spawned
  3. Log OnPlayerStateChange, it usually show that his state was changed to 0 and only then to the real one after it

To reproduce the second issue

  1. Give player some non-bullet weapon with ammo 0:
GivePlayerWeapon(playerid, 9, 0); // Chainsaw
  1. Let him switch his holding weapon back and forth
  2. Obtain values from GetPlayerWeapon and GetPlayerAmmo

Release version
Latest v1.3.1.2748, but both issues also exist on older builds

@NexiusTailer NexiusTailer added the bug Something isn't working label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant