Rune Central

The Official Rune Quake Message Board
It is currently Sun Dec 22, 2024 1:24 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Server List Code
PostPosted: Wed Mar 19, 2003 9:09 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 5:43 pm
Posts: 239
Location: North Carolina
How do you get info like the level and player names on your server list page on the web site? I want to try this.
http://www.runequake.com/servers/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 19, 2003 10:44 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1258
Location: New Jersey, USA
I use qstat to query the servers. You can find it here,

http://www.qstat.org/

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 3:19 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 5:43 pm
Posts: 239
Location: North Carolina
Could you go into great detail of how to do it exactly? I've read alot about it and have yet to figure out which gmake to use and how to install it.

And that's only one part of it... can you offer more assistance?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 4:32 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1258
Location: New Jersey, USA
If you're on a windows system, there is a precompiled binary for you. To compile the binary in Linux, use GNU make. [Typing 'make' in the qstat25c folder should work]

For the servers page, I pipe the output of qstat to Perl. I use Perl to parse the output and generate the page. All of the Rune Quake pages are generated using Perl. For more information visit,

http://www.perl.com
http://www.perldoc.com

You might want to do a search for some public scripts that might better illustrate how this is all done. I believe there are a couple mentioned in this thread,

http://forums.runecentral.com/viewtopic.php?t=12

Hope this helps,

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 5:31 pm 
Offline
User avatar

Joined: Mon Mar 10, 2003 12:41 pm
Posts: 116
For your Postnuke site I suggest getting the "serverBrowser" module from http://www.thethird.net. It uses qstat and a perl wrapper.

You will have to find someone to compile qstat for you, or you can try the one I already compiled for linux, linked in the thread mentioned in Slots last post (above). Read the docs (serverbrowser) carefully as there are instructions specific to your webhost.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 6:12 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 5:43 pm
Posts: 239
Location: North Carolina
Ok I've got it to execute using Putty on the web site, and I've set the proper chmod on all the files, even the folder, I'm using some PHP3 code I found and it uses this line:

exec("/var/www/html/unix/qstat quake.widomaker.com", $result);

And so far it doesn't seem to work at all and I don't know how to tell if it's actually executing the program (and I did set it to the correct path because I actually pasted that line into Putty and it worked fine.)

Any ideas?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 9:40 pm 
Offline
User avatar

Joined: Mon Mar 10, 2003 12:41 pm
Posts: 116
try the boards at your webhost. did you read the directions pertaining to your host on the module i talked about? That might help


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 10:05 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 5:43 pm
Posts: 239
Location: North Carolina
Trying that now


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 20, 2003 11:27 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 5:43 pm
Posts: 239
Location: North Carolina
Nope, didn't work. Could you just tell me everything you did, Slot? Or maybe upload your compiled qstat? I'm using Chuck's, it seems to work, but who knows? And I still can't seem to find a way to compile jack.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 21, 2003 12:08 am 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1258
Location: New Jersey, USA
You can test the binary in a shell (PuTTY) by typing,

./qstat quake.shmack.net

in the same directory that houses qstat. If you get a Permission Denied message, type

chmod 755 qstat

If you see results, qstat is working. If not, let me know and I'll e-mail the one I compiled. The next thing you have to do is find a language you feel comfortable working with (i.e. Java, Perl, PHP).

In your PHP example, it looks as though the output is being forced to a scalar (string) instead of an array, this will only capture the last line of the output. While PHP is very similar to Perl, I'm not sure of the exact syntax of arrays in PHP. For PHP documentation check out,

http://www.php.net/docs.php

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 24, 2003 1:18 pm 
Offline
User avatar

Joined: Mon Mar 10, 2003 12:41 pm
Posts: 116
I keep getting this error. Any help?

Premature end of script headers: /home/virtual/site45/fst/var/www/cgi-bin/qstat.pl


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 24, 2003 5:13 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1258
Location: New Jersey, USA
It's useful to know what OS, web server, and what the actual script looks like, but some common things to check include;

Making sure the script was uploaded properly in ASCII mode.

Making sure the correct permissions are set. In some instances, this means dropping the write permission for group (try 744 or 700 instead of 755)

Making sure the script has the correct path to Perl.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 24, 2003 6:07 pm 
Offline
User avatar

Joined: Mon Mar 10, 2003 12:41 pm
Posts: 116
Thanks, I checked the path to perl already but will double-check the others now.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 24, 2003 6:13 pm 
Offline
User avatar

Joined: Mon Mar 10, 2003 12:41 pm
Posts: 116
BINGO!

I chmoded to 740 and it worked great. Thank you!!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 01, 2003 8:59 pm 
Offline
User avatar

Joined: Mon Mar 10, 2003 12:41 pm
Posts: 116
Nice Hover effect on your server list! I like that.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group