Mabinogi World Wiki is brought to you by Coty C., 808idiotz, our other patrons, and contributors like you!!
Keep this wiki going by contributing to our Patreon!

PHP Server Statuses?

PHP Server Statuses?

Was wondering if we could automate server statuses a little. A small javascript/php ping could easily find out if a server is online or not. A simple "override" could be provided in the rare event the script was wrong or to clarify details. Let me know, I'll do some research.

Xcelled19416:26, 7 June 2011

I'm pretty sure Nexon has blocked pinging their servers since like.. last year.

κєνıи тαıĸ«)16:35, 7 June 2011
 

Yeah, theres some issues. Looks like this won't be any time soon in coming....

Xcelled19418:47, 7 June 2011
 

You don't need to ping the server. Just try and connect to their server and port with a simple TCP connection and if it works, it's online. Otherwise, it's not ~小太郎 TALKCONTRIBS 2011:06:08:06:43 (Wednesday)

~小太郎 TALK<sub style="margin-left:-26px 22:43, 7 June 2011
 

Was thinking of that, obviously. Unfortunately, we'd have to jump through hoops to get javascript/PHP on the wiki

Xcelled19407:58, 8 June 2011
 

Some additional problems that would have to be resolved using this would be:

  • Determining whether if the server is down due to maintenance/update or is actually crashed.
  • As far as I can tell, this only uses one of the channel's status to determine all. If a channel other than the first is down, it will still be shown as online/event tag.
  • Short timeouts could lead to inaccurate results, especially during times with a lot of server traffic.
  • MOAAAAAR.
κєνıи тαıĸ«)18:59, 8 June 2011
 

@As far as I can tell, this only uses one of the channel's status to determine all. If a channel other than the first is down, it will still be shown as online/event tag.
It can scan every channel IP and/or port to check each individual channel's status ~小太郎 TALKCONTRIBS 2011:06:09:12:13 (Thursday)

~小太郎 TALK<sub style="margin-left:-26px 04:13, 9 June 2011

It does, I'll post the source code soon.

Xcelled19414:41, 10 June 2011
 

You see, it's impossible with javascript because js doesn't allow raw TCP connections. You will have to use PHP or something else. Maybe I can set up a script on serverstatus.mabimods.net and make a iframe on the wiki point to it ~小太郎 TALKCONTRIBS 2011:06:11:01:39 (Saturday)

~小太郎 TALK<sub style="margin-left:-26px 17:39, 10 June 2011

Even worse... iframe.

κєνıи тαıĸ«)19:07, 10 June 2011
 

Invalid xhtml :(
Maybe AJAX would be a better choice? ~小太郎 TALKCONTRIBS 2011:06:12:06:41 (Sunday)

~小太郎 TALK<sub style="margin-left:-26px 22:41, 11 June 2011
 

Yeah, I made a PHP script. ATM its hosted on my personal server, http://www.ketelaar.com/MabiServers.php When I put the finishing touches on it, I'll release the sourcecode. For now, the script is working on my personal server. BTW, anyone know who the server admin is? We should bring him/her in on this....

Xcelled19409:44, 11 June 2011
 

:c Who doesn't know who IJ is?

κєνıи тαıĸ«)15:58, 11 June 2011
 

OK, everyone CHECK IT DURING THE MAINT!!!!

Xcelled19414:40, 10 June 2011
 

It's so... Ugly :(
Mind if I help make it look better, with tables and such? ~小太郎 TALKCONTRIBS 2011:06:12:06:42 (Sunday)

~小太郎 TALK<sub style="margin-left:-26px 22:42, 11 June 2011
 

The idea is that it would fill in the content for http://wiki.mabinogiworld.com/index.php?title=Wiki_Home/Server_Status&action=edit thus breaking the existing style as little as possible. :)

But that's where we need IJ's experience.

Xcelled19409:29, 12 June 2011
 

I defer the scripting matters to you people. I do not script in PHP; I'm a Perl guy myself. I just integrate stuff and (try to) make sure it won't break the box's security as PHP has a frequent propensity to do.

Irjustman09:49, 12 June 2011

There was a PHP extension that I found for the wiki earlier that restricted use to and only executes if the last editor was one who has the rights. I can't find it anymore :c

κєνıи тαıĸ«)11:02, 12 June 2011
 

Ooh. I found it. :D

κєνıи тαıĸ«)11:14, 12 June 2011
 

Yeah, I've written (and am finishing) the script. I need IJ's help to integrate it though.

Xcelled19411:35, 12 June 2011
 

Also, Ij, this is a question for you. Where is the actual content stored? For example, the ServerStatus page, where is the Index pulling: {{:Wiki Home/Server Status/Template |Mabinogi=event |Nexon=online |Login=online |Alexina=event |AlexinaHCH=online

from? Cause if possible, I'd replace that stuff completely with the configuration section for my script, and just require() it.

The reason for that is PHP could really open up the server to attack IF we let joe blow see the source code. By separating the configuration from the workhorse, we can prevent that.

Xcelled19412:02, 12 June 2011

I don't think IJ plans to implement this.

κєνıи тαıĸ«)15:57, 12 June 2011
 

Just... write it so it's in a table, fancy if possible, and we will integrate the whole thing in to the wiki without much problems with AJAX/iframes and whatnot ~小太郎 TALKCONTRIBS 2011:06:12:23:25 (Sunday)

~小太郎 TALK<sub style="margin-left:-26px 15:25, 12 June 2011
 

But that's a problem. People need to access the script's configuration to set things like events. So we need to have some wiki functionality.

Xcelled19418:16, 12 June 2011
 

AJAX still solves the problem. Request serverstatus.php?event=true and it shall return a table with "event" instead of "online". ~小太郎 TALKCONTRIBS 2011:06:13:02:36 (Monday)

~小太郎 TALK<sub style="margin-left:-26px 18:36, 12 June 2011
 

Here's the config section of the PHP script. Good luck passing that with AJAX :/

http://pastebin.com/pYWHfbJt

At the Minimum we need to have this hosted on the wiki server....

Xcelled19418:42, 12 June 2011
 

Eh, Marck isn't replying to my request on MM :(
Guess we'll have to wait ~小太郎 TALKCONTRIBS 2011:06:13:10:52 (Monday)

~小太郎 TALK<sub style="margin-left:-26px 02:52, 13 June 2011

No, Kotarou, we're not going to host this thing on MM and iframe it onto here.

κєνıи тαıĸ«)20:16, 13 June 2011
 

If we have access to the base PHP for the wiki_home page, a simple "Include()" function call is all that's needed. Oh, and the script has to be placed on this server. But that's easy enough, IJ can do it in about 5 sec.

Xcelled19420:52, 13 June 2011
 

OK, I gave it a face lift: http://www.ketelaar.com/WikiStatus/MabiServers.php technically, you COULD replace the current box with an iframe pointing to this. However, I am still farting with the looks, so it may break intermittently.....

Xcelled19408:59, 13 June 2011
 

AJAX AJAX AJAX AJAX AJAX AJAX AJAX AJAX AJAX AJAX etc etc etc (IE, no iframes) ~小太郎 TALKCONTRIBS 2011:06:14:07:38 (Tuesday)

~小太郎 TALK<sub style="margin-left:-26px 23:38, 13 June 2011

HOW ABOUT WE JUST IMPLEMENT SECURE PHP? HOW ABOUT WE JUST IMPLEMENT SECURE PHP? HOW ABOUT WE JUST IMPLEMENT SECURE PHP? HOW ABOUT WE JUST IMPLEMENT SECURE PHP? HOW ABOUT WE JUST IMPLEMENT SECURE PHP? HOW ABOUT WE JUST IMPLEMENT SECURE PHP? etc etc etc

κєνıи тαıĸ«)23:39, 13 June 2011
 

No need for all caps :( ~小太郎 TALKCONTRIBS 2011:06:14:08:17 (Tuesday)

~小太郎 TALK<sub style="margin-left:-26px 00:17, 14 June 2011
 

"AJAX" can also be written as "Ajax."

κєνıи тαıĸ«)16:41, 14 June 2011
 

Now now, kiddies. I think, depending on if IJ has access/can directly edit the Wiki_Home sourcecode, AJAX is the way to go as this will not prevent the page from loading simply because the server status is taking a while.

AJAX code that would REPLACE the current server box. Note that the URL is for EXAMPLE ONLY and would need to be changed to reflect the actual location:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){

   $("#response").load("ServerStat/info.php");

}); </script>

Elsewise, I've been looking at: http://www.mediawiki.org/wiki/Extension:Include

This implementation is potentially less secure, but if we configure it to use a regex that ONLY matches the path to the .PHP file, it should be watertight.... IJ, note that the regex would use PERL syntax, so you could fill that bit in yourself.

EITHER WAY, WE ARE NOT PERMANENTLY HOSTING THIS ON MY PERSONAL SITE

SOMEONE NEEDS TO DRAG IJ IN HERE AND MAKE HIM READ WHAT I JUST POSTED ^^^^^ (not it!)

Also, my script now reads from http://wiki.mabinogiworld.com/index.php?title=Automated_Server_Test for its configuration, so we'll need a (slightly) new template on how to edit. Its not really that much different, if you look, you'll see what I mean.

PHP source: http://pastebin.com/gbhFpga6

Xcelled19420:09, 14 June 2011
 

AJAX cannot be called Ajax because AJAX is an acronym...
Secure PHP on the other hand, cannot be all caps because "Secure" is not an acronym.

And I still don't see why we need to call IJ in when this can be done with AJAX. If you don't want it to be hosted on MM, I can host it on my 110mb.com site... ~小太郎 TALKCONTRIBS 2011:06:15:11:23 (Wednesday)

~小太郎 TALK<sub style="margin-left:-26px 03:23, 15 June 2011
 

Because as a general rule, you should keep content together. This (helps) to eliminate the elements-missing look when some dependant server goes down.

Also, I cannot directly edit the homepage or insert AJAX into the server page. Unless your permissions are different, we need IJ for that.

Xcelled19405:16, 15 June 2011
 

OK, well I have heard nothing on t his for a long time.... The script has been slightly modified for reliability and ease of use... The configuration page is set up with proper editing help:Automatic Server Status and its working. The only things left to do:

  • Get IJ to place the PHP and img files on the server
  • Replace the current status box with some kind of include of the PHP script.
Xcelled19412:48, 25 June 2011