================ SVC_Info Responds with a short info message that should be enough to determine if a user is interested in a server to do a full status ================ */
| 222 | ================ |
| 223 | */ |
| 224 | static void SVC_Info( netadr_t from ) { |
| 225 | int i, count; |
| 226 | char infostring[MAX_INFO_STRING]; |
| 227 | |
| 228 | count = 0; |
| 229 | for ( i = 0 ; i < 1 ; i++ ) { |
| 230 | if ( svs.clients[i].state >= CS_CONNECTED ) { |
| 231 | count++; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | infostring[0] = 0; |
| 236 | |
| 237 | // echo back the parameter to status. so servers can use it as a challenge |
| 238 | // to prevent timed spoofed reply packets that add ghost servers |
| 239 | Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) ); |
| 240 | |
| 241 | Info_SetValueForKey( infostring, "protocol", va("%i", PROTOCOL_VERSION) ); |
| 242 | //Info_SetValueForKey( infostring, "hostname", sv_hostname->string ); |
| 243 | Info_SetValueForKey( infostring, "mapname", sv_mapname->string ); |
| 244 | Info_SetValueForKey( infostring, "clients", va("%i", count) ); |
| 245 | Info_SetValueForKey( infostring, "sv_maxclients", va("%i", 1) ); |
| 246 | |
| 247 | NET_OutOfBandPrint( NS_SERVER, from, "infoResponse\n%s", infostring ); |
| 248 | } |
| 249 | |
| 250 | |
| 251 | /* |
no test coverage detected