SA-MP Forums Archive
Live SA-MP Player Count - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Live SA-MP Player Count (/showthread.php?tid=406917)

Pages: 1 2 3


Live SA-MP Player Count - ev0lution - 12.01.2013

I got bored today and made this: http://playercount.ev0lution.net/

It's a live counter of the number of players online in SA-MP, and the most accurate that it can be.

It works by querying every server on the masterlist constantly and updating the player count accordingly - this means that any changes are almost instant, and the count itself is much more accurate* than the SA-MP site, which only updates every ~10 minutes.

There's really no point to this other than to look cool, so uh.. enjoy!

* More accurate in the sense that it updates much more frequently and is a more accurate indicator of the number of players at the current time. Apparently it's not accurate because it queries more servers (and thus more players) than it should - the SA-MP site counter filters out certain "fake servers" but since I don't know how they detect these, I'm not able to do it. This means that at the moment, my counter will always be higher than the SA-MP site.


Re: Live SA-MP Player Count - SchurmanCQC - 12.01.2013

Wow! Amazingly simplistic, overall SEXY!

Nice job. Also, I'll have you know it's against SA-MP ToS to query the masterlist outside of SA-MP. sorry to piss in your cornflakes.


EDIT: I may have misunderstood this. How does ajax-get-stats.php query all servers without using the masterlist (if it isn't)?


Re: Live SA-MP Player Count - Nick_Echo - 12.01.2013

nice to know that samp is going strong! Now do a parallell comparisson to MTA?


Re: Live SA-MP Player Count - ev0lution - 12.01.2013

Quote:
Originally Posted by Schurman
Посмотреть сообщение
Nice job. Also, I'll have you know it's against SA-MP ToS to query the masterlist outside of SA-MP. sorry to piss in your cornflakes.
Where does it say that?

Quote:
Originally Posted by Schurman
Посмотреть сообщение
EDIT: I may have misunderstood this. How does ajax-get-stats.php query all servers without using the masterlist (if it isn't)?
ajax-get-stats.php just queries the database for information that it has already retrieved, it's all done in the background.


Re: Live SA-MP Player Count - KingHual - 12.01.2013

swag


Re: Live SA-MP Player Count - MarshallNero - 12.01.2013

Pretty Cool


Re: Live SA-MP Player Count - DoctorRapist - 12.01.2013

Smexy and awesome


Re: Live SA-MP Player Count - Beckett - 12.01.2013

Great


Re: Live SA-MP Player Count - Astralis - 12.01.2013

The numbers are changing so fast, awesome!


Re: Live SA-MP Player Count - Superdude - 12.01.2013

Holy shit, so fast!!!

FAKIN OSAM!!!


Re: Live SA-MP Player Count - Ironboy500[TW] - 12.01.2013

It just hopped from 38,077 to 38,783.
Is it possible that it makes so big jumps? I mean, in few seconds playercount rised for 700+.


Re: Live SA-MP Player Count - ev0lution - 12.01.2013

It's entirely possible, but probably more likely that your browser missed a few updates, so the gap was actually longer than you thought. I've also noticed browsers seem to pause or throttle ajax requests when the page isn't in focus, so if you go to a different tab and then switch back a while later, the difference will be a lot greater as no data was received in between.


Re: Live SA-MP Player Count - AMEENAMEEN - 12.01.2013

damn real nice thing , amazing you have my rep


Re: Live SA-MP Player Count - Dortmund - 12.01.2013

Quote:
Originally Posted by king_hual
Посмотреть сообщение
swag
#swaqq


Re: Live SA-MP Player Count - Vince - 12.01.2013

http://www.sa-mp.com/service_agreement.txt
Код:
(b) You may not connect to the SA-MP master list using custom software unless
permission is granted by the service provider.
That doesn't take away that is indeed a nice script, but I'm worried that it will generate lots of extra, unnecessary traffic.


Re: Live SA-MP Player Count - ev0lution - 12.01.2013

Quote:
Originally Posted by Vince
Посмотреть сообщение
http://www.sa-mp.com/service_agreement.txt
Код:
(b) You may not connect to the SA-MP master list using custom software unless
permission is granted by the service provider.
That doesn't take away that is indeed a nice script, but I'm worried that it will generate lots of extra, unnecessary traffic.
"SA-MP.COM MASTER LIST SERVICES AGREEMENT FOR PUBLIC SERVERS"

Of course that's not to say that there aren't some rules or guidelines for external sources querying the masterlist - there should be! - but my script doesn't check it all that often. And as an example, Westie's masterlist checker ran for years without a problem!


Re: Live SA-MP Player Count - Jese - 12.01.2013

Amazing.


Re: Live SA-MP Player Count - Michael@Belgium - 12.01.2013

Useful, Cool it's live.


Re: Live SA-MP Player Count - Rhymed32 - 12.01.2013

Cool.


Re: Live SA-MP Player Count - saiberfun - 12.01.2013

Really nice and neat.

Yes there have been problems with people trying to use the masterlist that way :/
You are better off asking the team if it's okay.

And to make it even more awesome you could also add an embeddingoption (would generate some more traffic I guess but meh
I have done something similar static in PHP some time but I didn't fetch the data directly from the masterlist but from the website itself, it worked but I somehow were not that satisfied with it to release it in some way.

Edit, oh and I like you vars

Quote:

function refreshPlayers() {
$.get("ajax-get-stats.php",function(data) {
var poop = data.split("/");
$("#playerCount").html(formatValue(poop[0]));
$("#serverCount").html(formatValue(poop[1]));
$("#peakCount").html(formatValue(poop[2]));
});
}