(svn r14730) -Codechange: remove the need for networkclientsockets and networkclientinfo structs to be in a contiguous piece of memory and put them in a pool.

-Note: 255 should really be enough for now... making it any more means network protocol bumps.
This commit is contained in:
rubidium
2008-12-23 20:52:27 +00:00
parent 94dd23aaf8
commit afddfcb2b1
9 changed files with 89 additions and 135 deletions

View File

@@ -301,8 +301,13 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
/* First, try clients */
if (*item < MAX_CLIENT_SLOTS) {
/* Skip inactive clients */
while (GetNetworkClientInfo(*item)->client_id == INVALID_CLIENT_ID && *item < MAX_CLIENT_SLOTS) (*item)++;
if (*item < MAX_CLIENT_SLOTS) return GetNetworkClientInfo(*item)->client_name;
NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS_FROM(ci, *item + 1) break;
if (ci != NULL) {
*item = ci->index;
return ci->client_name;
}
*item = MAX_CLIENT_SLOTS;
}
/* Then, try townnames */