|
|
|

06-01-2003, 19:54
|
|
-= TeamSpeak Lover =-
|
|
Join Date: Aug 2002
Location: Haydock
Posts: 73
|
|
|
Online Display Script
Is there any way of creating a small script that works similar to ICQ, i.e when the page or script is activated it checks to see if the ts server is online if it is it displays a small online image (green light) if not then displays a red light, or something similar.
Any help appreciated.
|

07-01-2003, 02:45
|
 |
-= TeamSpeak Lover =-
|
|
Join Date: Dec 2002
Location: ATL, GA
Posts: 61
|
|
I'm sure this can be done with some php script, but what are you trying to use this on? a website I'm guessing? It would be fairly simple script, and I could get our scripter to write one, but right now I'm giving him the job of getting the info of who is online instead of it the server is online, or I might ask another site that I saw that on if I could borrow thiers...blah...blah...blah...
|

07-01-2003, 09:49
|
|
-= TeamSpeak Lover =-
|
|
Join Date: Aug 2002
Location: Haydock
Posts: 73
|
|
|
I would like it really just for a standard php page really.
Cheers
Last edited by Bigman; 07-01-2003 at 13:37.
|

07-01-2003, 16:45
|
 |
-= TeamSpeak Lover =-
|
|
Join Date: Dec 2002
Location: ATL, GA
Posts: 61
|
|
I'll see what we can do, but if anyone else wants to try to do this, go for it.
|

12-01-2003, 10:13
|
 |
-= TeamSpeak Support =-
|
|
Join Date: Jan 2003
Location: Germany
Posts: 4,145
|
|
i have something for you. it's primitive, but works.
you might need to change some values for your own server, but it should be a good start:
did you notice the biiiig fscanf call? i figured out the first number is the player id and the last string is the player name.
if you figure out the meanings of the other values i'd be happy if you would share that information.
Last edited by Brain; 19-07-2004 at 14:53.
|

12-01-2003, 18:03
|
|
-= TeamSpeak User =-
|
|
Join Date: Jan 2003
Location: Ohio
Posts: 24
|
|
|
Nice work on the script. However, it times out for me. I'll keep playing around and see what's up with it.
Last edited by Addict; 12-01-2003 at 18:12.
|

12-01-2003, 23:03
|
 |
-= TeamSpeak Support =-
|
|
Join Date: Jan 2003
Location: Germany
Posts: 4,145
|
|
1.) the script uses default ports so make sure port 51234 tcp is accessible
2.) the script assumes the teamspeak server is running on the same maching as the webserver. change "localhost" to your teamspeak server's address if necessary
3.) i'm running apache 1.3.27 with php 4.3.0, tss2 and apache run on the same physical machine. the script works for me. see for yourself, i have integrated it into my clan's message board -> http://www.the-rip.de/wbboard
__________________
1f y0u c4n r34d 7h15 y0u r3411y n33d 70 g37 l41d
|

12-01-2003, 23:11
|
|
-= TeamSpeak User =-
|
|
Join Date: Jan 2003
Location: Ohio
Posts: 24
|
|
|
Yeah i got the timeout fixed.
It errors out on the first sendQuery. Almost like its not finding the right response. I'll keep digging though.
I'm running it on the same server as TS & web. I'm running Win2k Server with IIS. PHP 4.3.0.
Last edited by Addict; 13-01-2003 at 01:36.
|

13-01-2003, 12:17
|
 |
-= TeamSpeak Support =-
|
|
Join Date: Jan 2003
Location: Germany
Posts: 4,145
|
|
PHP Code:
if(getResults($socket) != "OK\n") {
i assume it is this line that causes the timeout. hmmm... windoze you say.... maybe it's another case of line break problems
try OK\r\n instead of OK\n, maybe it helps
or you can just telnet to localhost:51234 and test it yourself
__________________
1f y0u c4n r34d 7h15 y0u r3411y n33d 70 g37 l41d
|

13-01-2003, 13:23
|
|
-= TeamSpeak User =-
|
|
Join Date: Jan 2003
Location: Ohio
Posts: 24
|
|
Quote:
Originally posted by Brain
PHP Code:
if(getResults($socket) != "OK\n") {
i assume it is this line that causes the timeout. hmmm... windoze you say.... maybe it's another case of line break problems
try OK\r\n instead of OK\n, maybe it helps
or you can just telnet to localhost:51234 and test it yourself
|
No it wasn't that line timing out. It was the initial connection. Got that fixed.
I'll try the OK\r\n and see if that works. Thanks.
|

14-01-2003, 00:57
|
|
-= TeamSpeak User =-
|
|
Join Date: Jan 2003
Location: Ohio
Posts: 24
|
|
|
Got it.
For windows it does have to the \r
Thanks....
|

14-01-2003, 06:10
|
 |
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: Oz
Posts: 15
|
|
I get this error on Linux with php 4.2.2
Quote:
|
Internal server error! Cause unknown.
|
PHP Code:
// select the one and only running server on port 8767
sendQuery($socket, "sel 8767");
if(getResults($socket) != "OK\n") {
echo("Internal server error! Cause unknown.");
exit;
}// end if
Dont know why
|

14-01-2003, 13:45
|
|
-= TeamSpeak User =-
|
|
Join Date: Jan 2003
Location: Ohio
Posts: 24
|
|
Quote:
Originally posted by direwolf
I get this error on Linux with php 4.2.2
Dont know why
|
Did you try adding the \r? Immediately after the OK.
PHP Code:
// select the one and only running server on port 8767
sendQuery($socket, "sel 8767");
if(getResults($socket) != "OK\r\n") {
echo("Internal server error! Cause unknown.");
exit;
}// end if
That's just a generic error as this script has no error handling. Also you may want to switch to PHP 4.3.0.
|

14-01-2003, 14:00
|
 |
-= TeamSpeak Support =-
|
|
Join Date: Jan 2003
Location: Germany
Posts: 4,145
|
|
php before 4.3.0 needs two parameters in the fgets function. -> http://www.php.net/manual/en/function.fgets.php
i'm using php 4.3.0 on a linux webserver with linux tss2. ymmv.
__________________
1f y0u c4n r34d 7h15 y0u r3411y n33d 70 g37 l41d
|

14-01-2003, 15:00
|
|
-= TeamSpeak Lover =-
|
|
Join Date: Aug 2002
Location: Haydock
Posts: 73
|
|
Can someone visit this page and see why im getting this error Cheers
http://bigmanrlfans.dyndns.org/listing.php
Im using IIS and PHP 4.3.0
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 10:52.
Powered by vBulletin® Version 3.7.3 Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
|
|
|
|
Add to Bookmarks
|
Printview
|
Contact Us
|
Legal Notices
|