Raised This Month: $32 Target: $400
 8% 

Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SANTO37
Member
Join Date: Aug 2008
Old 10-22-2019 , 00:50   Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #1

Hello,
I've been able to develop a real anti-cheating program for a while. I code the program in C #. This program absolutely prevents .exe, .dll, .cfg, opengl, wallhack, speedhack and corrupted file cheats. Prevents the user from modifying cs 1.6 files. If there is a corrupt file, it downloads a new one from the internet immediately. So everyone can play a fair game.
But there is a problem; I can't control the player running the program and entering the game. I think I need to use AMXX SOCKET for this. But I'm not good at it. I have a LINUX server. I want to get help from real coders who understand this. Can you help?
SANTO37 is offline
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 10-24-2019 , 01:42   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #2

You could take a look at the tutorial in here about sockets. It's not that hard as you think it is. After all, it's not an embedded C..
https://forums.alliedmods.net/showthread.php?t=41913
iNvectus is offline
SANTO37
Member
Join Date: Aug 2008
Old 10-24-2019 , 04:21   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #3

thank you for your help. However, there is a need for an HTTP server here. I want to communicate between CS 1.6 server and user. Do you have any other suggestions?
SANTO37 is offline
SANTO37
Member
Join Date: Aug 2008
Old 11-03-2019 , 16:10   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #4

Help me
SANTO37 is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 11-04-2019 , 05:31   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #5

Quote:
Originally Posted by SANTO37 View Post
Help me
c# its same like java, maybe my simple code will give you idea.
pay attention: the anti cheat in this case is act the server. (and i nub in amxmodx but its a good start).

its not my final work, but worked now its my current code

amxmodx check connection to client (that use anti cheat that listen to 1991 port)
the checking its when the round started (you can change it easily.
UPDATE 5.11.19
Code:
#include <amxmodx>
#include <sockets>
 
new g_socket;

public client_authorized(id) socket_DBClient(id);

public socket_DBClient(id) {
	
	new ip[32], error;
	get_user_ip(id, ip, charsmax(ip), 1);
	client_print(id , print_chat, "%s", ip[0]);
	g_socket = socket_open(ip, 1991, SOCKET_TCP, error);
	
	if (error == 1 || error == 2 || error ==3) {
		server_print("Player %d: ERROR: %d", id, error);
		message_begin(MSG_ONE, SVC_DISCONNECT, {0, 0, 0}, id);
		write_string("Please open DBClient!");
		message_end();	
	} else {
		socket_close(g_socket);
		client_print(id, print_chat, "connected");  
	}
	
}
Java you need first do inner class for new thread
(because you need your program not waiting for the connection, and its loop all x time
you needed to check, if the anti cheat is opened):
Code:
Thread sThread = new Thread(new Runnable() {
			
			@Override
			public void run() {
				
				try {
					
					while(threadShutdown == false) {
						
						ServerSocket server = new ServerSocket(1991);
						Socket conSS = server.accept();
						System.out.println(conSS.getRemoteSocketAddress());
						conSS.close();
						
					}
					
				} catch(Exception e) {
					e.printStackTrace();
				}
			}
			
		});
		sThread.start();
Java also you need some hook when the program closed, stop listen to the socket.
Code:
Runtime.getRuntime().addShutdownHook(new Thread() {
			
			@Override
			public void run() {
				
				threadShutdown = false;
				
			}
			
		});
hope its help you (i in the middle my self of doing anti cheat , i thnik its will help you).

Last edited by nacknic; 11-04-2019 at 17:42.
nacknic is offline
SANTO37
Member
Join Date: Aug 2008
Old 11-04-2019 , 11:59   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #6

Vooovvv.But I'm not good at amxx. : D I'll ask you to bring it up a little more.
SANTO37 is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 11-04-2019 , 17:46   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #7

Quote:
Originally Posted by SANTO37 View Post
Vooovvv.But I'm not good at amxx. : D I'll ask you to bring it up a little more.
i updated my code, its work on HLDS but not in REHLDS:
Code:
#include <amxmodx>
#include <sockets>
 
new g_socket;

public client_authorized(id) socket_DBClient(id);

public socket_DBClient(id) {
	
	new ip[32], error;
	get_user_ip(id, ip, charsmax(ip), 1);
	client_print(id , print_chat, "%s", ip[0]);
	g_socket = socket_open(ip, 1991, SOCKET_TCP, error);
	
	if (error == 1 || error == 2 || error ==3) {
		server_print("Player %d: ERROR: %d", id, error);
		message_begin(MSG_ONE, SVC_DISCONNECT, {0, 0, 0}, id);
		write_string("Please open DBClient!");
		message_end();	
	} else {
		socket_close(g_socket);
		client_print(id, print_chat, "connected");  
	}
	
}
tomorrow i tried another method:
open socket to text file (on ftp with amx) write somthing.
and the client have to read this text and send back to the server.

its harder then this code here, but maybe stable!
nacknic is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-05-2019 , 11:05   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #8

@nacknic and whats the point of it, you will be able to detect playera who injected hacks in cs?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
SANTO37
Member
Join Date: Aug 2008
Old 11-05-2019 , 13:37   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #9

@nacknic
Hello, I think we should get this together.
What codes are needed for the C # side?
What code is required for the Linux server side?
I'm a little confused. I can't come up with ideas about this. I demand that you increase your support so that we can succeed. Thank you.
SANTO37 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-05-2019 , 13:39   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #10

Can you explain what is port 1991 for?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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

Forum Jump


All times are GMT -4. The time now is 07:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode