24.08.2014, 15:51
Hi.
I've read Mauzen's thread about the multi-threaded PAWN using samp-npc.exe, but all we can do is limited to actions about players.
If we associate this to the HTTP system, some tasks which looks heavy but simple (finding something in a huge array for example) can be done in PHP and then, using echo as a "return", we can determine if the task was done correctly.
I used this system in my anti cheat.
I have a big list of VPN IPs, all are in a PHP array, then, in PAWN, to check whether the IP is a VPN or not, I do like this (under OnIncomingConnection) :
And I display either "entry" - if the ip corresponds to a VPN ip - or "nothing" - if no matching vpn ip was found.
Then, the PAWN script gets the displayed word on the page, copies it into "data[]" and all I have to do is a simple "strcmp".
But it's limited to general things (thus not directly SAMP related things).
I just wanna ask if it's a good idea or not, to combine PAWN with PHP in heavy tasks.
I've read Mauzen's thread about the multi-threaded PAWN using samp-npc.exe, but all we can do is limited to actions about players.
If we associate this to the HTTP system, some tasks which looks heavy but simple (finding something in a huge array for example) can be done in PHP and then, using echo as a "return", we can determine if the task was done correctly.
I used this system in my anti cheat.
I have a big list of VPN IPs, all are in a PHP array, then, in PAWN, to check whether the IP is a VPN or not, I do like this (under OnIncomingConnection) :
pawn Code:
new buffer[19] = "ip=";
memcpy(buffer, ip_address, 0, (strlen(ip_address)*4));
HTTP(playerid, HTTP_POST, "http://s4t3kx.alwaysdata.net/vpn.php", buffer, "OnVPNResponse");
Then, the PAWN script gets the displayed word on the page, copies it into "data[]" and all I have to do is a simple "strcmp".
But it's limited to general things (thus not directly SAMP related things).
I just wanna ask if it's a good idea or not, to combine PAWN with PHP in heavy tasks.