NoIp Switch

dedmen

TeamSpeak Developer
Contributor
Mar 28, 2016
530
583
157
wot? That's exactly why I brought up the SRV Idea. You don't have to wait for dns propagation each time you update your domain's A record through api calls
You only need to wait for your SRV records to propagate once, and you're done
SRV records dont work with Teamspeak.... they just work like a normal DNS record.. teamspeak only uses the first SRV record it finds..
On my server i am using SRV records on a nocache dns.. which works nicely.. almost everywhere (Not on shitty german cheapo routers that decide to cache the record anyway)
 

Wrath X

Member
Oct 2, 2015
96
34
53
ddos.php
PHP:
#!/usr/bin/php
<?php
date_default_timezone_set('Asia/Riyadh');

include 'config.php';

$tsAdmin = new ts3admin($ts3_ip, $ts3_queryport);

if($tsAdmin->getElement('success', $tsAdmin->connect())) {

    $tsAdmin->login($ts3_user, $ts3_pass);
    $tsAdmin->selectServer($ts3_port); 
    $tsAdmin->setName($bot_nickname);
 
    $whoami = $tsAdmin->getElement('data', $tsAdmin->whoAmI());
    $tsAdmin->clientMove($whoami['client_id'],$bot_move);
function onTimeout($seconds, TeamSpeak3_Adapter_ServerQuery $adapter)
{
  if($adapter->getQueryLastTimestamp() < time() - 300) $adapter->request("clientupdate");

  $server = $adapter->getHost()->serverGetByPort(9987);
  $serverInfo = $server->getInfo();
  $totalPacketLoss = (float)$serverInfo["virtualserver_total_packetloss_total"]->toString() * 100;

  if($totalPacketLoss >= 10.9999) $server->message("[COLOR=red][B]DDOS! (Paketverlust {$totalPacketLoss}%)[/COLOR]");
  else if($totalPacketLoss >= 2.0000) $server->message("[COLOR=red][B]Server IP Wechselt sich Connectet in 1-5 Minuten Neu zu : XXXXXXXX . (Paketverlust {$totalPacketLoss}%)[/COLOR]");
  else if($totalPacketLoss >= 1.5999) $server->message("[COLOR=orange][B]Der Server ist ziel einens DDOS. (Paketverlust {$totalPacketLoss}%)[/COLOR]");
  else if($totalPacketLoss >= 0.9999) $server->message("[COLOR=orange][B]Der Server Laggt. (Paketverlust {$totalPacketLoss}%)[/COLOR]");

  $server->clientListReset();
  $server->channelListReset();
}
php?>

Config.php

PHP:
<?php

$ts3_ip = 'XX.XX.XX.XX'; #IP Adress

$ts3_queryport = 10110; #Queryport

$ts3_port = 9987; #Port

$ts3_user = 'serveradmin'; #Login Query

$ts3_pass = 'XXXXXXXXX'; #Password Query

$bot_nickname = 'Anti DDOS'; #Name Bot

$bot_move = 7; #ID Channel to move

?>
Now i have this Error :
Code:
PHP Parse error:  syntax error, unexpected end of file in /home/ddos/ddos.php on line 33
I try to fix it but it doesnt work
In ddos.php Line 33: ' php?> ' to ' ?> ' :p
 

Alligatoras

Administrator
Mar 31, 2016
2,570
12
2,855
381
ddos.php
PHP:
#!/usr/bin/php
<?php
date_default_timezone_set('Asia/Riyadh');

include 'config.php';

$tsAdmin = new ts3admin($ts3_ip, $ts3_queryport);

if($tsAdmin->getElement('success', $tsAdmin->connect())) {

    $tsAdmin->login($ts3_user, $ts3_pass);
    $tsAdmin->selectServer($ts3_port); 
    $tsAdmin->setName($bot_nickname);
 
    $whoami = $tsAdmin->getElement('data', $tsAdmin->whoAmI());
    $tsAdmin->clientMove($whoami['client_id'],$bot_move);
function onTimeout($seconds, TeamSpeak3_Adapter_ServerQuery $adapter)
{
  if($adapter->getQueryLastTimestamp() < time() - 300) $adapter->request("clientupdate");

  $server = $adapter->getHost()->serverGetByPort(9987);
  $serverInfo = $server->getInfo();
  $totalPacketLoss = (float)$serverInfo["virtualserver_total_packetloss_total"]->toString() * 100;

  if($totalPacketLoss >= 10.9999) $server->message("[COLOR=red][B]DDOS! (Paketverlust {$totalPacketLoss}%)[/COLOR]");
  else if($totalPacketLoss >= 2.0000) $server->message("[COLOR=red][B]Server IP Wechselt sich Connectet in 1-5 Minuten Neu zu : XXXXXXXX . (Paketverlust {$totalPacketLoss}%)[/COLOR]");
  else if($totalPacketLoss >= 1.5999) $server->message("[COLOR=orange][B]Der Server ist ziel einens DDOS. (Paketverlust {$totalPacketLoss}%)[/COLOR]");
  else if($totalPacketLoss >= 0.9999) $server->message("[COLOR=orange][B]Der Server Laggt. (Paketverlust {$totalPacketLoss}%)[/COLOR]");

  $server->clientListReset();
  $server->channelListReset();
}
php?>

Config.php

PHP:
<?php

$ts3_ip = 'XX.XX.XX.XX'; #IP Adress

$ts3_queryport = 10110; #Queryport

$ts3_port = 9987; #Port

$ts3_user = 'serveradmin'; #Login Query

$ts3_pass = 'XXXXXXXXX'; #Password Query

$bot_nickname = 'Anti DDOS'; #Name Bot

$bot_move = 7; #ID Channel to move

?>
Now i have this Error :
Code:
PHP Parse error:  syntax error, unexpected end of file in /home/ddos/ddos.php on line 33
I try to fix it but it doesnt work
In ddos.php Line 33: ' php?> ' to ' ?> ' :p
What @Wrath X said!
In ddos.php file just replace this: php?> with this: ?> :)
 

dedmen

TeamSpeak Developer
Contributor
Mar 28, 2016
530
583
157
SRV records dont work with Teamspeak.... they just work like a normal DNS record.. teamspeak only uses the first SRV record it finds..
On my server i am using SRV records on a nocache dns.. which works nicely.. almost everywhere (Not on shitty german cheapo routers that decide to cache the record anyway)



"_tsdns._tcp.teamspeak.com
. With this first 3.1 release we have started to dramatically inprove our support for SRV records - like honoring priority and weight of SRV records - and we will continue to do so." Client version 3.1
 
Top