Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Nihongo^

#46
So what happens when you put the file as it is, and 'dofile' it in onScriptLoad ?
Same error occur, it also give this error when i put httprequest04rel64 plugins before the discord or any other plugins in the server.cfg sounds weird right ? server closed it self saying "segmentation error" whenever i launch it

Either you use previous version of plugin, or server or it may have something to do with vps.
I tried with the other vps and give same error, i request you to please give the latest plugins for Linux

PS: Pretty cool, it says 'Hero Member' - my 'posts' 501
Congratulation for this achievement, you don't need any post count to be called hero, you actually a real hero xd


#47
I believe this is due to the plugins/out dated plugins
#48
I am bit confused the function not work without request.sendGet(); as it lead to HTTP_OnResponse
also may i ask why'd you put request.sendGet(); at the end of the function HTTP_OnResponse

print("Proxy check request failed with status code " + statusCode);
   }

}
request.sendGet();
#49
Quote from: habi on Jul 20, 2023, 10:07 AMI think the error happens in function HTTP_OnResponse. Post that function's code please.
Well just for checking I removed that function, but still, the same thing happens anyways here is the code.

function HTTP_OnResponse(tag, url, statusCode, response) {

if (tag == "proxy_check_request") {
// Check if the request was successful
if (statusCode == 200) {
local findProxy = response.find("proxy\": \"yes");
if (findProxy != null) {
// Player is using a proxy
print("Using a proxy.");

for (local i=0; i<=GetMaxPlayers(); i++)
{
local player = FindPlayer(i);
if (!player) continue; //checking for null
print("Player IP matches: " + player.Name);
}
} else {
// Player is not using a proxy
print("Not using a proxy.");
}
} else {
// Handle HTTP request error
print("Proxy check request failed with status code " + statusCode);
}
}
else {
print("Player name not found in the response.");
}
}

P.S Code work perfectly only in Windows. Here's the pic, (player name is Everest), but give an error in Linux.

#50
After spending hours to making VPN detection now, I am facing this segmentation fault in the Linux after this message server get closed
This error only occurs on this line onPlayer join
  request.sendGet();
and here the full function
function onPlayerJoin( player )
{
   local playerIP = "195.146.4.43";
    // Replace "YOUR_API_KEY" with your actual proxycheck.io API key
    local api_key = "798233-593822-1490lk-681482";

    local url = "https://proxycheck.io/v2/" + playerIP + "?vpn=1&asn=1&key=" + api_key;

    // Make the HTTP request to proxycheck.io
    local request = ::SqHTTP.GetRequest();
    request.setURL(url);
    request.setTag("proxy_check_request");
    request.sendGet();

}


#51
Thank you so much habi, i finally made it
thanks to vito also for such efforts
#52
Quote from: habi on Jul 19, 2023, 04:29 PMGet the below file from github given by vito.

can it be done like this ?

local JSONData = JSONParser.parse(response.slice(response.find("{")));
        if (JSONData != null && JSONData("player")) {
            local playerName = JSONData["player"];
            print("Player Name: " + playerName);


            for (local i = 0; i < MaxPlayers; ++i) {
                local player = FindPlayer(i);
                if (!player) continue; //checking for null

                if (player.IP == tbl[1]) {
                   
                    print("Player IP matches: " + player.Name);
                }

    }
line 442 -->         if (JSONData != null && JSONData("player"))

#53
Quote from: vitovc on Jul 19, 2023, 03:05 PM1) why not work with json normally with this https://github.com/electricimp/JSONParser

Never used that JSONParser, any tip please
#54
Quote from: habi on Jul 19, 2023, 02:46 PMThere is another way.
if(response.find(player.IP)!=null)Put above code in a loop over all players.
Only one will match it.
I am sorry habi, but how does player.IP helped me to get the player.Name ?
#55
btw one question how do i include player name ?
+player.Name+ using VPN  ?


p.s The player variable is not directly accessible inside the HTTP_OnResponse function since it's a separate callback function. We need to find a way to pass the player data from onPlayerJoin to HTTP_OnResponse
#56
Thank you so much habi its works, just because of you I made VPN detector
#57
In the refer of t his https://forum.vc-mp.org/index.php?topic=9275.0

I want to say thanks to @habi and @vitovc for the help.

I tried to utilize the function and made a code it detecting its as a proxy, but in print, it said
not using a proxy

While I've provided a proxy IP and it detected




Function

function HTTP_OnResponse(tag, url, statusCode, response)
{
    print("Data received for request with tag " + tag);
    print("Response: " + response);
   
    if (tag == "proxy_check_request")
    {
        // Check if the request was successful
        if (statusCode == 200)
        {
            local findProxy = response.find("proxy");
            if (findProxy == "yes")
            {
//Player is using a proxy
                    print("Using a proxy.");
                }
                else
                {
                    // Player is not using a proxy
                    print("Not using a proxy.");
                }
            }
        else
        {
            // Handle HTTP request error
            print("Proxy check request failed with status code " + statusCode);
        }
    }
}


#58
Quote from: vitovc on Jul 19, 2023, 08:57 AM
Quote from: Nihongo^ on Jul 19, 2023, 08:07 AMI see, but how do a script understand the link? I have a squirrel language server, and afaik there's no way to insert a link in this language
try to use search function of internet https://forum.vc-mp.org/index.php?topic=7522.0

Thanks for sharing such an informative link; let me try to utilize it on my own.
I'll come back if i need help

Thank you
P.S if anybody give me some advice would be appreciate
#59
Quote from: habi on Jul 19, 2023, 04:46 AMI found a way to check for vpn:
https://proxycheck.io/v2/xxx.xxx.xxx.xxx?vpn=1&asn=1where you have to replace xxx with ip address.
Do a GET request and see reply of it.
{
    "status": "ok",
    "79.137.85.208": {
        "asn": "AS16276",
        "provider": "OVH SAS",
        "organisation": "OVH",
        "continent": "Europe",
        "continentcode": "EU",
        "country": "France",
        "isocode": "FR",
        "region": "Hauts-de-France",
        "regioncode": "HDF",
        "timezone": "Europe/Paris",
        "city": "Roubaix",
        "postcode": "59100",
        "latitude": 50.6917,
        "longitude": 3.2016,
        "currency": {
            "code": "EUR",
            "name": "Euro",
            "symbol": "€"
        },
        "proxy": "yes",
        "type": "VPN"
    }
}
I see, but how do a script understand the link? I have squirrel language server and afaik there's no way to insert a link in this language
#60
Quote from: habi on Jul 18, 2023, 11:26 AMDid they bypass UID?
Yeh, installing the new windows also, most of hackers use UID changer

Please guide me about VPN detection system

Thank you