View Single Post
Stijn Stijn's Avatar

Administrator

Joined: Mar 2001

Posts: 6,964

Stijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to behold

Jun 9, 2017, 03:32 PM
Stijn is offline
Reply With Quote
vBrute: I should've made a note of this in the documentation, but you no longer need to "join" a server to acquire the player list. The packet you send in line 4 now has an extra byte that can be set to get player info from the server. Send an UDP packet with the following value

Code:
\x07\x14\x05\x00\x01
(that's \x05\x00\x01, plus the leading two checksum bytes). The server will reply with an extended version of the packet, with the following format:

Code:
char[2]  header
long  uptime in seconds
long  version
char  number of clients
char  number of players
char  game mode
char  max players
char  length of server name
char[]  server name
char  custom mode
char  flags (if the server is not running 5.5, this byte and all the following will be missing)
  & 1: server is private (if this is the case none of the following data will be sent)
  & 1 << 1: plus only
  & 1 << 2: idle server mode
char  max score
char  blue score
char  red score
char  green score
char  yellow score

then for each player:
  char[]  player name (null-terminated)
  char  player score
  char  player flags
    & 3: player team
    & 1 << 2: player is spectating

char[] level filename
That level filename at the end is kind of awkward, oh well. I can't really tell at a glance what exactly broke your script, but the old way of getting player info was always a hack and you should switch to the new method if possible.

Last edited by Stijn; Jun 10, 2017 at 02:22 AM.