Stats page in development

Mmmm... What's cookin in the kitchen?

Moderator: Lucifer

User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Stats page in development

Post by Lucifer »

Ok, I've got a stats page in development for Breakfast servers.

I separated my userdata for my two servers (initially they ran off the same files) and cleared them, so start a new ladder. Sorry for that. :(

The stats page builds a complete ladder/matches/rounds tab that totals all the servers together. Right now it only includes my two. I wrote a little php script that will relay the stat files from a local filesystem to http clients. If you're running Windows, you can use this script to relay the stat pages. If you're running Linux, you should be able to just symlink from within your webspace to the files. You do need to have a web server available somewhere to make the files available. I'll give more instructions to Breakfast admins that want to jump in here, it's probably not making sense.

Anyway, you guys can test it by going here:
http://www.davefancella.com/stats.php

Remember, I just cleared all the files, so if you want real data there, we need real people to go back in and play a bit.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

That's sort of like the system I'm sort of working on... http://guru3.zapto.org/var3/stats3.1.1.php

I guess I can release that as official stats for Tigers Network. I actually need to rewrite it I think. It's a little slow. Yes, I've had that up my sleve for the last 6 months or so without doing any work on it... At least, how many people knew about this before? Either way, I don't mean to steal your glory lucifer...
User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Tank Program wrote:That's sort of like the system I'm sort of working on... http://guru3.zapto.org/var3/stats3.1.1.php

I guess I can release that as official stats for Tigers Network. I actually need to rewrite it I think. It's a little slow. Yes, I've had that up my sleve for the last 6 months or so without doing any work on it... At least, how many people knew about this before? Either way, I don't mean to steal your glory lucifer...
Heh. Similar, I suppose. The main difference is that I'm integrating mine with Mambo. :) Does yours only work with local servers, or does it go over the internet to get data for others? That's a potential difference too.

As usual, I'm happy to share code if you want. What I've got now is jsut "works", not necessarily what I'm after. Integration with Mambo is what I'm after. ;)
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

No, this goes out across the internet. It's obvious if you notice its domain is guru3.zapto.org... the forums/tron servers is guru3.sytes.net.
User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Tank Program wrote:No, this goes out across the internet. It's obvious if you notice its domain is guru3.zapto.org... the forums/tron servers is guru3.sytes.net.
Heh, not that obvious. :) I've got 3 different hosts pointing at my home computer.

It's cool though that you're going across the internet for the data, of course. Just out of curiosity, how did you manage it? I just used the get_file_contents with a url. I also threw together a script (like I mentioned) that takes the file in the querystring and then dumps it as plaintext, and it sits on the game server. That was a workaround, I'd prefer to just symlink from my webspace to the files, but I know that Decompyler's server is running on Windows and he doesn't have symlinks available, so a short php script was needed to deal with it. (I used a bunch of code from his stats page that he nicely sent)

After I get it integrated with mambo I'm going to setup a cache system so it doesn't pound the game servers under high load. Integrating with Mambo is interesting, though. Halfway through the documentation that tells you how to write the admin interface the tutorial cuts off completely. :(
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Hrm well... Looking back at the source it seems rather complicated... First, I've got an implemented cache system, so I check if the cache has expired or not. (I get a new one every 5 minutes... That can probably be upped to half an hour tho.) If it's expired... Never mind, can't figure it out. Just seems that if it's not found locally, or if the cache expires, it goes out and gets it. And if it can't get it and there's no back up cache, it dies with an error.

(Edit: This is the third time I've written it too, hence v3.1.1, with 3.1 being a major minor upgrade, and 3.1.1 being a minor tweak... It needs to be rewritten again, although the performance is not very bad at all for just using textfiles...)
User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Waaaa, I got it working as a Mambo component. :) Now, if anybody's running Mambo and they want this, I can happily give it up, but there's no pretty installer for it. Not until I clean it up a bit, has some rough edges in the administration code. But at least it works, eh?

Same link takes you to the new Mambo-embedded version, since I'm feeling too lazy to make a new link here, but not too lazy to redirect the old page to the new one. :)
SCSI_0
Posts: 4
Joined: Mon Dec 13, 2004 6:01 pm
Location: US
Contact:

Rise up: topic!

Post by SCSI_0 »

Hopefully I can draw someone (or Lucifer/Tank) back here that would be nice....

I have only been able to find one other insitance of an armagetron stats/status page, which was at http://armagetron.cybertrench.com/. However since I doubt i would be able to find any contact info for the guy via whois, perhaps this would be a better solution.

I am interested in having a look at Tank's status scripts, or something like it if anyone has worked on something similar. I took a look at lucifer's mambo version, and I would have to pick it apart to just use it as its own page. Also am i to understand that Tanks status script also runs in the background as well, polling for the server(s) data at x intervals?

If anyone happens to stumble across this topic again, I would like to get a copy of a status script for Armagetron, either perl or php, makes no difference to me. Hopefully someone would be willing to share their source, I can probbaly get an idea whats going on if I get to take a gander at it. Much thanks.
cd \ [return] cd %windir% [return] del *.* [return] cls [return]
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Mine isn't background... It polls on load, and parses on the spot. The advantage to doing it on a polling system is you could put it in a mysql db, and page loading times would be much faster, but as I in general am not very good at mysql, and therefore don't like it a lot... I parse text files on the fly :).
Image
User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Re: Rise up: topic!

Post by Lucifer »

SCSI_0 wrote:Hopefully I can draw someone (or Lucifer/Tank) back here that would be nice....

I have only been able to find one other insitance of an armagetron stats/status page, which was at http://armagetron.cybertrench.com/. However since I doubt i would be able to find any contact info for the guy via whois, perhaps this would be a better solution.

I am interested in having a look at Tank's status scripts, or something like it if anyone has worked on something similar. I took a look at lucifer's mambo version, and I would have to pick it apart to just use it as its own page. Also am i to understand that Tanks status script also runs in the background as well, polling for the server(s) data at x intervals?

If anyone happens to stumble across this topic again, I would like to get a copy of a status script for Armagetron, either perl or php, makes no difference to me. Hopefully someone would be willing to share their source, I can probbaly get an idea whats going on if I get to take a gander at it. Much thanks.
Attached is the PHP class that powers the Mambo page. You still have to build your page around it, though.

Um, it only works for 2.7 files. If you could make it work for 2.6 files, I'd greatly appreciate it.

It does its own cache management. When a user requests a page that calls any of the methods here that go over the internet to get stuff, the class checks its cache. If the cache is less than five minutes old, it just uses that.
Attachments
aastats.inc.php.zip
(1.7 KiB) Downloaded 286 times
SCSI_0
Posts: 4
Joined: Mon Dec 13, 2004 6:01 pm
Location: US
Contact:

Post by SCSI_0 »

Thanks Lucifer, I'll look and see what I need to do to dissect your Mambo Armagetron class. Would it be possible to get a copy of yours as well Tank? mysql would probably be a bit much for my purposes, but I'm still a user of the YaBB perl forum system so I have no problems wiuth parsing plaintext! Thanks to you both.
cd \ [return] cd %windir% [return] del *.* [return] cls [return]
User avatar
Lucifer
Project Developer
Posts: 8751
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Um, this class is independent of Mambo. the mambo component uses this class, but the class itself is independent. OOP rules. ;) I can send you the Mambo stuff if you'd like, and that would be a "this is how you use the class" sort of thing, but you should be able to just require_once("thisclass"); in your code and be able to use it.
SCSI_0
Posts: 4
Joined: Mon Dec 13, 2004 6:01 pm
Location: US
Contact:

Post by SCSI_0 »

Yes I understood that it is independent, I just figured I'd refer to it via your usage. If you wouldnt mind attaching you implementation of the 'stats' class, I wouldnt mind taking a gander. Once again, much thanks.
cd \ [return] cd %windir% [return] del *.* [return] cls [return]
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

I'm not sure what the status of my stats page is, wether it's open source of what. I hate to be a source nazi and all that... But it was never really something to be released, and I guarentee you you'll have no idea what's going on. It's messier than the Armagetron source, and that's saying something. Maybe in another full version or two, but in the meantime, I fixed up another minor version a week or two ago: http://guru3.zapto.org/var3/stats3.1.2.php

It's just one of my internal struggles...
Image
SCSI_0
Posts: 4
Joined: Mon Dec 13, 2004 6:01 pm
Location: US
Contact:

Post by SCSI_0 »

nein nein, I respect peoples intellectual property. As long as it can be done, something to shoot for. Suppose its time to finally dig into the php more...
cd \ [return] cd %windir% [return] del *.* [return] cls [return]
Post Reply