| Mirage Source http://miragesource.net/forums/ |
|
| Server Online http://miragesource.net/forums/viewtopic.php?f=201&t=4730 |
Page 1 of 2 |
| Author: | William [ Wed Nov 12, 2008 8:43 pm ] |
| Post subject: | Server Online |
Do anybody have that small html code that checked if a server was online by inputting the IP and PORT? I remember Elysium having it. |
|
| Author: | GIAKEN [ Wed Nov 12, 2008 9:23 pm ] |
| Post subject: | Re: Server Online |
Raygoe wrote: Here's the source
url.php (the image) Code: <?php $ip = $_GET['ip']; $port = $_GET['port']; $offline_PIC = $_GET['offI']; $online_PIC = $_GET['onI']; $fp = @fsockopen($ip, $port, &$errno, &$errstr, 30); if (!$fp) { $usedPic = $offline_PIC; // die($errstr); } else { $usedPic = $online_PIC; fclose($fp); } if (!$imageType=@getimagesize($usedPic)) { $imageType[2] == 4; } if ($imageType[2] == 1) { //GIF header("Content-Type: image/gif"); $img = imagecreatefromgif ($usedPic); imagegif ($img); } else if ($imageType[2] == 2) { //JPG header("Content-Type: image/jpeg"); $img = imagecreatefromjpeg($usedPic); imagejpeg($img); } else if ($imageType[2] == 3) { //PNG header("Content-Type: image/png"); $img = imagecreatefrompng($usedPic); imagepng($img); } else { header("Content-Type: image/gif"); $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); imagestring($im, 1, 5, 5, "Error!", $tc); imagegif ($im); } ?> The .HTACCESS Mod Rewrite file: Quote: RewriteEngine On RewriteRule ^online_(.*)_(.*)_(.*)_(.*)_.jpg?$ url.php?ip=$1&port=$2&offI=$3&onI=$4 [L] (Change the bold to whatever file name you used. Make sure the .htaccess file is in the same directory as this one) Requirements: 1. PHP 2. GD Library 3. FSocket Protocol External Connections Enabled 4. Ability to load external images in GD. The hardest to come by is #3 as it is commonly shut off. Also note for the HTACCESS Forum Version your Online and Offline Images must not contain an underscore as it would be bad... (If it does you can just change the htaccess underscores between the "(.*)"s to something like ampersands or something... |
|
| Author: | William [ Wed Nov 12, 2008 10:01 pm ] |
| Post subject: | Re: Server Online |
Hmm, my website doesn't allow php. Guess I need to contact cruzn. |
|
| Author: | Anthony [ Wed Nov 12, 2008 11:28 pm ] |
| Post subject: | Re: Server Online |
http://geocities.com/anthonyfleck/serverstatus.zip I think that's it? I have had that on that web server since I was like 14... Haha. |
|
| Author: | GIAKEN [ Thu Nov 13, 2008 2:31 am ] |
| Post subject: | Re: Server Online |
We've got this set up on OGCore. <img src="http://www.onlinegamecore.com/server.php?ip=change me&port=change me&offI=change me&onI=change me" alt=""> |
|
| Author: | William [ Thu Nov 13, 2008 12:07 pm ] |
| Post subject: | Re: Server Online |
Anthony wrote: http://geocities.com/anthonyfleck/serverstatus.zip I think that's it? I have had that on that web server since I was like 14... Haha. Thats a great thing you got there. But Im not looking for anything complex really. Just something basic to see if the server is online. And I wanted it in html because my k2h website doesn't allow anything else for some reason. |
|
| Author: | Nean [ Thu Nov 13, 2008 6:02 pm ] |
| Post subject: | Re: Server Online |
William wrote: Anthony wrote: http://geocities.com/anthonyfleck/serverstatus.zip I think that's it? I have had that on that web server since I was like 14... Haha. Thats a great thing you got there. But Im not looking for anything complex really. Just something basic to see if the server is online. And I wanted it in html because my k2h website doesn't allow anything else for some reason. Err. I don't think HTML would do that buddy. HTML is a browser language, the barest form of a website. So pretty much the building block of a website. PHP is a dynamic language to add more features and all that shit for websites.... Yeah, I'm almost positive HTML cannot do that, though I could be wrong. I could be very wrong. |
|
| Author: | William [ Thu Nov 13, 2008 6:18 pm ] |
| Post subject: | Re: Server Online |
Yeah I guess. Cruzn made me this before: ![]() I guess I'll try and contact him if he can change the IP for it. |
|
| Author: | Rian [ Thu Nov 13, 2008 6:21 pm ] |
| Post subject: | Re: Server Online |
have your server generate a html file and then upload it before it shuts down, and after it starts up via ftp. |
|
| Author: | William [ Thu Nov 13, 2008 7:16 pm ] |
| Post subject: | Re: Server Online |
Sonire wrote: have your server generate a html file and then upload it before it shuts down, and after it starts up via ftp. Then I rather use Anthonys idea, I dont want a external window for it. I want it added into a page on my website, like this: http://www.key2heaven.net/page.php?id=32 I'll just talk to cruzn. But thanks guys. |
|
| Author: | GIAKEN [ Thu Nov 13, 2008 9:15 pm ] |
| Post subject: | Re: Server Online |
GIAKEN wrote: We've got this set up on OGCore. <img src="http://www.onlinegamecore.com/server.php?ip=change me&port=change me&offI=change me&onI=change me" alt=""> Will that not work? |
|
| Author: | William [ Thu Nov 13, 2008 9:19 pm ] |
| Post subject: | Re: Server Online |
I cant get it working. |
|
| Author: | GIAKEN [ Thu Nov 13, 2008 9:46 pm ] |
| Post subject: | Re: Server Online |
Here's an example of mine: <img src="http://www.onlinegamecore.com/server.php?ip=68.10.124.161&port=7000&offI=http://www.geonet.auburnflame.com/elmysia/image/offline.png&onI=http://www.geonet.auburnflame.com/elmysia/image/online.png" alt=""> |
|
| Author: | William [ Fri Nov 14, 2008 12:54 pm ] |
| Post subject: | Re: Server Online |
That code takes forever to run. Does it run quickly for you? |
|
| Author: | GIAKEN [ Fri Nov 14, 2008 3:41 pm ] |
| Post subject: | Re: Server Online |
Yeah if it's online it does it pretty fast, but I have noticed it's kinda slow offline...and that's because of the timeout being set to 30 seconds (which I just noticed |
|
| Author: | William [ Fri Nov 14, 2008 4:12 pm ] |
| Post subject: | Re: Server Online |
Can you change that? |
|
| Author: | GIAKEN [ Fri Nov 14, 2008 4:21 pm ] |
| Post subject: | Re: Server Online |
Yeah I'll tell somebody to fix it. |
|
| Author: | William [ Fri Nov 14, 2008 4:28 pm ] |
| Post subject: | Re: Server Online |
Okay, great. |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|