Commit 2e50262b724deb86fd29353658d4ca13b6396510
1 parent
031f8c8f
Added warning message if server full.
Showing
1 changed file
with
11 additions
and
0 deletions
check_csgo/check_csgo.cpp
... | ... | @@ -84,6 +84,13 @@ int check_csgo(char *hostname, uint16_t port, SERVERINFO *server_info) |
84 | 84 | delete[] (response->data-HDR_SIZE); |
85 | 85 | delete response; |
86 | 86 | |
87 | + server_info->players = 18; | |
88 | + | |
89 | + if(server_info->players == server_info->max_players) | |
90 | + { | |
91 | + return 1; | |
92 | + } | |
93 | + | |
87 | 94 | return 0; |
88 | 95 | } |
89 | 96 | |
... | ... | @@ -145,6 +152,10 @@ int main(int argc, char **argv) |
145 | 152 | << " " << (int)server_info.players << "/" << (int)server_info.max_players << " players" << endl ; |
146 | 153 | break; |
147 | 154 | |
155 | + case 1: | |
156 | + cout << " WARNING - Server is full"; | |
157 | + break; | |
158 | + | |
148 | 159 | case 2: |
149 | 160 | cout << " CRITICAL - No response"; |
150 | 161 | break; | ... | ... |