English   German
  #1  
Old 06-01-2003, 19:54
Bigman Bigman is offline
-= TeamSpeak Lover =-
 
Join Date: Aug 2002
Location: Haydock
Posts: 73
Bigman is on a distinguished road
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.
Reply With Quote
  #2  
Old 07-01-2003, 02:45
BLIND's Avatar
BLIND BLIND is offline
-= TeamSpeak Lover =-
 
Join Date: Dec 2002
Location: ATL, GA
Posts: 61
BLIND is on a distinguished road
Cool

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...
Reply With Quote
  #3  
Old 07-01-2003, 09:49
Bigman Bigman is offline
-= TeamSpeak Lover =-
 
Join Date: Aug 2002
Location: Haydock
Posts: 73
Bigman is on a distinguished road
I would like it really just for a standard php page really.

Cheers

Last edited by Bigman; 07-01-2003 at 13:37.
Reply With Quote
  #4  
Old 07-01-2003, 16:45
BLIND's Avatar
BLIND BLIND is offline
-= TeamSpeak Lover =-
 
Join Date: Dec 2002
Location: ATL, GA
Posts: 61
BLIND is on a distinguished road
Cool

I'll see what we can do, but if anyone else wants to try to do this, go for it.
Reply With Quote
  #5  
Old 12-01-2003, 10:13
Brain's Avatar
Brain Brain is offline
-= TeamSpeak Support =-
 
Join Date: Jan 2003
Location: Germany
Posts: 4,145
Brain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond repute
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:

PHP Code:
:
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.
Reply With Quote
  #6  
Old 12-01-2003, 18:03
Addict Addict is offline
-= TeamSpeak User =-
 
Join Date: Jan 2003
Location: Ohio
Posts: 24
Addict is on a distinguished road
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.
Reply With Quote
  #7  
Old 12-01-2003, 23:03
Brain's Avatar
Brain Brain is offline
-= TeamSpeak Support =-
 
Join Date: Jan 2003
Location: Germany
Posts: 4,145
Brain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond repute
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
Reply With Quote
  #8  
Old 12-01-2003, 23:11
Addict Addict is offline
-= TeamSpeak User =-
 
Join Date: Jan 2003
Location: Ohio
Posts: 24
Addict is on a distinguished road
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.
Reply With Quote
  #9  
Old 13-01-2003, 12:17
Brain's Avatar
Brain Brain is offline
-= TeamSpeak Support =-
 
Join Date: Jan 2003
Location: Germany
Posts: 4,145
Brain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond repute
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
Reply With Quote
  #10  
Old 13-01-2003, 13:23
Addict Addict is offline
-= TeamSpeak User =-
 
Join Date: Jan 2003
Location: Ohio
Posts: 24
Addict is on a distinguished road
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.
Reply With Quote
  #11  
Old 14-01-2003, 00:57
Addict Addict is offline
-= TeamSpeak User =-
 
Join Date: Jan 2003
Location: Ohio
Posts: 24
Addict is on a distinguished road
Got it.

For windows it does have to the \r

Thanks....
Reply With Quote
  #12  
Old 14-01-2003, 06:10
direwolf's Avatar
direwolf direwolf is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Oz
Posts: 15
direwolf is on a distinguished road
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
Reply With Quote
  #13  
Old 14-01-2003, 13:45
Addict Addict is offline
-= TeamSpeak User =-
 
Join Date: Jan 2003
Location: Ohio
Posts: 24
Addict is on a distinguished road
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.
Reply With Quote
  #14  
Old 14-01-2003, 14:00
Brain's Avatar
Brain Brain is offline
-= TeamSpeak Support =-
 
Join Date: Jan 2003
Location: Germany
Posts: 4,145
Brain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond repute
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
Reply With Quote
  #15  
Old 14-01-2003, 15:00
Bigman Bigman is offline
-= TeamSpeak Lover =-
 
Join Date: Aug 2002
Location: Haydock
Posts: 73
Bigman is on a distinguished road
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
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 10:52.


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