Commit 031f8c8f7cf41fa80fd55abf6e10674e74e28f86
1 parent
656921a2
Added max_players.
Fixed printing number of players.
Showing
2 changed files
with
4 additions
and
1 deletions
check_csgo/check_csgo.cpp
... | ... | @@ -79,6 +79,7 @@ int check_csgo(char *hostname, uint16_t port, SERVERINFO *server_info) |
79 | 79 | offset += server_info->game.size()+1; |
80 | 80 | offset += 2; |
81 | 81 | server_info->players = (uint8_t) *((response->data)+offset); |
82 | + server_info->max_players = (uint8_t) *((response->data)+(++offset)); | |
82 | 83 | |
83 | 84 | delete[] (response->data-HDR_SIZE); |
84 | 85 | delete response; |
... | ... | @@ -140,7 +141,8 @@ int main(int argc, char **argv) |
140 | 141 | { |
141 | 142 | case 0: |
142 | 143 | cout << " OK"; |
143 | - cout << " - " << hostname << " " << server_info.name << " " << server_info.game << " " << server_info.map << " " << server_info.players << endl; | |
144 | + cout << " - " << hostname << " " << server_info.name << " " << server_info.game << " " << server_info.map | |
145 | + << " " << (int)server_info.players << "/" << (int)server_info.max_players << " players" << endl ; | |
144 | 146 | break; |
145 | 147 | |
146 | 148 | case 2: | ... | ... |