Protocol change for SA-MP
Brought to you by:
evilpie,
tombuskens
Well, this isn't really a protocol change, it's just that people who have been writing scripts for SA-MP haven't really bothered to explore the possibilities before the 0.3 release. If you want a detailed explanation of the protocol, it's at http://wiki.sa-mp.com/wiki/Query_Mechanism (written by me, obv), and I've included my own query include, if you need a PHP version. I tried to edit the GameQ's /Protocol/samp.php file, but failed dramatically - when I get a working copy, I'll link to that as well.
:)
SA-MP Query API
Oh, and I forgot to tell you why it might be classed as a bug. Player counts are restricted to 0 < x < 255, then they will overrun with GameQ. Also for your information, if the player count is more than 100, then no player information will be returned. Just for your info.
Hey typefish,
thank you for this wonderfull research. I was able to fix those bugs, but its still impossible to query servers with more then 100 players, because there seems to be a problem with the servers. Even with code wich never timeouts, i cant query those.
But i changed the player query, so we now can see more informations like id or ping.
btw:
OpCode c -> This really doesn't stand for anything
Did you think of "Clients".
I suppose about the 100 player feature I was being ambiguous. It's the protocol that causes that, due to a feature that is there to stop self-DoS attacks originating from the server - or it's a cheap way of avoiding rewriting the protocol because there's a bug with the `d` opcode which means the player ID will never rise above 255 - we'll never know. :p And about `c` - evilpie, thanks for that. I didn't really think of that name, I'll edit it now.
-Westie
I've had a test now, and it seems that the names is a bit bugged. I got this when I was trying to edit the library, but works perfect using my own.
print_r(): http://westie.pastebin.com/YiLBZE1F
I'll try and help you find the problem.
Mhm: http://westie.pastebin.com/nEBp3RC8
I think you forgot to update packets.ini
Correct you are. Thank you! :)
No problem