Commit 2e50262b724deb86fd29353658d4ca13b6396510

Authored by Imanol-Mikel Barba Sabariego
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,6 +84,13 @@ int check_csgo(char *hostname, uint16_t port, SERVERINFO *server_info)
84 delete[] (response->data-HDR_SIZE); 84 delete[] (response->data-HDR_SIZE);
85 delete response; 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 return 0; 94 return 0;
88 } 95 }
89 96
@@ -145,6 +152,10 @@ int main(int argc, char **argv) @@ -145,6 +152,10 @@ int main(int argc, char **argv)
145 << " " << (int)server_info.players << "/" << (int)server_info.max_players << " players" << endl ; 152 << " " << (int)server_info.players << "/" << (int)server_info.max_players << " players" << endl ;
146 break; 153 break;
147 154
  155 + case 1:
  156 + cout << " WARNING - Server is full";
  157 + break;
  158 +
148 case 2: 159 case 2:
149 cout << " CRITICAL - No response"; 160 cout << " CRITICAL - No response";
150 break; 161 break;