Is there a way to delete user avatar?
Printable View
Is there a way to delete user avatar?
Delete "/avatar_" followed by the UID from channel 0.
i guess its not /avatar_<uid> more like /avatar_<base64uid>
Hi, forum.
I'm currently in the making of a local web app that allows me to change channel talk power for use in pro tournaments where you need to mute/unmute the coach.
But I need help with some errors..
Some info about my setup:
Teamspeak server is located locally.
My web instance is local on my work pc
My php code:
The errorCode:<?php
error_reporting(E_ALL);
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
$properties = array();
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=10011");
$properties[0] = $ts3_VirtualServer->getId();
echo '<script> alert ("' .$properties[0]. '")</script>';
$ts3_VirtualServer->execute("i_client_talk_power", $properties);
$ts3_VirtualServer->resetNodeInfo();
?>
The goal is to have a btn change the talk power.Code:Fatal error: Uncaught TeamSpeak3_Adapter_ServerQuery_Exception: invalid serverID in C:\xampp\htdocs\libraries\TeamSpeak3\Adapter\ServerQuery\Reply.php:316 Stack trace: #0 C:\xampp\htdocs\libraries\TeamSpeak3\Adapter\ServerQuery\Reply.php(88): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String)) #1 C:\xampp\htdocs\libraries\TeamSpeak3\Adapter\ServerQuery.php(140): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'use port=10011', Object(TeamSpeak3_Node_Host), true) #2 C:\xampp\htdocs\libraries\TeamSpeak3\Node\Abstract.php(70): TeamSpeak3_Adapter_ServerQuery->request('use port=10011', true) #3 C:\xampp\htdocs\libraries\TeamSpeak3\Node\Abstract.php(94): TeamSpeak3_Node_Abstract->request('use port=10011') #4 C:\xampp\htdocs\libraries\TeamSpeak3\Node\Host.php(182): TeamSpeak3_Node_Abstract->execute('use', Array) #5 C:\xampp\htdocs\libraries\TeamSpeak3\Node\Host.php(268): TeamSpeak3_Node_Host->serverSelectByPort(10011) #6 C:\xampp\htdocs\libraries\TeamSpeak3\TeamSpeak3.php(386): TeamSpeak3_ in C:\xampp\htdocs\libraries\TeamSpeak3\Adapter\ServerQuery\Reply.php on line 316
Hope you can help!
I doubt you have a voice server running on port 10011.
?server_port= specified the voice server port, you'd like to use.
hi
I wonder why is it not working?
I'm trying to print all the icons id's from the server (all the icons that are in i_icon_id)
PHP Code:
<?php
// load framework files
require_once('ts3_lib/TeamSpeak3.php');
// connect to local server, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://serveradmin:[email protected]:10011/?server_port=9987");
//Print Icon List
foreach($ts3_VirtualServer->getIcon() as $Ico) {
echo $Ico . "<br />";
}
?>
Please check: https://github.com/planetteamspeak/t...work/issues/91
Hi, I've been looking for a way to create a channel as soon as someone joins a specific channel. What's the easiest way to do it? In long term, I want to poke clients in a specific server group, create a channel with the user's name who joined the channel and move him to this channel. In case anybody got the time to help me out, I'd highly appreciate it!
Cheers
Hi, import server group permissions with php ts3 framework?
Simple REST API planetteamspeak serverhistory down? (global list servers all offline)
Hello! Im trying to get the client description with this code:
I get this:PHP Code:
$name = $ts3_VirtualServer->clientGetById(47);
echo "<pre>";
$desc = $name->client_description;
print_r ($desc);
HTML Code:TeamSpeak3_Helper_String Object
(
[string:protected] =>
[position:protected] => 0
)
TeamSpeak3_Helper_String as the name suggests is a helper class for handling strings which comes with a ton of methods to manipulate the actual string in various ways.
In order to get the plain string representation of the object, you can simply cast it to string.
See the official documentation for more information.PHP Code:
$name = $ts3_VirtualServer->clientGetById(47);
echo "<pre>";
$desc = (string)$name->client_description;
print_r ($desc);
I am trying to create a script that will execute a block of code when a user enters the server. I have been researching all over the internet and have found that I needed to use this:PHP Code:
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview", "onClientEnterView");
Although the event triggers properly when someone enters the server, it generates an error saying something along the lines of it not existing under TeamSpeak3_Helper_Signal. If I was told to use this for my onuserjoin events, why is this generating an error? was there a newer version of the framework that removed this specific event from the framework? Please help.
Hello, how do I determine where the channel has to be created. wanted to be raised in a particular prayer. Not underneath all other channels nor as sub channel of any channel (root). this current code it creates channels that always remain like the last rooms of the server.
config.phpPHP Code:
<?PHP
require_once('libs/TeamSpeak3/TeamSpeak3.php');
require_once('config.php');
require_once('libs/recaptcha/src/autoload.php');
require_once('libs/chadd.php');
date_default_timezone_set('America/Sao_Paulo');
$type = @$_GET["type"];
date_default_timezone_set('America/Sao_Paulo');
function Response($code, $header, $msg) {
$resp = array(
"code" => $code,
"header" => $header,
"msg" => $msg,
);
$data = json_encode($resp);
echo $data;
exit;
}
switch($type) {
case 0:
$request = json_decode(file_get_contents("php://input"));
$numeros = mt_rand(10, 9999);
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
$resp = $recaptcha->verify($request->captcha_resp, $_SERVER['REMOTE_ADDR']);
if($resp->isSuccess()) {
if($chadd->CheckCookie())
{
Response(406, "Erro :(", "Você não pode criar um canal novamente.");
}
//REPLACE bad words
$request->channelname = $chadd->ReplaceBadString($badwords, $request->channelname);
if($chadd->CheckStringIP($request->channelname))
{
Response(403, "Erro :(", "No nome do seu canal não há endereço ou domínio IP permitido.");
}
if($chadd->CheckStringDomain($request->channelname))
{
Response(403, "Erro :(", "No nome do seu canal não há endereço ou domínio IP permitido.");
}
if($request->quality < 1 || $request->quality > 10)
{
$request->quality = 7;
}
switch ($request->codec)
{
case 1:
define("TS3_CODEC", TeamSpeak3::CODEC_OPUS_VOICE);
break;
case 2:
define("TS3_CODEC", TeamSpeak3::CODEC_CELT_MONO);
break;
case 3:
define("TS3_CODEC", TeamSpeak3::CODEC_SPEEX_ULTRAWIDEBAND);
break;
default:
define("TS3_CODEC", TeamSpeak3::CODEC_OPUS_VOICE);
}
try {
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://$ts3_username:$ts3_password@$ts3_host:$ts3_q_port/?server_port=$ts3_s_port");
$ts3_VirtualServer->selfUpdate(array('client_nickname'=> $ts3_nick));
$client = $ts3_VirtualServer->clientGetByUid($request->uuid);
$groups = $client["client_servergroups"];
$groups = explode(',', $groups);
$group_matches = 0;
foreach($allowed_groups as $g)
{
$client_nickname = $client->client_nickname;
$channelname = $request->channelname;
$unixTime = time();
$realTime = date('[d-m-Y]-[H:i]',$unixTime);
if(in_array($g, $groups))
{
$group_matches++;
}
}
if($group_matches <= 0)
{
Response(403, "Não Autorizado "," Não é permitido usar esta ferramenta, você não está em um grupo permitido.");
}
$cid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => "[cspacer" . $numeros . "] ━━━━━━━━━━◥◣◆◢◤━━━━━━━━━ ",
"channel_password" => $request->password,
"channel_maxclients" => 0,
"channel_flag_maxclients_unlimited" => false,
"channel_topic" => $channel_topic,
"channel_codec" => TS3_CODEC,
"channel_create_with_sortorder" => 632,
"cid" => 632,
"channel_codec_quality" => $request->quality,
"channel_flag_permanent" => TRUE,
"channel_description" => '[center][b][u]'.$channelname.'[/u][/b][/center][hr][b][list][*]Data e hora que foi criado: '.$realTime.'[*]Criador: ' . $client_nickname . '[/list][/b] [COLOR=#ff0000][B][u]ATENÇÃO:[/u][/B]
Participando do TS você concorda com as [url=http://esbsb.com.br/rules.php]regras[/url] aqui contidas, cuja leitura é de responsabilidade do usuário. Dizer que não conhece as regras não é desculpa para justificar atos que as descumpram. As punições para a violação de regras citadas abaixo variam de temporárias a permanente, portanto pense duas vezes antes de descumpri-las.[/COLOR]',
"channel_flag_semi_permanent" => FALSE
));
$Onecid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => $request->channelname, //nome do canal aqui
"channel_password" => $request->password, //você pode deixar ele sem senha ou deixar a mesma senha de família do canal
"channel_topic" => $channel_topic,
"channel_codec" => TS3_CODEC,
"channel_maxclients" => 0,
#"channel_icon_id" => "3534515520",
"channel_flag_maxclients_unlimited" => FALSE,
"channel_codec_quality" => $request->quality,
"channel_flag_permanent" => TRUE, //Não permanente
"channel_description" => $channel_description,
"channel_flag_semi_permanent" => FALSE //Canal semi-permanente para alterar permanente = ''channel_flag_permanent''
));
$Twocid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => "● Bem Vindo", //nome do canal aqui
"channel_password" => $request->password, //você pode deixar ele sem senha ou deixar a mesma senha de família do canal
"channel_topic" => $channel_topic,
"channel_codec" => TS3_CODEC,
"channel_codec_quality" => $request->quality,
"channel_flag_permanent" => TRUE, //Não permanente
"cpid" => $Onecid, //ID do Canal criado '' root channel cpid ''
"channel_description" => $channel_description,
"channel_flag_semi_permanent" => FALSE //Canal semi-permanente para alterar permanente = ''channel_flag_permanent''
));
$Treecid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => "● Jogando", //nome do canal aqui
"channel_password" => $request->password, // você pode deixar ele sem senha ou deixar amesma senha de família do canal
"channel_topic" => $channel_topic,
"channel_codec" => TS3_CODEC,
"channel_codec_quality" => $request->quality,
"channel_flag_permanent" => TRUE, //Não permanente
"cpid" => $Onecid, //ID do Canal criado '' root channel cpid ''
"channel_description" => $channel_description,
"channel_flag_semi_permanent" => FALSE //Canal semi-permanente para alterar permanente = ''channel_flag_permanent''
));
$Forcid = $ts3_VirtualServer->channelCreate(array(
"channel_name" => "● Bate Papo", //nome do canal aqui
"channel_password" => $request->password, // você pode deixar ele sem senha ou deixar amesma senha de família do canal
"channel_topic" => $channel_topic,
"channel_codec" => TS3_CODEC,
"channel_codec_quality" => $request->quality,
"channel_flag_permanent" => TRUE, //Não permanente
"cpid" => $Onecid, //ID do Canal criado '' root channel cpid ''
"channel_description" => $channel_description,
"channel_flag_semi_permanent" => FALSE //Canal semi-permanente para alterar permanente = ''channel_flag_permanent''
));
//log cid with IP (abuse)
$usr_ip = $_SERVER['REMOTE_ADDR'];
$ts3_VirtualServer->logAdd("Channel $cid created from IP:$usr_ip", TeamSpeak3::LOGLEVEL_INFO);
$token = $ts3_VirtualServer->privilegeKeyCreate(0x01, "$chadmin_group_id" ,"$cid", "TOKEN criado pelo web-criador.");
$client->move($Twocid);
$client->setChannelGroup($Twocid, $chadmin_group_id);
$chadd->SetCookie();
$resp = array(
"code" => 1,
"header" => "Tudo certo! :)",
"token" => (string)$token,
"url" => "$server_conn_url?port=$ts3_s_port&cid=$cid&channelpassword=$request->password",
);
$json = json_encode($resp);
echo $json;
exit;
}
catch (TeamSpeak3_Exception $e) {
Response(500, "TS3-Erro: "+ $e->getCode(), $e->getMessage());
}
} else {
$errors = $resp->getErrorCodes();
if(count($errors) >= 1)
{
Response(403, "Erro :(", $errors[0]);
}
}
break;
case 1:
try {
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://$ts3_username:$ts3_password@$ts3_host:$ts3_q_port/?server_port=$ts3_s_port");
$ts3_VirtualServer->selfUpdate(array('client_nickname'=> $ts3_nick));
$clients = $ts3_VirtualServer->clientList(array('connection_client_ip' => $_SERVER["REMOTE_ADDR"]));
$matches = count($clients);
if($matches > 1 || $matches <= 0)
{
Response(404, "Cliente não encontrado. "," Não foi possível determinar o seu ID exclusivo. Insira o seu ID exclusivo.");
}
if($matches == 1)
{
foreach($clients as $c)
{
if(count($c->getClones()) > 1)
{
Response(404, "Cliente não encontrado. "," Não foi possível determinar o seu ID exclusivo. Insira o seu ID exclusivo.");
}
$resp = array(
"code" => 200,
"header" => "Autenticado!",
"uuid" => (string)$c["client_unique_identifier"],
"name" => (string)$c["client_nickname"],
);
$json = json_encode($resp);
echo $json;
exit;
}
}
}
catch (TeamSpeak3_Exception $e) {
Response(500, "TS3-Erro: "+ $e->getCode(), $e->getMessage());
}
break;
}
?>
PHP Code:
<?PHP
$public = "6LfhMTMUAAAAABLFuChEGBEQpnlKnl4UrZixEfPs"; //Recaptcha Public Key
$secret = "6LfhMTMUAAAAADG4H1qUjgM759elMTBtX_yMVW4l"; // Recaptcha Privat Key
$ts3_host = "192.241.250.170";
$ts3_q_port = "10011";
$ts3_s_port = "1";
$ts3_username = "serveradmin";
$ts3_password = "***";
$ts3_nick = "Criador de Canais";
$cpid = 800; //SPACER ID (the root) the created channels will be collected as sub channel there
$chadmin_group_id = 22; // Channel Admin Group ID Default 5
$channel_description = "";
$channel_topic = "Espero que goste do servidor. Agradecemos a preferência!";
$server_conn_url = "ts3server://ts.esbsb.com.br:9987";
$imprint_url = "https://esbsb.com.br";
//BADWORDS will be replaced with XXXX
$badwords = array("example", "example");
// Allowed groups whitelist
$allowed_groups = array(181);
?>