PirateControl
Member
- Apr 19, 2016
- 33
- 11
- 43
Someone have a Whitelist bot / Script?
So only my friends can connect to my server other guy will be kicked?
So only my friends can connect to my server other guy will be kicked?
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
$tsHandle = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
$whitelist = array('T0jN+2Wci+sz5wfFnOVcHhRFEak=', 'L3dN+2Wci+sz3fsFnOVcHhRFCdP=');
foreach($tsHandle->clientList(array("client_type" => 0)) as $client)
{
if(!in_array($client->client_unique_identifier, $whitelist))
{
try {
$client->kick(TeamSpeak3::KICK_SERVER, 'You aren\'t whitelisted!');
} catch(TeamSpeak3_Exception $e) {
echo "Error ".$e->getCode().": ".$e->getMessage();
}
}
}
Very Nice thank you but how can i let them check my server like every 3 sec or 5 sec now i need to refresh the webpageIt would make more sense to just use a default group without permissions but this should help you.
PHP:<?php require_once("libraries/TeamSpeak3/TeamSpeak3.php"); $tsHandle = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987"); $whitelist = array('T0jN+2Wci+sz5wfFnOVcHhRFEak=', 'L3dN+2Wci+sz3fsFnOVcHhRFCdP='); foreach($tsHandle->clientList(array("client_type" => 0)) as $client) { if(!in_array($client->client_unique_identifier, $whitelist)) { try { $client->kick(TeamSpeak3::KICK_SERVER, 'You aren\'t whitelisted!'); } catch(TeamSpeak3_Exception $e) { echo "Error ".$e->getCode().": ".$e->getMessage(); } } }
Very Nice thank you but how can i let them check my server like every 3 sec or 5 sec now i need to refresh the webpage
Like a Startscript or so?
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
$tsHandle = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
$whitelist = array('T0jN+2Wci+sz5wfFnOVcHhRFEak=', 'L3dN+2Wci+sz3fsFnOVcHhRFCdP=');
while(1) {
foreach($tsHandle->clientList(array("client_type" => 0)) as $client)
{
if(!in_array($client->client_unique_identifier, $whitelist))
{
try {
$client->kick(TeamSpeak3::KICK_SERVER, 'You aren\'t whitelisted!');
} catch(TeamSpeak3_Exception $e) {
echo "Error ".$e->getCode().": ".$e->getMessage();
}
}
}
}
?>
Diese Seite funktioniert nicht
My IP kann diese Anfrage momentan nicht verarbeiten.
This site does not work
Thanks, but it´s not working
Code:Diese Seite funktioniert nicht My IP kann diese Anfrage momentan nicht verarbeiten. This site does not work
screen -S screen1 php YOURSCRIPT.php
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
$tsHandle = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
$tsHandle->notifyRegister("server");
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "whitelistFunction");
while(1) $tsHandle->getAdapter()->wait();
function whitelistFunction(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host)
{
try {
$whitelist = array('T0jN+2Wci+sz5wfFnOVcHhRFEak=', 'L3dN+2Wci+sz3fsFnOVcHhRFCdP=');
if ($event["client_type"] == 0) {
$client = $host->serverGetSelected()->clientGetById($event["clid"]);
if(!in_array($event["client_unique_identifier"], $whitelist))
{
$client->kick(5, 'You aren\'t whitelisted!');
}
}
} catch(TeamSpeak3_Exception $e) {
echo "Error ".$e->getCode().": ".$e->getMessage();
}
}
?>
This script has an ErrorIs this what you're looking for?
PHP:<?php require_once("libraries/TeamSpeak3/TeamSpeak3.php"); $tsHandle = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987"); $tsHandle->notifyRegister("server"); TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "whitelistFunction"); while(1) $tsHandle->getAdapter()->wait(); function whitelistFunction(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host) { try { $whitelist = array('T0jN+2Wci+sz5wfFnOVcHhRFEak=', 'L3dN+2Wci+sz3fsFnOVcHhRFCdP='); if ($event["client_type"] == 0) { $client = $host->serverGetSelected()->clientGetById($event["clid"]); if(!in_array($event["client_unique_identifier"], $whitelist)) { $client->kick(5, 'You aren\'t whitelisted!'); } } } catch(TeamSpeak3_Exception $e) { echo "Error ".$e->getCode().": ".$e->getMessage(); } } ?>
PHP Fatal error: Uncaught TeamSpeak3_Adapter_Exception: only available in non-b locking mode in /opt/Whitelist/libraries/TeamSpeak3/Adapter/ServerQuery.php:158
Stack trace:
#0 /opt/Whitelist/errorscript.php(7): TeamSpeak3_Adapter_ServerQuery->wait()
#1 {main}
thrown in /opt/Whitelist/libraries/TeamSpeak3/Adapter/ServerQuery.php on line 158
screen -S screen1 php YOURSCRIPT.php
This script has an Error
Code:PHP Fatal error: Uncaught TeamSpeak3_Adapter_Exception: only available in non-b locking mode in /opt/Whitelist/libraries/TeamSpeak3/Adapter/ServerQuery.php:158 Stack trace: #0 /opt/Whitelist/errorscript.php(7): TeamSpeak3_Adapter_ServerQuery->wait() #1 {main} thrown in /opt/Whitelist/libraries/TeamSpeak3/Adapter/ServerQuery.php on line 158
I got a new Problem afer 5 -10 min the bot will disconnect from the server anyone knows why?
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
TeamSpeak3::init();
try
{
TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryWaitTimeout", "onTimeout");
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "onClientEnter");
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyServerselected", "onSelect");
$tsHandle = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987&blocking=0");
while(1) $tsHandle->getAdapter()->wait();
}
catch(Exception $e)
{
die("[ERROR] " . $e->getMessage() . "\n");
}
function onTimeout($seconds, TeamSpeak3_Adapter_ServerQuery $adapter)
{
if($adapter->getQueryLastTimestamp() < time()-300)
{
$adapter->request("clientupdate");
}
}
function onSelect(TeamSpeak3_Node_Host $host)
{
$host->serverGetSelected()->notifyRegister("server");
}
function onClientEnter(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host)
{
try {
$whitelist = array('T0jN+2Wci+sz5wfFnOVcHhRFEak=', 'L3dN+2Wci+sz3fsFnOVcHhRFCdP=');
if ($event["client_type"] == 0) {
$client = $host->serverGetSelected()->clientGetById($event["clid"]);
if(!in_array($event["client_unique_identifier"], $whitelist))
{
$client->kick(5, 'You aren\'t whitelisted!');
}
}
} catch(TeamSpeak3_Exception $e) {
echo "Error ".$e->getCode().": ".$e->getMessage();
}
}
?>