Community Forums Today's Posts     Member List     Archive    
Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: TCP Query Port

  1. #1
    Join Date
    Jun 2002
    Location
    Krün / Germany
    Posts
    1,965

    TCP Query Port

    Hi,

    maybe many of you asked yourself already whats up with this ini setting. You can connect to this port using normal telnet. after
    you connected u are able to use the commands shown below.

    thats more for the linux guys because webinterface really has a big problem there.

    this queryport is just at the beginning of development. but
    the basic commands works great.

    we are allready developing an php based system for this.
    so you can save your time :P


    TeamSpeak TCPQuery Commands:
    ----------------------------

    there are two types of replys, ok and error. all end with an CR-LF

    ok reply:
    OK

    error reply:
    ERROR, error message


    COMMANDS:
    ---------
    ver
    - prints server version

    sl
    - prints server list

    sel serverport
    - selects the server

    pl [serverport]
    - prints current connected clients

    cl [serverport]
    - prints current channel list

    si [serverport]
    - prints serverinfo

    login username userpassword
    - logs u into the server
    ! currently only superserveradmins can login

    COMMANDS YOU HAVE TO BE LOGGED IN:
    --------------------------------
    addserver serverconfigname serverport
    - adds a new server
    - this server is selected after successfully create (no need for sel command)

    stop [serverport]
    - stops the server

    start [serverport] <- dont works currently, so better dont stop :P
    - starts the server

    restart [serverport]
    - restarts the server

    msg [serverport] text
    - sends a text message to selected server

    msg all
    - sends a text message to all servers

    COMMANDS YOU HAVE TO BE LOGGED IN AND SELECTED AN SERVER:
    ------------------------------------------------------------
    adduser username userpassword serveradmin superserveradmin
    - adds a user to the server
    - serveradmin = 0 or 1 (can only control THIS server)
    - superserveradmin = 0 or 1 (that user can controll all servers)

    deluser username
    - deletes the user

    set variable value
    - possible variable names
    servername
    serverpassword set #CLEAR# to delete pw
    serverwelcomemsg
    maxuser

  2. #2
    Join Date
    Aug 2002
    Location
    Gig Harbor, WA, USA
    Posts
    129
    I'm running my server from a Windows2000 platform. I cant seem to telnet to that port, even if its local.

    EDIT: all my fault, i was putting in the wrong port. works
    Last edited by FuZe; 03-09-2002 at 04:11.

  3. #3
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    351
    Not mentioned above is the "quit" command to get a clean disconnect from the server. That eliminates the need for some timeouts on the port.

    Is there a problem with "sl"? I'm trying to query my clan server at Holdouts, teamspeak.matureasskickers.net. "sl" reports only the 8767 default serverport, not mine at 8772. "pl 8772" complains "serverport not found". Do I need to request a line in the INI to get my server to show in the list?

  4. #4
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    6
    I wrote this little script to test Queries using PHP.

    Problem is, that I experienced the very same ugly runtime errors as when using the webinterface.

    Right after the first access, the telnet-server (or whatever this is) crashes. It does not affect the TS voicechat-server.

    I'm posting my script so other people may test it:
    (replace xxx.xxx.xxx.xxx with your server's IP)

    Code:
    <?    
      if ($ip && $port && $cmd)
      {
        $cmd = "\xFF\xFF\xFF\xFF".$cmd."\x00";      
    
        $ltime=time();
        $connection = fsockopen ($type.$ip, $port, &$errno, &$errstr, 1);
        if (!$connection)
        {
          echo "Cannot connect: ($errno)-$errstr<br>";
        }
        else
        {
          echo "Connection established.<br>";
    
          socket_set_blocking($connection,true);
          socket_set_timeout($connection,0,100000);
          fwrite($connection,$cmd,strlen($cmd));  
          echo "Request sent.<br>";
          // Mark
          $starttime=mktime();
          do {
            $serverdata.=fgetc($connection);
            echo "Reply ftched ".(++$i)." times.<br>";
            $serverdatalen++;
            $socketstatus=socket_get_status($connection);
            if ($starttime>($starttime+$waittime)) {
              echo "Connection timed out";
              fclose($connection);
              return "";
            }
          } while ($socketstatus["unread_bytes"] );
          fclose($connection);
          echo "Reply complete; connection terminated.<br>";
          
          echo "Result: <br><br>".$serverdata."<br>";
        }
      }
      if (!$ip)  $ip    = "xxx.xxx.xxx.xxx";
      if (!$port)  $port = "8767";
    ?>
    </div>
    <br>
    
    <table border="0">
    <form method="POST">
      <tr>
        <td valign="top" class="mtext">ip:</td>
        <td><input type="text" name="ip"   size="15" maxlength="15" value="<? echo $ip; ?>"></td>
      </tr>
      <tr>
        <td valign="top" class="mtext">port:</td>
        <td><input type="text" name="port" size="5" maxlength="5" value="<? echo $port; ?>"></td>
      </tr>
      <tr>
        <td valign="top" class="mtext">command:</td>
        <td>
          <select name="cmd">
            <option>sl 8767</option>
            <option>cl 8767</option>
            <option>pl 8767</option>
          </select>
        </td>
      </tr>
      <tr>
        <td valign="top" class="mtext">conntype:</td>
        <td>
          <select name="type">
            <option value="udp://" selected>udp</option>
            <option value=""               >tcp</option>
          </select>
        </td>
      </tr>
    </table>
    <tr>
    <br>
    
    <input type="submit" value="Query!">
    </form>

  5. #5
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    8

    can't set server_welcomemessage

    I tried to set "server_welcomemessage" but it had no effect (checked afterwards with "si").

    I tried:
    set server_welcomemessage = hi
    set server_welcomemessage hi

    Did anyone get it to work?

    Oh, and I also hat the tcp server thing crash/hang after typing some illegal commands (i could still connect but didn't get the [TS] prompt).

    Using Linux server 2.0.17.17

  6. #6
    Join Date
    Aug 2002
    Location
    Earth
    Posts
    20
    Well it says "serverwelcomemsg" in R. Ludwig's posting, but I think I changed the value manually anyway. It's in the server.ini (do it while the server is not running...).

  7. #7
    Fox!MURDER Guest

    Patched version of Agent's TCPQuery

    This should work fine now.
    PHP Code:
    <?
      
    if ($ip && $port && $cmd)
      {
      if(!
    $server$server='8767';
    #    $cmd = "\xFF\xFF\xFF\xFF".$cmd."\x00";
        
    $cmd="sel $server\n".$cmd;
        if(
    $cmdparam$cmd.=' '.$cmdparam;
        
    $cmd.="\n";
        
    $cmd.="quit\n";
        
    $connection fsockopen ($type.$ip$port, &$errno, &$errstr1);
        if (!
    $connection)
        {
          echo 
    "Cannot connect: ($errno)-$errstr<br>";
        }
        else
        {
          echo 
    "Connection established.<br><TABLE CELLPADDING=22 CELLSPACING=0><TR><TD BGCOLOR=#AAAAAA><TABLE><TR><TD COLSPAN=2><FONT COLOR=WHITE><H1>SERVER</H1></FONT></TR><TR><TD><H2>IP:</H2></TD><TD><H2>$ip</H2></TR><TR><TD><H2>Port:</H2></TD><TD><H2>$port</H2></TD></TR></TABLE></TD><TD><TABLE CELLPADDING=0 CELLSPACING=0>";
          
    fputs($connection,$cmd,strlen($cmd));
            echo 
    "<TR><TD BGCOLOR=DARKRED><FONT SIZE=+5 FACE=courier ALIGN=CENTER COLOR=WHITE>&lt;=</FONT></TD><TD>".nl2br($cmd)."</TD></TR>";
            
    $x=0;
              while(
    $serverdata fgets($connection4096)) echo '<TR><TD ALIGN=CENTER BGCOLOR=DARKBLUE><FONT SIZE=+3 FACE=courier COLOR=WHITE>=&gt;</FONT></TD><TD>'.nl2br($serverdata).'</TD></TR>';
              
    fclose($connection);
          echo 
    "</TD></TR></TABLE></TABLE>Done.<br>";

        }
      }
      if (!
    $ip)  $ip    "127.0.0.1";
      if (!
    $port)  $port "8767";

    ?>
    </div>
    <br>

    <table border="0">
    <form method="POST">
      <tr>
        <td valign="top" class="mtext">ip:</td>
        <td><input type="text" name="ip"   size="15" maxlength="15" value="<? echo $ip?>"></td>
      </tr>
      <tr>
        <td valign="top" class="mtext">port:</td>
        <td><input type="text" name="port" size="5" maxlength="5" value="<? echo $port?>"></td>
      </tr>
      <tr>
        <td valign="top" class="mtext">command:</td>
        <td>
          <select name="cmd">
            <option>ver</option>
            <option>si</option>
            <option>si</option>
            <option>cl</option>
            <option>pl</option>
            <option>sl</option>
            <option value="">Other(use command parameter field)</option>
          </select>
        </td>
      </tr>
      <tr>
        <td valign="top" class="mtext">Command parameter:</td>
        <td>
          <TEXTAREA name="cmdparam" COLS=80 ROWS=25> <?echo $cmdparam;?></TEXTAREA>
        </td>
      </tr>
     <tr>
        <td valign="top" class="mtext">server:</td>
        <td>
          <input type="text" value="<?echo $server;?>" name="server">
        </td>
      </tr>

      <tr>
        <td valign="top" class="mtext">conntype:</td>
        <td>
          <select name="type">
    <!--        <option value="udp://" <?//if($type=="udp://") echo 'selected';?>>udp</option>-->
            <option value=""       <?if($type!="udp://") echo 'selected';?>>tcp</option>
          </select>
        </td>
      </tr>
    </table>
    <tr>
    <br>

    <input type="submit" value="Query!">
    </form>
    <h6>Written with vim-6.1</h6>
    Try it and let me know if there would be any bugs. If i would have a time ill make it a bit better.

    Fox

  8. #8
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    12
    what does the numbers before the ip in the following line mean?
    1 2 11 2588 8 328 1111 55 8 8 0 4 0 0.0.0.0 sn00x q
    ..grepped from tcpqueryport after sending pl.

  9. #9
    Join Date
    Jun 2002
    Location
    Krün / Germany
    Posts
    1,965
    Id
    Channelid
    pktssend
    bytessend
    pktsrecv
    bytesrecv
    pktloss
    ping
    LoginTime
    IdleTime
    ChannelPrivileges
    PlayerPrivileges
    PlayerFlags
    ipadress
    NickName
    LoginName

  10. #10
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    12
    thx, and one more question i forgot to ask:
    2 3 -1 0 32000 Default
    what does this numbers mean?

  11. #11
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    12
    found out by myself now:
    id
    codec
    type (chan or subchan)
    order
    maxusers

    right?

  12. #12
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    79
    pktloss is going up and down.
    what does this number mean, exactly.
    precentage? in the last x seconds?

  13. #13
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    79
    Originally posted by sn00x
    found out by myself now:
    id
    codec
    type (chan or subchan)
    order
    maxusers

    right?
    i renamed type to parent.
    if the value is -1 it is a main channel.
    if it is greater, it's the id of the parentchannel.
    order is local to the subchannel.
    now i can print the same order, as seen on the client side.

    but how can i change this order?

  14. #14
    Join Date
    Sep 2002
    Location
    Germany
    Posts
    86
    How about making portnumber arguments optional if there is ony one (default) used? Perhaps an help command would be a good thing as well.

    Perhaps you could provide a setting wether the user wants it to be more machine readable or more nicely formatted.

    But I'll probably not telnet from anywhere to it other than localhost, and when there is a need to remote administer the server, I'll probably use SSH and then telnet to the localhost teamspeak server.

    Commands to create Channels, Edit channels, kick specific users, etc would probably be useful as well.

    I'm also for some kind of input prompt such as the server port that we are currently using:

    8767> pl
    CONNECTION LIST
    8767> help
    HELP
    8767> set query_output 2
    0 - NONE / 1 - INTERPRETER / 2 - USER
    8767> quit

  15. #15
    Join Date
    Jan 2004
    Location
    NY
    Posts
    3
    any way to get the ip's of the people on a ts server (and kick/ban them) through this protocol? i'm working on a "clan management" package so that if someone is banned from a gameserver, they're also banned from that clan's ts server, web page, etc.

    Oh, and any plans to allow plain old serveradmins to login?

    Thanks,
    Todd
    Last edited by Togg; 10-01-2004 at 20:59.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Plsss I have a Problem :S
    By DrakeL in forum [TeamSpeak 2] Server Support
    Replies: 8
    Last Post: 01-11-2009, 03:06
  2. Need help configuring TS Server with windows 7 + router
    By obarthelemy in forum [TeamSpeak 2] Server Support
    Replies: 3
    Last Post: 18-08-2009, 04:19
  3. Login problems
    By Delyv in forum [TeamSpeak 2] Server Support
    Replies: 14
    Last Post: 05-04-2009, 13:59
  4. TCP query port
    By -Pasi in forum [TeamSpeak 2] Server Support
    Replies: 2
    Last Post: 19-09-2007, 20:16
  5. Mandrake 9.1 connection error
    By Hearie in forum [TeamSpeak 2] Server Support
    Replies: 10
    Last Post: 09-08-2003, 20:10

Posting Permissions

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