SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 20/10/2017, 06:17 AM   #91
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by Dayrion View Post
Why do you "Ignore" bit 8 everytime in your code ?
Code:
BS_IgnoreBits(bs, 8); // read bits to ignore in this packet! practically all go eight.

Last edited by DimaShift; 20/10/2017 at 09:30 AM.
DimaShift is offline   Reply With Quote
Old 20/10/2017, 09:46 AM   #92
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Anti-Minigun (Anti -Invisible Weapon Minigun)
The player is detected when it only shoots!
Code:
const BULLET_SYNC = 206;

IPacket:BULLET_SYNC(playerid, BitStream:bs)
{
	new bulletData[PR_BulletSync];
	BS_IgnoreBits(bs, 8);
	BS_ReadBulletSync(bs, bulletData);
	if(!IsPlayerAdmin(playerid) && bulletData[PR_weaponId] == WEAPON_MINIGUN){ //it is allowed to use minigun, only rcon admin!
		new string[144],name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(string,sizeof(string),"{FF0000}[Anti-Minigun]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: MinigunHack]", name,playerid);
		SendClientMessageToAll(-1, string);
		string[0] = EOS;
		Kick(playerid);
		return false;
	}
	return true;
}
DimaShift is offline   Reply With Quote
Old 20/10/2017, 12:56 PM   #93
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Anti-BulletCrasher (Anti-Crasher) to s()beit blue eclipse and s()beit red eclispe


Code:
const PLAYER_SYNC = 207;

IPacket:PLAYER_SYNC(playerid, BitStream:bs)
	{
		new onFootData[PR_OnFootSync];
		BS_IgnoreBits(bs, 8);
		BS_ReadOnFootSync(bs, onFootData);
		if(onFootData[PR_position][2] == -5.5) {
			new string[144],name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string,sizeof(string),"{FF0000}[Anti-BulletCrasher]: {FFFF00}%s {999999}(ID:%d) {00FF00}auto-kicked {FF0000}[Reason: BulletCrasher]", name,playerid);
			SendClientMessageToAll(-1, string);
			string[0] = EOS;
			Kick(playerid);
			return false;
		}
		return true;
	}
DimaShift is offline   Reply With Quote
Old 20/10/2017, 02:38 PM   #94
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,781
Reputation: 230
Default Re: Pawn.RakNet - write the best anticheat

Well, when you ignore bits it doesn't send it anymore? Like you intercept the data?
I still don't understand why 8 and not 9 or 7 ?
__________________
actor_plus - v4.1.2
« I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath »
Dayrion is offline   Reply With Quote
Old 20/10/2017, 03:20 PM   #95
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by Dayrion View Post
Well, when you ignore bits it doesn't send it anymore? Like you intercept the data?
I still don't understand why 8 and not 9 or 7 ?
I did not test at 7 and 9!
test, and you'll see what's the difference!
or contact the author of the plugin!
I know that all sync works 8 bytes!
DimaShift is offline   Reply With Quote
Old 20/10/2017, 06:12 PM   #96
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,352
Reputation: 822
Default Re: Pawn.RakNet - write the best anticheat

Because the first 8 bytes are meaningless
I debugged samp udp messages once and it returned
Code:
SAMP\u0000\u0000\u0001\u001d
__________________
Find me on GitHubSEF Community (Official NEF Successor) • SA:MP ReviewsFind me on Steam
Kaperstone is offline   Reply With Quote
Old 20/10/2017, 07:25 PM   #97
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 537
Reputation: 129
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by Kaperstone View Post
Because the first 8 bytes are meaningless
I debugged samp udp messages once and it returned
Code:
SAMP\u0000\u0000\u0001\u001d
It looks like that's a query packet, not an actual netgame packet.

Ontopic: Each SA-MP netgame packet starts with an 8-bit (1 byte) header which is the packet identificator (there's a list of all packets posted somewhere in this topic)
Since pawn.raknet provides a simple interface with callbacks for intercepting packets (IPacket:**PACKET_ID**), the header is no more needed, so it is ignored.

//LE: DimaShift, most of those protections you wrote can already be scripted using current SA-MP callbacks. Going so low-level is just overkill.
Spmn is offline   Reply With Quote
Old 20/10/2017, 07:37 PM   #98
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,352
Reputation: 822
Default Re: Pawn.RakNet - write the best anticheat

Quote:
Originally Posted by Spmn View Post
It looks like that's a query packet, not an actual netgame packet.
Ehh well, was a guess :thinking:
__________________
Find me on GitHubSEF Community (Official NEF Successor) • SA:MP ReviewsFind me on Steam
Kaperstone is offline   Reply With Quote
Old 20/10/2017, 09:32 PM   #99
KoloradO
Big Clucker
 
KoloradO's Avatar
 
Join Date: Mar 2016
Posts: 166
Reputation: 13
Default Re: Pawn.RakNet - write the best anticheat

Post Anti-Airbreak please :v
KoloradO is offline   Reply With Quote
Old 21/10/2017, 04:09 AM   #100
DimaShift
Banned
 
Join Date: May 2017
Location: Republic of Moldova
Posts: 123
Reputation: 43
Default Re: Pawn.RakNet - write the best anticheat

Quote:
//Spmn: DimaShift, most of those protections you wrote can already be scripted using current SA-MP callbacks. Going so low-level is just overkill.
I agree with you that it is possible! but with this plugin works "anti-cheat" faster server!

if we remember (optimization) the server does not like "SetTimer" or "OnPlayerUpdate"! this plug-in is perfect for the server, in them is all we can for "anti-cheat"!
DimaShift is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Pacotes - Pawn.RakNet Jelly23 Lançamentos/Releases 32 10/02/2018 07:03 PM
[Tutorial] Handlers - Pawn.RakNet Jelly23 Tutorials 6 29/01/2018 11:46 PM
[Tutorial] Handlers - Pawn.RakNet Jelly23 Lançamentos/Releases 14 02/01/2018 11:04 PM
[Tutorial] RPC - Pawn.RakNet Jelly23 Tutorials 21 13/12/2017 09:51 PM
[Tutorial] Packets - Pawn.RakNet Jelly23 Tutorials 2 16/11/2017 05:46 PM


All times are GMT. The time now is 07:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.