English   German
  #1  
Old 27-08-2002, 08:27
R. Ludwig R. Ludwig is offline
-= TeamSpeak Team =-
 
Join Date: Jun 2002
Location: Germany
Posts: 1,089
R. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant future
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
Reply With Quote
  #2  
Old 27-08-2002, 20:05
FuZe's Avatar
FuZe FuZe is offline
-= TeamSpeak Addict =-
 
Join Date: Aug 2002
Location: Gig Harbor, WA, USA
Posts: 129
FuZe is on a distinguished road
Send a message via AIM to FuZe Send a message via Yahoo to FuZe
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 05:11.
Reply With Quote
  #3  
Old 29-08-2002, 04:21
ScratchMonkey ScratchMonkey is offline
-= TeamSpeak Addict =-
 
Join Date: Jun 2002
Location: Northern California
Posts: 350
ScratchMonkey is on a distinguished road
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?
Reply With Quote
  #4  
Old 29-08-2002, 10:55
[KRIECH]Agent [KRIECH]Agent is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Germany
Posts: 6
[KRIECH]Agent is on a distinguished road
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>
Reply With Quote
  #5  
Old 29-08-2002, 17:34
Lorphos Lorphos is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Germany
Posts: 8
Lorphos is on a distinguished road
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
Reply With Quote
  #6  
Old 30-08-2002, 12:09
wossName wossName is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Earth
Posts: 20
wossName is on a distinguished road
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...).
Reply With Quote
  #7  
Old 01-09-2002, 02:45
Fox!MURDER
Guest
 
Posts: n/a
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
Reply With Quote
  #8  
Old 03-09-2002, 19:27
sn00x sn00x is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Germany
Posts: 12
sn00x is on a distinguished road
what does the numbers before the ip in the following line mean?
Quote:
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.
Reply With Quote
  #9  
Old 03-09-2002, 20:10
R. Ludwig R. Ludwig is offline
-= TeamSpeak Team =-
 
Join Date: Jun 2002
Location: Germany
Posts: 1,089
R. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant future
Id
Channelid
pktssend
bytessend
pktsrecv
bytesrecv
pktloss
ping
LoginTime
IdleTime
ChannelPrivileges
PlayerPrivileges
PlayerFlags
ipadress
NickName
LoginName
Reply With Quote
  #10  
Old 03-09-2002, 21:08
sn00x sn00x is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Germany
Posts: 12
sn00x is on a distinguished road
thx, and one more question i forgot to ask:
2 3 -1 0 32000 Default
what does this numbers mean?
Reply With Quote
  #11  
Old 03-09-2002, 22:06
sn00x sn00x is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Germany
Posts: 12
sn00x is on a distinguished road
found out by myself now:
id
codec
type (chan or subchan)
order
maxusers

right?
Reply With Quote
  #12  
Old 04-09-2002, 23:25
maletin's Avatar
maletin maletin is offline
-= TeamSpeak Lover =-
 
Join Date: Aug 2002
Location: Germany
Posts: 79
maletin is on a distinguished road
Send a message via ICQ to maletin Send a message via Skype™ to maletin
pktloss is going up and down.
what does this number mean, exactly.
precentage? in the last x seconds?
Reply With Quote
  #13  
Old 09-09-2002, 15:01
maletin's Avatar
maletin maletin is offline
-= TeamSpeak Lover =-
 
Join Date: Aug 2002
Location: Germany
Posts: 79
maletin is on a distinguished road
Send a message via ICQ to maletin Send a message via Skype™ to maletin
Quote:
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?
Reply With Quote
  #14  
Old 27-10-2002, 12:27
Jammet's Avatar
Jammet Jammet is offline
-= TeamSpeak Lover =-
 
Join Date: Sep 2002
Location: Germany
Posts: 85
Jammet is on a distinguished road
Send a message via AIM to Jammet
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
Reply With Quote
  #15  
Old 10-01-2004, 21:53
Togg Togg is offline
-= TeamSpeak User =-
 
Join Date: Jan 2004
Location: NY
Posts: 3
Togg is on a distinguished road
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 21:59.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:18.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Add to Bookmarks   |   Printview   |   Contact Us   |   Legal Notices