JAVA skipping sa-mp client for direct connecting
#1

Hello, I understand that this thread is for pawn related questions but I could not find another section where this topic would make sense being.

So... I am making an anti-cheat program which has to be executed by the players who are willing to play in a specific virtual world where all the other users are who use this .jar file.

Does anyone know how to connect to a server by java code?
Reply
#2

Quote:
Originally Posted by justinnater
Посмотреть сообщение
Hello, I understand that this thread is for pawn related questions but I could not find another section where this topic would make sense being.

So... I am making an anti-cheat program which has to be executed by the players who are willing to play in a specific virtual world where all the other users are who use this .jar file.

Does anyone know how to connect to a server by java code?
Well, if you want to use the share the same connection that SA-MP client uses, then you have to hook into both server and client RakServer, respectively RakPeer interface using a DLL written in C++ (since there is no java implementation of RakNet), then implement a communication interface between DLL and your java application, so you can use raknet functions in your .jar. This approach is pretty hard to achieve.

A more easier way is to create a TCP socket on your server using socket plugin and make your java application connect to that socket, this way you won't rely on SA-MP networking stuff, but you'd have to implement a sort of player-anticheat identification system.

A third way would be using a website where both client and server have access. Anticheat client would send info to that webserver, and your SA-MP server would query the webserver.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)