sort servers by ping first
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2692 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -457,10 +457,10 @@ int sicompare(serverinfo **ap, serverinfo **bp)
|
||||
serverinfo *a = *ap, *b = *bp;
|
||||
if((a->protocol==PROTOCOL_VERSION) > (b->protocol==PROTOCOL_VERSION)) return -1;
|
||||
if((b->protocol==PROTOCOL_VERSION) > (a->protocol==PROTOCOL_VERSION)) return 1;
|
||||
if(a->numplayers<b->numplayers) return 1;
|
||||
if(a->numplayers>b->numplayers) return -1;
|
||||
if(a->ping>b->ping) return 1;
|
||||
if(a->ping<b->ping) return -1;
|
||||
if(a->numplayers<b->numplayers) return 1;
|
||||
if(a->numplayers>b->numplayers) return -1;
|
||||
int namecmp = strcmp(a->name, b->name);
|
||||
if(namecmp) return namecmp;
|
||||
if(a->port>b->port) return 1;
|
||||
|
||||
Reference in New Issue
Block a user