Live SA-MP Player Count
#1

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.
Reply
#2

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)?
Reply
#3

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

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.
Reply
#5

swag
Reply
#6

Pretty Cool
Reply
#7

Smexy and awesome
Reply
#8

Great
Reply
#9

The numbers are changing so fast, awesome!
Reply
#10

Holy shit, so fast!!!

FAKIN OSAM!!!
Reply
#11

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+.
Reply
#12

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.
Reply
#13

damn real nice thing , amazing you have my rep
Reply
#14

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

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.
Reply
#16

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!
Reply
#17

Amazing.
Reply
#18

Useful, Cool it's live.
Reply
#19

Cool.
Reply
#20

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]));
});
}

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)