Forum

Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    January 2014
    Location
    Longuich
    Posts
    10

    Smile Autostart with php

    Hi,

    I've written a script which any server start or stop. It works!
    Now I wanted that when I shut down the server, stop the auto start (set 0).
    Unfortunately it does not work and there is a mistake.


    Look:
    PHP Code:
    <?php

    require_once('../include/libraries/TeamSpeak3/TeamSpeak3.php');

          
    $server = array( 
                  
    "tsip" => "***********",
                  
    "ts_query_admin" => "serveradmin",
                  
    "ts_query_password" => "******",
                  
    "ts_query_port" => "10010",
              );
          
    $value2 = array(
                  
    "virtualserver_port" => "3000",
          
          );

          try {
                  
    TeamSpeak3::init();
                  
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://".$server["ts_query_admin"].":".$server["ts_query_password"]."@".$server["tsip"].":".$server["ts_query_port"]."");
                  
    $client $ts3_VirtualServer->serverStop('12');
                        
    $ts3_VirtualServer->selectServer($value2['virtualserver_port'], 'port'true);
                        
    $autostart_edit=$ts3->serverEdit(array('virtualserver_autostart'=>$value['auto']));
              
              } catch(
    Exception $e) {
                       echo 
    "Fehler!<br/>ErrorID: <b>"$e->getCode() ."</b>; Error Message: <b>"$e->getMessage() ."</b>;";
              }

    ?>
    The script is based on the framework of @ScP

    The Error: ErrorID: 0; Error Message: node method 'selectServer()' does not exist;

    Can me someone help?

    Thanks,

    Pascal

  2. #2
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,266
    I don't know php or that framework. I know how server query works, and your frame work/script seem to use server query!

    With server query when the server is stopped you can't change the autostart value out of the box. Because the "use sid=xxx" command will fail on a stopped server. To edit a stopped server you'll need the "use sid=xxx -virtual" command.

  3. #3
    Join Date
    January 2014
    Location
    Longuich
    Posts
    10
    Hi,

    I've tried the scrip with stopped and the started server.

    Can you give me an example to the query command?

  4. #4
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,266
    in server query it will look like:

    Code:
    login client_login_name=serveradmin client_login_password=xyz
    serverstop sid=1
    use sid=1 -virtual
    serveredit virtualserver_autostart=0

  5. #5
    Join Date
    January 2014
    Location
    Longuich
    Posts
    10
    Thank you, does anyone have an example for the framework? :/

  6. #6
    Join Date
    December 2004
    Location
    RF
    Posts
    3,007
    You haven't specified, what problem you're trying to solve with such [extraordinary] methods.

  7. #7
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,266
    Quote Originally Posted by psorgen View Post
    Thank you, does anyone have an example for the framework? :/
    You might want to try and read the manual of the framework. I think your function call isn't correct.

    selectServer($value2['virtualserver_port'], 'port', true);
    The manual says:
    Code:
    $this->serverSelect($sid, $virtual);
    http://docs.planetteamspeak.com/ts3/...d35c74ed1e24b7

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [Resolved] Autostart on Centos
    By ministorm in forum Linux / FreeBSD
    Replies: 10
    Last Post: February 20th, 2012, 11:14 AM

Posting Permissions

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