[TS3] Get client by IP

iDentity1337

Member
Joined
Oct 4, 2015
Messages
1
Points
35
Age
22
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:

XURY

Member
Joined
May 9, 2015
Messages
60
Points
53
Location
Germany
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:

Scrump

Member
Joined
Oct 3, 2015
Messages
34
Points
43
Location
Germany
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!");
}
what is
Code:
gethostbyaddr
?
 

Top