PDA

View Full Version : Server Status XML


John Adams
08-30-2007, 10:24 PM
Some have seen it on a few WoW emulators - a "plugin" of sorts that can be used by a server admin to periodically write server/world/zone/player/instance statistics to an XML file which is then used by a website.

Example: http://wow.mmoemulators.com/stats/stats.xml

I know there are currently ways to fput/fget info from the world itself, but that also leaves the system open to attack (in light of recent conversations). Plus, web admins then have to fudge all that stuff and do some hella parsing to get the data they want into the format they want. If the World or Zones could be flagged to write their current state to either a SQL table or an XML file, admins could build fancier server pages.

Just a suggestion. I know no one likes copy-catting, but when an idea is good, it's good. I'd love to see something like this for EQEmu. I've been looking into it, but honestly (as always) am boggled by how the World/Zone code moves info around itself.

Nice side project for those new devs coming around looking for work. ;)

fathernitwit
09-03-2007, 03:18 PM
this should be pretty doable with the world HTTP interface... without knowledge or modification of the actual server code (unless you need extra stuff)... would be cool to see this...

John Adams
09-04-2007, 06:53 PM
Thank you, FNW. I had written a web-based status page for my server that tapped into the http of the world server - unfortunately, it requires a login. And since it's pulling info live from the World, some asshat sat on the page spamming refresh over and over (about 200 times before I noticed) and I had to shut it down.

I cannot say it effected the World itself, but it did inspire me to ask for a World-controlled "push" stats feeder, either to DB or to XML. I am currently digging around to find where EQEmuMgmt page gets the player IP from - since that seems to need to get logged somewhere besides the humungous log files. :)

Thanks for the response. I'll post if I come up with anything.

AndMetal
11-26-2007, 10:37 AM
I think this is a really good way to get access to info inside the world server without having to telnet into the world server each time you want to get info.

I'm going to try tackling this and see what I can come up with. Unfortunately, I'm starting from scratch as far as knowledge on XML & Perl, but hopefully my experience with PHP will help :-)

narcberry
12-20-2007, 10:17 AM
The op link is borked so I dunno what all the stats were that seem important to most of you. To me, I built a small php page that queries some data from the database to display on a webpage.

http://www.jocoberry.com/eq/

As you can see, it's not a popular server. The problem with this method is you can only get info from what is in the database.

Here is the source php I use on that page:


To tell if the server is up or down:

<?
if (exec("ps -A | grep world") == "")
echo "<img src=\"./down.jpg\"</img>";
else
echo "<img src=\"./up.jpg\"</img>";
fi
?>


Who is online:

<?php
echo exec("mysql -H -u **USER** --password=**PASS** -D eqemu -e \"select distinct character_.name as Name, long_name as Zone from zone, character_, character_backup where zone.zoneidnumber = character_.zoneid and character_.name = character_backup.name AND ts > current_timestamp() - interval 1 hour ORDER BY ts;\"");
?>


Number of accounts (most of these are the folks using that quick connect button):

<?php
echo exec("mysql -H -u **USER** --password=**PASS** -D eqemu -e \"select count(id) as Accounts from account;\"");
?>


Trophy room by resale value:

<?php
echo exec("mysql -H -u **USER** --password=**PASS** -D eqemu -e \"SELECT character_.name AS Name, items.name AS Item FROM character_, inventory, items WHERE account_id != 6 AND itemid = items.id AND charid = character_.id ORDER BY price DESC LIMIT 5;\"");
?>


Hope this helps.

John Adams
12-26-2007, 08:25 AM
Sorry, my linux box died a while back and I never re-set up the virtual dir. Here's a link to simulated a stats page:

http://wow.mmoemulators.com/stats.xml

Granted, this "stats" is for a WoW emulator, but you get the idea. ;) As for your code, thank you for that. The problem I am faced with currently is that I host my server, but someone else hosts my websites. I could make it work, but I'm looking for a more core-based solution where the World itself can maintain either database or xml stats akin to this WoW stats concept. We'll eventually work it out.

Thanks again though.