Raised This Month: $ Target: $400
 0% 

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 11-03-2019 , 16:10   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #1

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 #2

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
Reply



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 02:39.


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