equal
deleted
inserted
replaced
127 static int CDECL NGameClientSorter(const void *a, const void *b) |
127 static int CDECL NGameClientSorter(const void *a, const void *b) |
128 { |
128 { |
129 const NetworkGameList *cmp1 = *(const NetworkGameList**)a; |
129 const NetworkGameList *cmp1 = *(const NetworkGameList**)a; |
130 const NetworkGameList *cmp2 = *(const NetworkGameList**)b; |
130 const NetworkGameList *cmp2 = *(const NetworkGameList**)b; |
131 /* Reverse as per default we are interested in most-clients first */ |
131 /* Reverse as per default we are interested in most-clients first */ |
132 int r = cmp2->info.clients_on - cmp1->info.clients_on; |
132 int r = cmp1->info.clients_on - cmp2->info.clients_on; |
133 |
133 |
134 if (r == 0) r = cmp1->info.clients_max - cmp2->info.clients_max; |
134 if (r == 0) r = cmp1->info.clients_max - cmp2->info.clients_max; |
135 if (r == 0) r = strcasecmp(cmp1->info.server_name, cmp2->info.server_name); |
135 if (r == 0) r = strcasecmp(cmp1->info.server_name, cmp2->info.server_name); |
136 |
136 |
137 return (_internal_sort_order & 1) ? -r : r; |
137 return (_internal_sort_order & 1) ? -r : r; |