Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Page 54 of 100 FirstFirst ... 444525354555664 ... LastLast
Results 796 to 810 of 1498
  1. #796
    Join Date
    December 2012
    Location
    Paris, France
    Posts
    185
    For your first script you dont set $out this cannot work like this :/

    PHP Code:
    require_once 'libraries/TeamSpeak3/TeamSpeak3.php';
    $server = array( 
      
    "tsip" => "localhost",
      
    "tsport" => "9987",
      
    "ts_query_admin" => "serveradmin",
      
    "ts_query_password" => "*******",
      
    "ts_query_port" => "10011",
      
    "ts_query_user_nick" => "Serverclientviewer"
    );
    try {
      
    TeamSpeak3::init();
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://".$server["ts_query_admin"].":".$server["ts_query_password"]."@".$server["tsip"].":".$server["ts_query_port"]."/?server_port=".$server["tsport"]."&nickname=".$server["ts_query_user_nick"]."");

      
    $max = (int) $ts3_VirtualServer['virtualserver_maxclients'];
      
    $now = (int) $ts3_VirtualServer['virtualserver_clientsonline'] - 1// server count us as a client so -1
      
    echo "max:{$max} now:{$now}";
    } catch(
    Exception $e) {
      echo 
    "Fehler!<br/>ErrorID: <b>"$e->getCode() ."</b>; Error Message: <b>"$e->getMessage() ."</b>;";

    Please use PHP BBCODE (available in advanced mode) to post sources.

  2. #797
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    @Toine: Just a small hint about this line in your snippet:

    PHP Code:
    $now = (int) $ts3_VirtualServer['virtualserver_clientsonline'] - 1// server count us as a client so -1 
    The server property virtualserver_clientsonline contains the number of regular clients and query clients connected to the server. Assuming that only 1 query client is connected while the script is running might give you the correct result 99.9% of the time, but I'd always recommend using this code:

    PHP Code:
    $now $ts3_VirtualServer->clientCount(); 
    The clientCount() method returns the number of regular clients by subtracting virtualserver_queryclientsonline from virtualserver_clientsonline.

  3. #798
    Join Date
    March 2011
    Posts
    10
    Hi,

    This week I started creating a clan bot for our Teamspeak.
    I'm using the notifiers to register join & text events, but I've got some problems with the notifyTextmessage event.

    I'm using the following code to register an event:
    PHP Code:
    $ts3->notifyRegister("server");
    $ts3->notifyRegister("textchannel"0); // Using 0 so it should listen to all channels

    TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyCliententerview""checkClientPermission");
    TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage""sendMessage"); 
    The event notifyCliententerview works great, but notifyTextmessage only works in the default channel.
    I've read that I need to use the id 0 to listen to all channels, but that doesn't work

    Am I doing something wrong?

    Thanks!

  4. #799
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    You can only receive channel messages from the channel you are in! Like in the client!
    If you want to listen in other channels, move your bot there or create several instances that move to multiple channels.

  5. #800
    Join Date
    January 2014
    Posts
    1
    Hey guys i'm new arrond here but i'm following this project for a long time now and Good job.

    My question is simple, i want to get/show the icon of a servergroup but the codes that i've tried or shows nothing or an error message saying that the paramters aren't set correctly. Any sugestions on how to get this?

  6. #801
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by thecoolguy View Post
    My question is simple, i want to get/show the icon of a servergroup but the codes that i've tried or shows nothing or an error message saying that the paramters aren't set correctly. Any sugestions on how to get this?
    Please paste a snippet of your code.

  7. #802
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    I noticed that everytime a channel is created trough the web interface, the TS server has packet loss, depending on the host of the PHP script, it can be high or low. It also seems to higher with more users online.

    In my server for example I get an increase of 0.2%, others have like 5% increase, my VPS where the PHP is, is faster than the others, so there must be something causing load.

    I'm using the provided methods of the framework.

    Does the channel creation requests something new that would cause this? Like re-fetching channels & clients?

    BTW, the follow the same logic:

    -> create spacer, create channel, with some permissions... nothing else!

  8. #803
    Join Date
    July 2006
    Posts
    1,600
    Quote Originally Posted by barricas View Post
    I noticed that everytime a channel is created trough the web interface, the TS server has packet loss, depending on the host of the PHP script, it can be high or low. It also seems to higher with more users online.

    In my server for example I get an increase of 0.2%, others have like 5% increase, my VPS where the PHP is, is faster than the others, so there must be something causing load.

    I'm using the provided methods of the framework.

    Does the channel creation requests something new that would cause this? Like re-fetching channels & clients?

    BTW, the follow the same logic:

    -> create spacer, create channel, with some permissions... nothing else!
    This report sounds interesting however I do not think this is caused solely by the framework.
    If so the teamspeak protocol itself is responsible for any actions caused by commands via the serverquery interface.
    As you can see here http://docs.planetteamspeak.com/ts3/...bf623d4bc0ec08 a channel creation resets the channel list which forces the framework to receive it once again as soon as neccessary but not immediate.

  9. #804
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    I also saw that it resets the list, but it only sets to null. I'm not really sure why this packet loss happens, but it is only to the create channel function ( I tested a lot, even stuff like mass codec changes and heavy things is OK).

  10. #805
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by barricas View Post
    I also saw that it resets the list, but it only sets to null. I'm not really sure why this packet loss happens, but it is only to the create channel function ( I tested a lot, even stuff like mass codec changes and heavy things is OK).
    The same thing will probably happen if you execute the same commands with the TeamSpeak 3 Client software.

    While it's true that all clients will get a notification about the new channel to update their treeview, I think creating the channel is not a big deal for the server, but setting permissions causes several database operations (which are not async afaik). Anyway... as maxi already stated, I think this is not an issue of the framework... but maybe the TS team should have a look at this issue and see if there's something to optimize in the server code.

  11. #806
    Join Date
    June 2012
    Location
    Portugal
    Posts
    317
    I understand. I tried to extensively look, thinking it would be a fault in my code but I always saw that it would be only in this function.
    I looked at the docs and would never get why it would cause lag as nothing was wrong.

    Now that makes sense. I assign channel admin to the user and edit channel permissions.

    I will open a bug thread and point to your post.

    Edit: Yap, removed permissions assignment and the difference was abysmal. Used to jump like 10% and now ~1% not even noticiable.

    Are the permissions not done in another thread or something that cause this? The CPU load in the TS Server VPS never spikes.

    Edit 2: As suspected by ScP is caused by the DB operations not being async.
    Last edited by barricas; January 7th, 2014 at 06:36 PM.

  12. #807
    Join Date
    January 2014
    Posts
    13

    looking to query from my website to add users to a group when they fill out a form

    Trying to use a form so when a user fills it out and hits submit, it matches there name and ip and then query's the ts3 server to add said cldbid to said sgid. (without server restart) I have the form where it finds the users cldbid, but cant figure out the query part. please help me, if u can take what I have and turn it into something that works that would be awesome.



    form html and php [and yes I know direct chages to database require restart and is not recommended] I learned the hard way.

    PHP Code:
    <?php
    $group_id 
    "9";
    $server_id "1";
    $id2 "0";
    $ts3_username '';
    $password '';
    $email '';
    $age '';
    $steam_username '';
    $origin_username '';
    $msg '';
    if (isset(
    $_POST["ts3_username"]) && isset($_POST["password"]) && isset($_POST["email"]) && isset($_POST["age"])) {
          
    $ts3_username $_POST['ts3_username'];
          
    $password $_POST['password'];
          
    $email $_POST['email'];
          
    $age $_POST['age'];
          
    $steam_username $_POST['steam_username'];
          
    $origin_username $_POST['origin_username'];
          if((!
    $ts3_username)){
            
    $msg .= "TS3 Username Is Required.<br/>";
          }if((!
    $password)){
            
    $msg .= "Password Is Required.<br/>";
          }if((!
    $email)){
            
    $msg .= "Email Is Required.<br/>";
          }if((!
    $age)){
            
    $msg .= "Please Select Your Age.<br/>";
          }else{
            include_once(
    "scripts/connect.php");
            
    $password md5($password);
            
    $ip $_SERVER['REMOTE_ADDR']; 
            
    $email_check mysql_query("SELECT email FROM members WHERE email='$email' LIMIT 1");
            
    $email_count mysql_num_rows($email_check);
            
    $ts3_name_check mysql_query("SELECT client_nickname FROM clients  WHERE client_nickname='$ts3_username' AND client_lastip='$ip' LIMIT 1");
            
    $ts3_name_count mysql_num_rows($ts3_name_check);
            if(
    strlen($password) < 6){
                
    $msg .= "Password length needs to be 6 or more.<br/>";
            }else if(
    strlen($email) < 5){
                
    $msg .= "Please insert a valid Email.<br/>";
            }else if(
    $email_count == 1){
                
    $msg .= "That email is allready taken.<br/>";
             }else if(
    $ts3_name_count 1){
                
    $msg .= "TS3 Username Not In Database.<br/>";
            }else{
                
    $ts3_id_check mysql_query("SELECT client_id FROM clients WHERE client_nickname='$ts3_username' AND client_lastip='$ip' LIMIT 1");
                
    $ts3_id_count mysql_num_rows($ts3_id_check);
                if (
    $ts3_id_count == 1){
                    while(
    $row mysql_fetch_array($ts3_id_check)) 
                        
    $id1 $row["client_id"];
                        
    $sql1 mysql_query("INSERT INTO members(ts3_username, password, email, age, steam_username, origin_username,created) VALUES('$ts3_username','$password','$email','$age','$steam_username','$origin_username',now())");
                        
    $sql2 mysql_query("INSERT INTO group_server_to_client(group_id, server_id, id1, id2) VALUES('$group_id','$server_id','$id1','$id2')");
                        exit();
                
                }                
            }
        }
    }
          

    ?>
    HTML Code:
    <html>
    <style type="text/css">
    body{
    	 background-image:url(Images/main_background.jpg);
    	 background-size:cover;
    	 background-attachment: fixed;
         background-repeat: no-repeat;
         background-position: center center;>
    }
    </style>
    
    
    <body>
    <?php include_once("Scripts/template_header.php");?>
    <?php include_once("Scripts/template_navigation.php");?>
              
                <table  align="center" width="700px" height="50" cellspacing="0" border="4" bgcolor="#000000" bordercolor="#000000" >
                    <tr>
                        <td height="48" align="left" style="font-family:Verdana, Geneva, sans-serif;color:#F00;font-size:30px;font-weight:bold">Create an Account</td>
                    </tr>
    </table>   
                          <form method="post" action="signup.php" enctype="multipart/form-data">
                            <table aling align="center" width="700px" cellpadding="4" cellspacing="4" border="4" bgcolor="#666666" >
                                   <tr>
                                        <td align="right"><label style="color:#F00;font-weight:bold">TS3 Username*:</label></td>
                                        <td align="left"><input type="text" name="ts3_username" class="text_input" maxlength="30" /></td>
                                   </tr>
                                   <tr>
                                       <td align="right"><label style="color:#F00;font-weight:bold">password*:</label></td>
                                       <td align="left"><input type="password" name="password" class="text_input" maxlength="20" /></td>
                                   </tr>
                                   <tr>
                                       <td align="right"><label style="color:#F00;font-weight:bold">Email*:</label></td>
                                       <td align="left"><input type="email" name="email" class="text_input" maxlength="30" /></td>
                                   </tr>
                                   <tr>
                                        <td align="right" width="150"><label style="color:#F00;font-weight:bold">Age*:</label></td>
                                        <td align="left">
                                            <select name="age" class="text_input">
                                            <option value=""></option>
                                             <?php include_once("scripts/age_options.txt"); ?>
                                            </select>
                                        </td>
                              </tr>
                                   <tr>
                                       <td align="right"><label style="color:#F00;font-weight:bold">Steam Username:</label></td>
                                       <td align="left"><input type="text" name="steam_username" class="text_input" maxlength="30" /></td>
                                   </tr>
                                   <tr>
                                       <td align="right"><label style="color:#F00;font-weight:bold">Origin Username:</label></td>
                                       <td align="left"><input type="text" name="origin_username" class="text_input" maxlength="30" /></td>
                                   </tr>
                                   
                                   <tr>
                                       <td align="right" colspan="2"> <table align="left">
                                             <tr>
                                              <td align="center" style="font-size:18px;font-weight:bold;color:#F00"><?php echo $msg; ?></td>
                                             </tr>
                                      </table>                                                               
                                                            
                                         <input type="submit" name="submit" id="submit" value="Create Account"/></td>
                                   </tr>
                                     
                                   
                            </table></form>     
                        
    
    </body>
    
    
    <?php include_once("Scripts/template_footer.php");?>
    
    </html>



    These are the errors im getting with what I have.

    ( ! ) Fatal error: Uncaught exception 'TeamSpeak3_Node_Exception' with message 'node method 'serverGroupClientAdd()' does not exist' in C:\Program Files (x86)\Web Server\www\libraries\TeamSpeak3\Node\Abstract.php on line 382


    ( ! ) TeamSpeak3_Node_Exception: node method 'serverGroupClientAdd()' does not exist in C:\Program Files (x86)\Web Server\www\libraries\TeamSpeak3\Node\Abstract.php on line 382


    Call Stack


    #

    Time

    Memory

    Function

    Location

    1 0.0004 249088 {main}( ) ..\ts3test.php:0
    2 0.0416 1414360 serverGroupClientAdd ( ) ..\ts3test.php:25
    3 0.0416 1414776 TeamSpeak3_Node_Abstract->__call( ) ..\ts3test.php:25


    this is query code im trying to use. I tried it in a separate php file trying to give one of my users admin, but I get errors

    PHP Code:
    <?php

    $sgid 
    '6';
    $idDB '8';    



    /* set error reporting levels */
    error_reporting(E_ALL E_STRICT);

    /* set default timezone */
    date_default_timezone_set("Europe/London");


    /* load framework library */
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");

    $usrname "My query username";
    $pass "myuserpassword that I created with my server admin, though the query login";
    $host "127.0.0.1";
    $qport 10011;
    $sport 9987;
    /* connect to server, authenticate and get TeamSpeak3_Node_Server object by URI */
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://{$usrname}:{$pass}@{$host}:{$qport}/server_port={$sport}");
    $ts3_VirtualServer->serverGroupClientAdd($sgid,$idDB);

    ?>




    thanks so much, I would love to get this working.

  13. #808
    Join Date
    February 2013
    Posts
    47
    hi, can be traced through the user id to the channels / sub-channels created by him and view them from a web page in order to add additional sub-channel?

    You can also create a small preview of all channels, sub-channels, and users connected to a particular channel? thanks

  14. #809
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,527
    Quote Originally Posted by Death_Balgor View Post
    hi, can be traced through the user id to the channels / sub-channels created by him and view them from a web page in order to add additional sub-channel?
    No. even the TS3 server does not know who created a channel. The server fires an event that contains the ID of the invoking client when a channel is created, but if none is around to receive the notification in that moment, you have no way to determine who created a channel (except parsing the log files... but that would be stupid).

    Anyway... you could create some kind of web interface with a tiny database backend that allows users to create channels.

    Quote Originally Posted by Death_Balgor View Post
    You can also create a small preview of all channels, sub-channels, and users connected to a particular channel? thanks
    Yes. The framework includes an interface that allows you to implement your own viewer class or just use the two existing classes I ship. Please check this code snippet in the docs:

    http://docs.planetteamspeak.com/ts3/...html#example11

  15. #810
    Join Date
    July 2006
    Posts
    1,600
    The process of channel creation can only be traced if you enabled the according logging option.
    You can derive the ownership by checking the 'Channel Admin' groups on certain users but keep in mind that this membership may not be unique.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •