Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
nacknic
Senior Member
Join Date: Mar 2019
Old 12-03-2019 , 12:49   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #21

i dont have vps (so i dont know if its work or not, i buillding now PC server more few weeks im finish).

try this (maybe its will fixed the problem):
Code:
#include <amxmodx>
#include <sockets>
 
new g_socket;

public plugin_init( ) register_logevent( "socket_DBClient", 2, "1=Round_Start" );  

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);
	socket_close(g_socket);
	
	if (error == 1 || error == 2 || error ==3) {
		message_begin(MSG_ONE, SVC_DISCONNECT, {0, 0, 0}, id);
		write_string("Please open DBClient!");
		message_end();	
	} else client_print(id, print_chat, "connected");  
	
}
and i try today using UDP + TCP for this, its take me 3 fucking hours!.
amx code:
Code:
#include <amxmodx>
#include <sockets>
 
new g_socket1;
new g_socket2;

public plugin_init() register_logevent( "roundstart", 2, "1=Round_Start" );

public client_authorized(id) socket_DBClient(id);

public roundstart(id) socket_DBClient(id);


public socket_DBClient(id) {
	
	new ip[32];
	new error1, error2;
	new sdata[] = "are you here ?";
	get_user_ip(id, ip, charsmax(ip), 1);
	client_print(id , print_chat, "%s", ip[0]);
	g_socket1 = socket_open(ip, 1991, SOCKET_UDP, error1);
	if(socket_send(g_socket1, sdata, charsmax(sdata)) != -1) {
		socket_close(g_socket1);
		g_socket2 = socket_open(ip, 1992, SOCKET_TCP, error2);
		if(error2 != 1 || error2 != 2 || error2 != 3) {
			client_print(id , print_chat, "connected);
			socket_close(g_socket2);
		} else {
			message_begin(MSG_ONE, SVC_DISCONNECT, {0, 0, 0}, id);
			write_string("Please open DBClient!");
		}
	} else { 
		message_begin(MSG_ONE, SVC_DISCONNECT, {0, 0, 0}, id);
		write_string("Please open DBClient!");
	
	}
	
}
java code:
Code:
package dbachartechz;
import java.net.DatagramSocket;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.DatagramPacket;

public class Demo {
	
	public static void main(String[] args) throws Exception {
		
		Thread sThread = new Thread(new Runnable() {
			
			@Override
			public void run() {
				
				System.out.println("server DBClient with UDP Port is on");
				try {
					
					receiveMsg();
					
				} catch(Exception e) {
					e.printStackTrace();
				}
				
			}
		});
		
			sThread.start();
	}
	
	public static void receiveMsg() throws Exception {
		
		String displayServerMsg = "";
		
		while(true) {
			
			DatagramSocket ds = new DatagramSocket(1991);
			byte[] b = new byte[1024];
			DatagramPacket dp = new DatagramPacket(b, b.length);	
			ds.receive(dp);
			ds.close();
			
			displayServerMsg = new String(dp.getData());
			System.out.println(displayServerMsg);
			if(!displayServerMsg.equals("")) openTCPSocket();
		
		}
		
	}
	
	public static void openTCPSocket() throws Exception {
		
		ServerSocket server = new ServerSocket(1992);
		Socket conSS = server.accept();
		System.out.println(conSS.getRemoteSocketAddress());
		conSS.close();
		server.close();
		
	}

}

Last edited by nacknic; 12-03-2019 at 13:25.
nacknic is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 12-04-2019 , 15:34   Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
Reply With Quote #22

@SANTO37
i upload all my anti cheat and my code here, hope its will help you:
https://forums.alliedmods.net/showth...99#post2675699
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 10:05.


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