Raised This Month: $51 Target: $400
 12% 

Source TV


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
saRsGreenGiant
Junior Member
Join Date: Sep 2005
Old 12-28-2005 , 15:49   Source TV
Reply With Quote #1

Im realy not sure if im in the right place for this question but..

I would like to know if it has been done before,

I want to use a type of server monitering device that reports whether source tv for a server is on or not. This would be on a webpage.

eg.

====================
Clan A Tv is ONLINE!
@123.456.789.10:1112
====================

Thankyou,

Alex
saRsGreenGiant is offline
Send a message via MSN to saRsGreenGiant
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 12-28-2005 , 16:36  
Reply With Quote #2

That would probably be done via a PHP or Perl script.

I myself am not very clued up on the Source TV so im not sure exactly how, but a server plugin is probably not necesary.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
saRsGreenGiant
Junior Member
Join Date: Sep 2005
Old 12-29-2005 , 20:02  
Reply With Quote #3

Quote:
Originally Posted by c0ldfyr3
a server plugin is probably not necesary.
o yes im positive it wouldnt be, but was wondering if anyone had come across a script for it yet.
saRsGreenGiant is offline
Send a message via MSN to saRsGreenGiant
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 12-30-2005 , 16:42  
Reply With Quote #4

I think there's a userid associated with SourceTV and thats 1. Might help.
__________________
ichthys is offline
geezer
Junior Member
Join Date: Feb 2005
Location: Scotland
Old 12-30-2005 , 18:02  
Reply With Quote #5

Code:
<?php
//0skillz testin testin 123 :P
//Location of the live or dead server images make your own whether it be ermm DOD or CSS blah blah

//Please change to your server specifications :P
$live = "http://213.208.119.245/cstrike/images/tv-live.gif";
$dead = "http://213.208.119.245/cstrike/images/tv-dead.gif";

//The status checking script purely fer feckin fun :P
//meddle at your own risk! joo have been warned :P 
//check for port number, default is 27075 change it to your TV of course :P
$link = $_GET['link'].":";
$s_link = str_replace("::", ":", $link);
list($addr,$port)= explode (':',"$s_link");
// chamge your server port below
if (empty($port)){
	$port = 27075;
}
//Test the server connection
$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
             if (!$churl){
			 //echo $errstr;
                header("Location: $dead");
                }
             else {
             	  header("Location: $live");             
		  }
function server($addr){
         if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
         return $addr;
}
?>
save the above as status.php


Code:
<html>
<head>
<title>TV Source Server Status</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<table border="0" cellspacing="0" cellpadding="3">
  <tr> 
    <td width="77%"><font face="Arial, Helvetica, sans-serif" size="2">SourceTV @ 213.208.119.245:27075</font></td>
    <td width="23%">[img]status.php?link=http://213.208.119.245/cstrike/images[/img]</td>
  </tr>
</table>
</body>
</html>
And save this as ermmm wotever HTML server.html you can call it what you want as this will be the page we will link to check the status of your server

Obviously you need to change the website and game server IP to suit your own needs.

Oh and before you ask NO! i havnt tried it but in theory it should work as i based it on the same idea as ICQ online web status.

Just an idea but i guess all your looking to do is check the port is open as if am not mistaken is usually differnt from the actual game slot port so all you wanna do is get it to check if that port is open which means the tv source is up and if closed then its obviously down.
__________________
0sKillz
geezer is offline
saRsGreenGiant
Junior Member
Join Date: Sep 2005
Old 12-31-2005 , 22:35  
Reply With Quote #6

wow thanks for the code, except i cant get it to show on the right side of my page (its an issue with me making custom blocks, cant get the block border to show around it, thus it doesnt show any blocks below it (hence why i put the server status blocks at the bottom of the right hand side). The tv status is actualy below the server status blocks, but because i cant get the border around them, its not showing.

but anyway, i just tested it, and it doesnt appear to change from tv-dead to tv-alive when i turn on source tv

http://www.sars-clan.co.uk/phpnuke/html/si2/tv/tv.php
saRsGreenGiant is offline
Send a message via MSN to saRsGreenGiant
saRsGreenGiant
Junior Member
Join Date: Sep 2005
Old 12-31-2005 , 22:39  
Reply With Quote #7

This is my code

Code:
//Block-tv.php

<?php

if (eregi("block-tv.php",$_SERVER['PHP_SELF'])) 
{
    Header("Location: index.php");
    die();
}

echo "<iframe SRC='http://www.sars-clan.co.uk/phpnuke/html/si2/tv/tv.php' width='230' height='200'
framespacing=0 frameborder=no border=0 scrolling=auto />";

?>
Code:
tv.php

<center><font face="Arial, Helvetica, sans-serif" size="2" color='#FFFFFF'>saRs clan TV @ 84.18.200.38:27023</font>


[img]status.php?link=http://www.sars-clan.co.uk/phpnuke/html/si2/tv/[/img]</center>
Code:
status.php

<?php
//0skillz testin testin 123 :P
//Location of the live or dead server images make your own whether it be ermm DOD or CSS blah blah

//Please change to your server specifications :P
$live = "http://www.sars-clan.co.uk/phpnuke/html/si2/tv/tv-live.gif";
$dead = "http://www.sars-clan.co.uk/phpnuke/html/si2/tv/tv-dead.gif";

//The status checking script purely fer feckin fun :P
//meddle at your own risk! joo have been warned :P
//check for port number, default is 27075 change it to your TV of course :P
$link = $_GET['link'].":";
$s_link = str_replace("::", ":", $link);
list($addr,$port)= explode (':',"$s_link");
// chamge your server port below
if (empty($port)){
   $port = 27023;
}
//Test the server connection
$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
             if (!$churl){
          //echo $errstr;
                header("Location: $dead");
                }
             else {
                  header("Location: $live");             
        }
function server($addr){
         if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
         return $addr;
}
?>
saRsGreenGiant is offline
Send a message via MSN to saRsGreenGiant
saRsGreenGiant
Junior Member
Join Date: Sep 2005
Old 01-03-2006 , 23:08  
Reply With Quote #8

can i just ask, at what point in your code do you state the ip of the server to check???
saRsGreenGiant is offline
Send a message via MSN to saRsGreenGiant
Tim
Senior Member
Join Date: Dec 2004
Location: the Netherlands
Old 01-14-2006 , 19:05  
Reply With Quote #9

In the above post you'll need to enter your server address in this line:
Code:
$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
So somehting like this:
Code:
$churl = @fsockopen(server("10.0.0.127"), "27016", $errno, $errstr, 20);
Or if the server() is causing trouble, use this:
Code:
$churl = @fsockopen("10.0.0.127", "27016", $errno, $errstr, 20);
That should work, if not, post again...
Tim is offline
saRsGreenGiant
Junior Member
Join Date: Sep 2005
Old 01-14-2006 , 21:34  
Reply With Quote #10

thankyou for reply.

currently now the image showing is Tv-alive (tv on) all the time, wether tv is on or off

$churl = @fsockopen(server("84.18.200.38"), "27019", $errno, $errstr, 20);

^^ is my code im using

other key lines in status.php:

//Please change to your server specifications
$live = "http://www.sars-clan.co.uk/phpnuke/html/si2/tv/tv-alive.gif";
$dead = "http://www.sars-clan.co.uk/phpnuke/html/si2/tv/tv-dead.gif";

if (empty($port)){
$port = 27023;

key line in tv.php (the page for displaying the image)

[img]status.php?link=http://www.sars-clan.co.uk/phpnuke/html/si2/tv/[/img]</center>
saRsGreenGiant is offline
Send a message via MSN to saRsGreenGiant
Reply



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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode