NexiusTailer / Nex-AC

Anticheat system
https://pawn.wiki/index.php?/topic/27641-nex-ac/
GNU Lesser General Public License v3.0
213 stars 156 forks source link

fake cheat detection #251

Closed zXLiMiT-ToTAL closed 2 years ago

zXLiMiT-ToTAL commented 2 years ago

Hi there is a fake detection issue on nex-ac for mobile players (no cheats).

On PC, there is no fake detection problem, but when a player on mobile is shooting like Shot gun Sawn-off it falsely detects cheat like code #17 #26 #16

26

[Nex-AC debug] Weaponid: 25, reload time: 0, state: 1

16

[Nex-AC debug] AC ammo: 992, ammo: 995, weaponid: 25

17

[Nex-AC debug] Weaponid: 25, AC ammo: 932, ammo: 939

APK used for testing: SA-MP Launcher.

Code used for testing:

include

include

include

include

include

pragma warning disable 214

pragma warning disable 239

public OnPlayerSpawn(playerid) { SetPlayerPos(playerid, 385.7066,173.7077,1008.3828); return 1; }

public OnGameModeInit() { return 1; } public OnGameModeExit() { return 1; }

CMD:shotgun(playerid) { GivePlayerWeapon(playerid, 25, 1000); SendClientMessage(playerid, -1, "equipped shotgun"); return 1; } CMD:Sawnoff(playerid) { GivePlayerWeapon(playerid, 26, 1000); SendClientMessage(playerid, -1, "equipped spawnoff"); return 1; } forward OnCheatDetected(playerid, const ip_address[], type, code); public OnCheatDetected(playerid, const ip_address[], type, code) { if(type) BlockIpAddress(ip_address, 0); else { switch(code) {

    new str[156];
    format(string, sizeof(string), "%d player was kicked", playerid);
SendClientMessageToAll(COLOR_dark, str);

    }
    Kick(playerid);
}
return 1;

}

zXLiMiT-ToTAL commented 2 years ago

error adding hashtag above information, disregard.

NexiusTailer commented 2 years ago

I think most of these problems occur because of bad internet connection (and high packetloss as one of the results), which can be true especially for mobile players using 3g/lte mobile internet. Check the netstats information at the time of each detection and confirm or deny this assumption.

I must also notice that most mobile launchers have too much bugs that lead to sync problems and different behaviour of the game logic (comparing to the original pc samp client), but seems all cases you mentioned isn't about that.

zXLiMiT-ToTAL commented 2 years ago

The false detection is happening when the player hits the target, in the tests that were made the connection status is as follows:

Connection Status: 8 ping: 160 packetloos: 0.00 [Nex-AC debug] Weaponid: 25, reload time: 0, state: 1

Is it not possible with the data triggered by debug-ac you perform tests with mobile players?

NexiusTailer commented 2 years ago

Is it not possible with the data triggered by debug-ac you perform tests with mobile players?

Any tests that show false detections for mobile players will often mean that the fixes should be made by the developers of all current versions of samp android, not me (because often these are their bugs that make the mobile client behave differently from reference version). The only exceptions are cases when the behavior of the mobile GTA itself is different (for example, using some camera modes that are not valid for the PC version or some other data that just works differently in the ported game).

The false detection is happening when the player hits the target, in the tests that were made the connection status is as follows:

Connection Status: 8 ping: 160 packetloos: 0.00 [Nex-AC debug] Weaponid: 25, reload time: 0, state: 1

Well, then it should be a bug in some mobile client as I don’t remember any mobile players constantly shooting without reloading their weapons.

rt-2 commented 2 years ago

using some camera modes that are not valid for the PC version or some other data that just works differently in the ported game

Hello @NexiusTailer. I am sorry, this is out of the subject, but I am having trouble with the camera on mobile (https://github.com/rt-2/SA-ARP/issues/509) and I am looking for any information about the camera modes on android, or anyway to use the default SAMP 'cameraAttach' functions, if you have any (source or guidance for research). Thanks again!

NexiusTailer commented 2 years ago

@rt-2 I was talking rather about game behaviour examples (in its outgoing sync) which can cause anticheat detections on samp android players, but I don’t know much about the visual differences for the player when applying any server functions for him. Moreover, your problem may be caused not by the mobile game itself, but by a flaw in a specific mobile client (someone's implementation) of which there are now a huge number.

As for "invalid" camera modes I've mentioned as part of the peculiar behavior of a GTA:SA mobile port, that was some extended values for GetPlayerCameraMode which is checked for validity in rakcheat and some camera modes considered unused (invalid) for PC, then were added to the exceptions, as they were sent by mobile players regardless of the implementation of the android client they were using.