1 | /* |
1 | /* |
2 | * static char *rcsid_metaserver_c = |
2 | * static char *rcsid_metaserver_c = |
3 | * "$Id: metaserver.c,v 1.5 2006/07/09 14:09:20 root Exp $"; |
3 | * "$Id: metaserver.c,v 1.6 2006/07/11 10:35:20 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
132 | * as connections in the progress of being established, are listening |
132 | * as connections in the progress of being established, are listening |
133 | * but don't have a player, etc. This operation below should not be that |
133 | * but don't have a player, etc. This operation below should not be that |
134 | * costly. |
134 | * costly. |
135 | */ |
135 | */ |
136 | for (pl=first_player; pl!=NULL; pl=pl->next) |
136 | for (pl=first_player; pl!=NULL; pl=pl->next) |
137 | if (!pl->hidden pl->ob->map) num_players++; |
137 | if (!pl->hidden && pl->ob->map) num_players++; |
138 | |
138 | |
139 | sprintf(data,"%s|%d|%s|%s|%d|%d|%ld", settings.meta_host, num_players, VERSION "+", |
139 | sprintf(data,"%s|%d|%s|%s|%d|%d|%ld", settings.meta_host, num_players, VERSION "+", |
140 | settings.meta_comment, cst_tot.ibytes, cst_tot.obytes, |
140 | settings.meta_comment, cst_tot.ibytes, cst_tot.obytes, |
141 | (long)time(NULL) - cst_tot.time_start); |
141 | (long)time(NULL) - cst_tot.time_start); |
142 | if (sendto(metafd, data, strlen(data), 0, (struct sockaddr *)&sock, sizeof(sock))<0) { |
142 | if (sendto(metafd, data, strlen(data), 0, (struct sockaddr *)&sock, sizeof(sock))<0) { |