Forum

Page 85 of 100 FirstFirst ... 3575838485868795 ... LastLast
Results 1,261 to 1,275 of 1496
  1. #1261
    Join Date
    April 2014
    Posts
    37

    Channel Icon not persistent

    Hello,

    i have made some tool where the Users on my TeamSpeak can upload their own TeamSpeak Channel Icons via my Website!
    I am currently using the TS3 PHP Framework for it!

    So the main Problem I have is, when I restart my TeamSpeak Server then the Icons IDs are not connected anymore to the Channel!
    In the Query Documentation (http://media.teamspeak.com/ts3_liter...y%20Manual.pdf) I have found a parameter "savedb" but there is not a real documentation about it and what it does.

    If i search the Database (I am aware that this is not supported and I am using MariaDB ) there is no parameter on my Channel ID called "CHANNEL_ICON_ID".

  2. #1262
    Join Date
    May 2016
    Posts
    1
    Hi,

    have you an exemple script to start a virtual server with the port ?

  3. #1263
    Join Date
    May 2016
    Posts
    2

    Limit channel creation

    Hi, how do I limit a ser of (1 Main Channel and 4 Sub-channels per user) in this example config?:

    PHP Code:
    <?php
    require_once ("TeamSpeak3.php");
    include (
    'config.php');
    error_reporting(0);
    session_start();
    if(!isset(
    $_SESSION['ts3_last_query']))
        
    $_SESSION['ts3_last_query'] = microtime(true);

    if(
    $_SESSION['ts3_last_query'] >= microtime(true))
        die(
    'You Need Wait 10 Seconds For Create Channel Again.');

    $_SESSION['ts3_last_query'] = microtime(true)+10.0;

    $ChannelName $_POST['name'];
    $SubChannelName $_POST['subname'];
    $ChannelPassword $_POST['ChannelPass'];
    $SubChannelPass $_POST['SubChannelPass'];
    $idUnica $_POST['idts'];

    if (!
    $ChannelName || !$idUnica) {
        echo 
    "Introduceti ambele detalii Numele Canalului dar și UniqId-ul";
        exit();
    }

    $ts3_VirtualServer TeamSpeak3::factory("serverquery://" $UserAdmin ":" $PWQuery "@" $IP_TS ":" $PuertoQuery "/?server_port=" .  $PuertoTS "&blocking=0&nickname=" $nickname "");
    $ListaDeChannels $ts3_VirtualServer->request("channellist")->toString();

    if (
    strpos($ListaDeChannels$ChannelName)) {
        echo 
    "Acest canal există deja!";
        exit();
    }
    $clID $ts3_VirtualServer->clientGetByUid($idUnica);
    $sub_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => $ChannelName,
        
    "channel_password" => $ChannelPassword,
        
    "channel_codec" => TeamSpeak3::CODEC_OPUS_VOICE,
        
    "channel_topic" => "Canal creat via EvDBoard",
        
    "channel_flag_permanent" => TRUE,
        
    "cpid"                   => '57',
    ));
    $sub2_cid $ts3_VirtualServer->channelCreate(array(
        
    "channel_name" => $SubChannelName,
        
    "channel_password" => $ChannelPassword,
        
    "channel_codec" => TeamSpeak3::CODEC_OPUS_VOICE,
        
    "channel_topic" => "Canal creat via EvDBoard",
        
    "channel_flag_permanent" => TRUE,
        
    "cpid"                   => $sub_cid,
    ));
    $clID $ts3_VirtualServer->clientGetByUid($idUnica);
    $infoCliente $ts3_VirtualServer->execute("clientgetnamefromuid", array(
        
    "cluid" => $idUnica
    ))->toList();
    $cldbid strval($infoCliente['cldbid']);
    $ts3_VirtualServer->execute("clientmove", array(
        
    "clid" => $clID,
        
    "cid" => $sub_cid
    ));
    $ts3_VirtualServer->execute("setclientchannelgroup", array(
        
    "cldbid" => $cldbid,
        
    "cid" => $sub_cid,
        
    "cgid" => '9'
    ));
    echo 
    "Felicitări canalul tău a fost creat ! Ședere plăcută Ón continuare !";
    ?>

  4. #1264
    Join Date
    May 2014
    Posts
    10

    Need help with IP grabber

    How to get address IP of connected user?

    Code:
    foreach($ts3_VirtualServer->clientList() as $client)
    {
            if($client["client_type"]) continue;
            $clientInfo = $client->getInfo();
    	echo $clientInfo['connection_client_ip'];
    }
    Found something like that... but this code show ALL address IP connected to server (69.69.69.69123.123.123.12399.99.99.99).
    How to check only a connected user - for example my IP without any informations (clientid etc.).


    Edit: i'm so fk dumb, just added $ip = $_SERVER['REMOTE_ADDR']; and working PERFECT!
    Last edited by Frohser; May 10th, 2016 at 11:25 AM.

  5. #1265
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Hey there,

    I'm sorry that I kept you guys waiting so long... my little newborn daughter took first priority.



    Hopefully I can help with some of the issues described here.

    Quote Originally Posted by Dennisbrittv View Post
    Hi

    ok i got it and for other people with the issue, this is how i solved it

    i post the new order reversed like this 200,109,150,2 etc

    PHP Code:
    if ($mode == "movechannel") {
        
    $neworder explode(','$channel_order);
        foreach (
    $neworder as $channel_id) {
        
    $channel $ts3_VirtualServer->channelGetById($channel_id); 
        
    $change = array("cid=".$channel_id,"channel_order=0");
        
    $channel->modify($change);   
        }
        die();
        

    what this is doing is taking the new order in reverse and making each one "Top" until the first one becomes bottom!

    messy I know but its working

    only one thing is that it doesnt update my client ts fully until i disconnect

    what i would like to do is die with a "refresh all clients" command if such a command exists

    any ideas?
    So if I understand this correctly, you'd like to sort a list of channels on the same level by specifying their IDs in the correct order... Here's a quick-and-dirty example for that:

    PHP Code:
    $ids = array(32154);
    $pos 0;

    foreach(
    $ids as $id)
    {
      
    $server->channelGetById($id)->channel_order $pos;
      
    $pos $id;

    As you can see, I just walk through the list of IDs, grab and update the appropriate channel object. Your first attempt using the channelmove feature did not work as that command is intended to move a channel to another level.



    Quote Originally Posted by SUNSHINE. View Post
    Hi,

    have you an exemple script to start a virtual server with the port ?
    Quote Originally Posted by maribro124 View Post
    HELP Server Start Not Work
    Not pasting your entire code here as it contained too many errors... Basically, the snippet to start a virtual server is this:

    PHP Code:
    $server TeamSpeak3::factory("serverquery://user:[email protected]:port/?virtualserver_port=12345#use_offline_as_virtual");

    $server->start(); 
    It's very important to use the use_offline_as_virtual flag in this example. Otherwise, it would not be possible to select the virtual server as the use command will prevent this per default for servers that are currently offline.



    Quote Originally Posted by hackerpedro View Post
    Hi, how do I limit a ser of (1 Main Channel and 4 Sub-channels per user) in this example config?:
    Could you please give me a few more details on what you're trying to do? Do you want to create a set of channels with a user limit?

  6. #1266
    Join Date
    May 2014
    Posts
    10

    Need help again...

    Quote Originally Posted by Frohser View Post
    How to get address IP of connected user?

    Code:
    foreach($ts3_VirtualServer->clientList() as $client)
    {
            if($client["client_type"]) continue;
            $clientInfo = $client->getInfo();
    	echo $clientInfo['connection_client_ip'];
    }
    Found something like that... but this code show ALL address IP connected to server (69.69.69.69123.123.123.12399.99.99.99).
    How to check only a connected user - for example my IP without any informations (clientid etc.).


    Edit: i'm so fk dumb, just added $ip = $_SERVER['REMOTE_ADDR']; and working PERFECT!

    $_SERVER['REMOTE_ADDR'] work's good when i have database with IP's (to proof) but..

    I had database with IP address all connected user but... my mysql just died last night and i can't proof their identities so... is there a possibility to check on website that user is connected to the server? I'm creating a small php function that create a new channel and add servergroup for user when he want if he's online on TS3.

    PS. I already have done creating channels and add servergroups but this check if user is connected, damn...

  7. #1267
    Join Date
    May 2016
    Posts
    2
    Quote Originally Posted by ScP View Post
    Hey there,

    I'm sorry that I kept you guys waiting so long... my little newborn daughter took first priority.



    Hopefully I can help with some of the issues described here.

    So if I understand this correctly, you'd like to sort a list of channels on the same level by specifying their IDs in the correct order... Here's a quick-and-dirty example for that:

    PHP Code:
    $ids = array(32154);
    $pos 0;

    foreach(
    $ids as $id)
    {
      
    $server->channelGetById($id)->channel_order $pos;
      
    $pos $id;

    As you can see, I just walk through the list of IDs, grab and update the appropriate channel object. Your first attempt using the channelmove feature did not work as that command is intended to move a channel to another level.





    Not pasting your entire code here as it contained too many errors... Basically, the snippet to start a virtual server is this:

    PHP Code:
    $server TeamSpeak3::factory("serverquery://user:[email protected]:port/?virtualserver_port=12345#use_offline_as_virtual");

    $server->start(); 
    It's very important to use the use_offline_as_virtual flag in this example. Otherwise, it would not be possible to select the virtual server as the use command will prevent this per default for servers that are currently offline.



    Could you please give me a few more details on what you're trying to do? Do you want to create a set of channels with a user limit?
    You cant take a look here about what is been done, the only thing I have left to do is:
    - Auto delete channels in 30 days if there is no activity;
    - Register e-mail when the channels is created so that users can recover channel password if lost and manage is channels! (So, only one main channel with 4 sub-channels should be allowed per user);
    - Only one set of 5 channels per "client IP" and "UniqueID" (so when the client connects to the panel if he has any channel created a management panel appears *);
    - * When the client access the CREATE CHANNEL URL again, if the "client IP" or "unique ID" already has a channel, a panel is presented to manage the channels, like this:
    Your Nickname ([ONLY READ])

    Main Channel ([OPTION] CHANGE NAME and DETELE ALL MY CHANNELS)
    Sub-Channel NAME 1 ([OPTION] CHANGE NAME and CAN NOT BE DELETED)
    Sub-Channel NAME 2 ([OPTION] ADD (if does not exists) or CHANGE NAME (if exists) or CHANGE OWNER (if exists) or DELETE (if exists))
    Sub-Channel NAME 3 ([OPTION] ADD (if does not exists) or CHANGE NAME (if exists) or CHANGE OWNER (if exists) or DELETE (if exists))
    Sub-Channel NAME 4 ([OPTION] ADD (if does not exists) or CHANGE NAME (if exists) or CHANGE OWNER (if exists) or DELETE (if exists))

    E-mail registered ([OPTION] CHANGE E-MAIL)

    SUBMIT CHANGES ([BUTTON])

    and I am in serious trouble because the urgent thing is to limit the channel creation per user so that the teamspeak does not get SPAMMED.

    Appreciate the time you take to answer
    Congrats on your new born
    Last edited by Chris; May 12th, 2016 at 07:31 AM.

  8. #1268
    Join Date
    May 2016
    Posts
    2

    Teamspeak 3 PHP Framework help

    Hi there,
    I'm quite new to the Teamspeak 3 php Framework, although I have figured out everything else that I need, i'm just having troubles with this:

    How do you modify a Channel? I have tried with $ts3_VirtualServer->channelModify(); and given an array as a parameter, such as the cid, channel_name etc. But it throws an error saying that there's no node method like this. I have tried many other things, such as extending the Channel classes and what not, still didn't work. I have also read the documentation on the "Channelmodify()" still haven't figured it out because the documentation doesn't contain that much information.

    Also I need to modify a Server, I believe that it's the same process as the channel. I also kinda doubt that this is probably an easy thing to do that I just couldn't figure it out by myself.

    Thank you

  9. #1269
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by namelessUser View Post
    Hi there,
    I'm quite new to the Teamspeak 3 php Framework, although I have figured out everything else that I need, i'm just having troubles with this:

    How do you modify a Channel? I have tried with $ts3_VirtualServer->channelModify(); and given an array as a parameter, such as the cid, channel_name etc. But it throws an error saying that there's no node method like this. I have tried many other things, such as extending the Channel classes and what not, still didn't work. I have also read the documentation on the "Channelmodify()" still haven't figured it out because the documentation doesn't contain that much information.

    Also I need to modify a Server, I believe that it's the same process as the channel. I also kinda doubt that this is probably an easy thing to do that I just couldn't figure it out by myself.

    Thank you
    There are three ways to modify an object:

    PHP Code:
    // get a channel object
    $channel $server->channelGetByName("My Channel");

    // update a single property using __set()
    $channel->channel_name "My new channel name";

    // update a single property using ArrayAccess
    $channel["channel_name"] = "My new channel name";

    // update multiple properties at once
    $channel->modify(array(
      
    "channel_name"  => "My new channel name",
      
    "channel_topic" => "XYZ"
    )); 

  10. #1270
    Join Date
    May 2016
    Posts
    2

    Thumbs up Thank you for your help

    Quote Originally Posted by ScP View Post
    There are three ways to modify an object:

    PHP Code:
    // get a channel object
    $channel $server->channelGetByName("My Channel");

    // update a single property using __set()
    $channel->channel_name "My new channel name";

    // update a single property using ArrayAccess
    $channel["channel_name"] = "My new channel name";

    // update multiple properties at once
    $channel->modify(array(
      
    "channel_name"  => "My new channel name",
      
    "channel_topic" => "XYZ"
    )); 

    So basically updating the Object will also update the Teamspeak, hmm... never thought of that. Thank you very much for your help. Really Appreciate it

    Regards

  11. #1271
    Join Date
    July 2015
    Posts
    1

    Post Script for me!

    Hello guys! I need a simple script for start, stop, restart my virtual server, and if this can show me server banner, and generate new token for Server Admin. Where can i find it?

  12. #1272
    Join Date
    May 2016
    Posts
    2
    Hey,

    Can someone tell me if it is possible to hide certain channels?

    I am using the framework as a viewer for my site and wish to hide all channels under a cspacer I have them as all sub-channels to.

  13. #1273
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by cserko93 View Post
    Hello guys! I need a simple script for start, stop, restart my virtual server, and if this can show me server banner, and generate new token for Server Admin. Where can i find it?
    Basically, this is how it works:

    PHP Code:
    // connect and grab server object
    $server TeamSpeak3::factory("serverquery://user:[email protected]:10011?virtualserver_port=9987#use_offline_as_virtual");

    // start server
    $server->start();

    // stop server
    $server->stop();

    // identify admin group and generate token
    $token $server->serverGroupIdentify()->privilegeKeyCreate("additional admin token"); 
    Restarting the virtual server should be as easy as stopping and starting it using the two methods above.



    Quote Originally Posted by nlmadmax View Post
    Hey,

    Can someone tell me if it is possible to hide certain channels?

    I am using the framework as a viewer for my site and wish to hide all channels under a cspacer I have them as all sub-channels to.
    Yes, that is possible, but you'd have to create your own viewer implementation using the TeamSpeak3_Viewer_Interface interface. You can start by copying the existing HTML viewer class and modify it to suit your needs.

  14. #1274
    Join Date
    May 2016
    Posts
    1

    Problem with PHP script, someone can help me?

    Hello, I'm Exunious
    I'am new to this forum!

    And I have a problem with a script I edited.
    To check the server of my teamspeak server.

    It stay saying that my teamspeak server is offline.
    But Im at this point online at my server, so it seems not offline.
    Maybe Im doing something wrong I dont know.

    PHP Code:
    <?php

    // Load TeamSpeak 3 Framework
        
    require_once('libraries/TeamSpeak3/TeamSpeak3.php');

    // TeamSpeak 3 Server Information
        
    $serverquery_username "----";     //Serverquery login username
        
    $serverquery_pass "----";     //Serverquery login password
        
    $serverip "ts3.un-gm.com";         //Teamspeak 3 server IP, only IP not port
        
    $serverquery_port "10011";         //Serverquery port
        
    $serverport "9987";             //Teamspeak 3 server port

    // Connect, and get the information
    try {
      
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://$serverquery_username:$serverquery_pass@$serverip:$serverquery_port/?server_port=$serverport");
      
    // Shows the information
      
    echo "Server Status: online<br />\n";
      echo 
    "Server IP: " .$ts3_VirtualServer->getAdapterHost(). ":" .$ts3_VirtualServer->virtualserver_port"<br />\n";
      echo 
    "Server Name: " .$ts3_VirtualServer->virtualserver_name"<br />\n";
      echo 
    "Server Uptime: " .TeamSpeak3_Helper_Convert::seconds($ts3_VirtualServer->virtualserver_uptime). "<br />\n";
      echo 
    "Server Version: " .TeamSpeak3_Helper_Convert::version($ts3_VirtualServer->virtualserver_version). "<br />\n";
      echo 
    "Current Clients: " .$ts3_VirtualServer->virtualserver_clientsonline" / " .$ts3_VirtualServer->virtualserver_maxclients"<br />\n"; }

    catch(
    Exception $e) {

    // Show the error, if the server is offline
      
    echo "Server Status: <font color=red><b>offline</b></font><br />\n"; } 

    ?>
    I tried it with a IP adress and with a domain.
    both give same problem.

    And yes, I have the latest Framework, and yes its on the right position.

    Greetings Exunious

    Edit: I checked my white list, and add the IP of my website, but still it wont work.
    I also changed the whole script + $e->getMessage()
    Now I see a message; Connection timed out

    PHP Code:
    <?php

    // Load TeamSpeak 3 Framework
        
    require_once('libraries/TeamSpeak3/TeamSpeak3.php');

    // TeamSpeak 3 Server Information
        
    $serverquery_username "----";     //Serverquery login username
        
    $serverquery_pass "----";     //Serverquery login password
        
    $serverip "5.100.228.117";         //Teamspeak 3 server IP, only IP not port
        
    $serverquery_port "10011";         //Serverquery port
        
    $serverport "9987";             //Teamspeak 3 server port

    // Connect, and get the information
    try {
      
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://$serverquery_username:$serverquery_pass@$serverip:$serverquery_port/?server_port=$serverport");

    // Gather the information
        
    $server_status $ts3_VirtualServer->virtualserver_status;
        
    $server_name $ts3_VirtualServer->virtualserver_name;
        
    $server_uptime TeamSpeak3_Helper_Convert::seconds($ts3_VirtualServer->virtualserver_uptime);
        
    $server_actuallyusers $ts3_VirtualServer->virtualserver_clientsonline $ts3_VirtualServer->virtualserver_queryclientsonline;
        
    $server_maxusers $ts3_VirtualServer->virtualserver_maxclients;
        
    $server_version TeamSpeak3_Helper_Convert::version($ts3_VirtualServer->virtualserver_version);
      
    // Shows the information
      
    echo "Server Status: ".$server_status." <br />\n";
      echo 
    "Server IP: ".$serverip.":".$serverport." <br />\n";
      echo 
    "Server Name: ".$server_name." <br />\n";
      echo 
    "Server Uptime: ".$server_uptime." <br />\n";
      echo 
    "Server Version: ".$server_version." <br />\n";
      echo 
    "Current Clients: ".$server_actuallyusers." / ".$server_maxusers." <br />\n"; }

    catch(
    Exception $e) {

    // Show the error, if the server is offline
      
    echo "Server Status: <font color=red><b>Offline</b></font><br />\n";
      echo 
    "Reason: ".$e->getMessage(); } 

    ?>
    Last edited by Exunious; May 23rd, 2016 at 07:49 PM. Reason: Added new code

  15. #1275
    Join Date
    May 2016
    Posts
    5
    I feel like im some sort of stupid dude who misses a point but here it goes.

    So i been programing a bot that auto assigns server groups depening on names(just testing nothing to serius) but i noticed that while waiting on an event its just randomly losses connections after exactly 10 mins.
    I have set set_time_limit(0), default socket time to -1 and even 60(yes i know its seconds) and most of the other settings are hardcorded to unlimited in CLI, but i guess im missing something?
    i there some other settings in php.ini that i need to fix that it wont timeout? or maybe its the ts server that thinks i lost connection?

    PHP Code:

    $ts3_VirtualServer 
    TeamSpeak3::factory("serverquery://letskeep a secret :)");

    $ts3_VirtualServer->notifyRegister("server");

    TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyEvent""onEventmessage");

    while(
    1){
        
    $ts3_VirtualServer->getAdapter()->wait();
    }
    function 
    onEventmessage(TeamSpeak3_Adapter_ServerQuery_Event $eventTeamSpeak3_Node_Host $host)
    {
    //does stuff

    this is the code so far and it does stuff on on join and leaves as it should its just the timeout i dont understand.

    running CLI for it

    fixed it with the serverqueryWaitTimeout function that i found deep down here
    Last edited by klammen; May 29th, 2016 at 10:53 PM. Reason: fixed

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP Framework
    By Multivit4min in forum Permission System
    Replies: 1
    Last Post: June 29th, 2015, 11:28 AM
  2. PHP Framework
    By phil998 in forum Server Support
    Replies: 0
    Last Post: February 25th, 2015, 06:27 PM
  3. TS3 PHP Framework Visualizations
    By Ronin Design in forum Tools / Web Based
    Replies: 2
    Last Post: February 22nd, 2015, 05:04 AM
  4. Extraction using the Framework
    By HarryMW in forum Tools / Web Based
    Replies: 1
    Last Post: August 3rd, 2012, 07:04 PM
  5. Teamspeak, PHP Framework?
    By mario2027 in forum General Questions
    Replies: 1
    Last Post: December 21st, 2010, 09:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •