ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/metaserver.c
(Generate patch)

Comparing deliantra/server/socket/metaserver.c (file contents):
Revision 1.1.1.1 by root, Fri Feb 3 07:14:44 2006 UTC vs.
Revision 1.10 by elmex, Sun Aug 13 17:16:06 2006 UTC

1/* 1/*
2 * static char *rcsid_metaserver_c = 2 * static char *rcsid_metaserver_c =
3 * "$Id: metaserver.c,v 1.1.1.1 2006/02/03 07:14:44 root Exp $"; 3 * "$Id: metaserver.c,v 1.10 2006/08/13 17:16:06 elmex dead $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
124 124
125 if (metafd == -1) return; /* No valid connection */ 125 if (metafd == -1) return; /* No valid connection */
126 126
127 /* We could use socket_info.nconns, but that is not quite as accurate, 127 /* We could use socket_info.nconns, but that is not quite as accurate,
128 * as connections in the progress of being established, are listening 128 * as connections in the progress of being established, are listening
129 * but don't have a player, etc. This operation below should not be that 129 * but don't have a player, etc. The checks below are basically the
130 * costly. 130 * same as for the who commands with the addition that WIZ, AFK, and BOT
131 * players are not counted.
131 */ 132 */
132 for (pl=first_player; pl!=NULL; pl=pl->next) { 133 for (pl=first_player; pl!=NULL; pl=pl->next) {
133 if (!pl->hidden) num_players++; 134 if (pl->ob->map == NULL) continue;
135 if (pl->hidden) continue;
136 if (QUERY_FLAG(pl->ob, FLAG_WIZ)) continue;
137 if (QUERY_FLAG(pl->ob, FLAG_AFK)) continue;
138 if (pl->state != ST_PLAYING && pl->state != ST_GET_PARTY_PASSWORD) continue;
139 //if (pl->socket.is_bot) continue;
140 num_players++;
134 } 141 }
135 142
136 sprintf(data,"%s|%d|%s|%s|%d|%d|%ld", settings.meta_host, num_players, VERSION, 143 sprintf(data,"%s|%d|%s|%s|%d|%d|%ld", settings.meta_host, num_players, VERSION "+",
137 settings.meta_comment, cst_tot.ibytes, cst_tot.obytes, 144 settings.meta_comment, cst_tot.ibytes, cst_tot.obytes,
138 (long)time(NULL) - cst_tot.time_start); 145 (long)time(NULL) - cst_tot.time_start);
139 if (sendto(metafd, data, strlen(data), 0, (struct sockaddr *)&sock, sizeof(sock))<0) { 146 if (sendto(metafd, data, strlen(data), 0, (struct sockaddr *)&sock, sizeof(sock))<0) {
140 LOG(llevDebug,"metaserver_update: sendto failed, err = %d\n", errno); 147 LOG(llevDebug,"metaserver_update: sendto failed, err = %d\n", errno);
141 } 148 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines