AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client) (https://forums.alliedmods.net/showthread.php?t=319269)

SANTO37 10-22-2019 00:50

Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
 
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?

iNvectus 10-24-2019 01:42

Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
 
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

SANTO37 10-24-2019 04:21

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

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

nacknic 11-04-2019 05:31

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

Originally Posted by SANTO37 (Post 2671887)
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).

SANTO37 11-04-2019 11:59

Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
 
Vooovvv.But I'm not good at amxx. : D I'll ask you to bring it up a little more.

nacknic 11-04-2019 17:46

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

Originally Posted by SANTO37 (Post 2671964)
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!

JocAnis 11-05-2019 11:05

Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
 
@nacknic and whats the point of it, you will be able to detect playera who injected hacks in cs?

SANTO37 11-05-2019 13:37

Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
 
@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.

Natsheh 11-05-2019 13:39

Re: Real CS 1.6 Anti-Cheat Help Please(c# and amxx socket server/client)
 
Can you explain what is port 1991 for?


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

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