[TS3] Get client by IP

Discussion in 'PHP' started by iDentity1337, Dec 23, 2015.

  1. iDentity1337

    iDentity1337 New Member

    Hello, and first of all, Happy Christmas holidays to everyone since i don't know will I be around these days.
    Now, since I'm in the middle of connecting milion things at once through PHP, and one of them is TeamSpeak, I was wondering is it possible to get client's IP Address, like we have for names:
    Code:
    clientGetByName('Test');
    Thanks in advance.

    EDIT: I figured it out. In case someone wants to figure out the same thing, here's the code:
    Code:
    foreach($ts3_VirtualServer->clientList() as $client)
    {
            if($client["client_type"]) continue;
            $clientInfo = $client->getInfo();
            if($clientInfo['connection_client_ip'] == 'DesiredIPthatMatches')
            $client->poke("HEYY");
    }
     
    Last edited: Dec 24, 2015
    Laszl0w, rofl cake and Asphyxia like this.
  2. XURY

    XURY Member

    This is the code for the detection of an OpenVPN connection. In most cases the server's hostname is its IP and internet providers most likely have their own hostname which contains their name or whatever, but not the IP standing by itself. So you can be sure that there's a VPN behind an IP when the hostname is that IP :D!
    https://poc.xury.de/vpn-detector/ - I know..My SSL Certificate has expired.
    Code:
    foreach($ts3_VirtualServer->clientList() as $client)
    {
            if($client["client_type"]) continue;
            $clientInfo = $client->getInfo();
            $tsip = $clientInfo['connection_client_ip'];
            if($tsip == gethostbyaddr($tsip)){
            $client->poke("You have a VPN running!");
    }else{
            $client->poke("You maybe have no VPN running!");
    }
    
     
    Last edited: Dec 24, 2015
  3. Scrump

    Scrump Member

    what is
    Code:
    gethostbyaddr
    ?
     
  4. Laszl0w

    Laszl0w Contributing Member

  5. Scrump

    Scrump Member

Share This Page