File diff r15609:02b794721f9c → r15610:623a23fb6560
src/network/network_gui.cpp
Show inline comments
 
@@ -61,13 +61,14 @@ void SortNetworkLanguages()
 
	}
 

	
 
	/* Sort the strings (we don't move 'any' and the 'invalid' one) */
 
	QSortT(_language_dropdown, NETLANG_COUNT - 1, &StringIDSorter);
 
}
 

	
 
/** Update the network new window because a new server is
 
/**
 
 * Update the network new window because a new server is
 
 * found on the network.
 
 * @param unselect unselect the currently selected item */
 
void UpdateNetworkGameWindow(bool unselect)
 
{
 
	InvalidateWindowData(WC_NETWORK_WINDOW, 0, unselect ? 1 : 0);
 
}
 
@@ -276,13 +277,14 @@ protected:
 
	/** Sort servers by name. */
 
	static int CDECL NGameNameSorter(NetworkGameList * const *a, NetworkGameList * const *b)
 
	{
 
		return strcasecmp((*a)->info.server_name, (*b)->info.server_name);
 
	}
 

	
 
	/** Sort servers by the amount of clients online on a
 
	/**
 
	 * Sort servers by the amount of clients online on a
 
	 * server. If the two servers have the same amount, the one with the
 
	 * higher maximum is preferred. */
 
	static int CDECL NGameClientSorter(NetworkGameList * const *a, NetworkGameList * const *b)
 
	{
 
		/* Reverse as per default we are interested in most-clients first */
 
		int r = (*a)->info.clients_on - (*b)->info.clients_on;
 
@@ -314,13 +316,14 @@ protected:
 
	static int CDECL NGameYearsSorter(NetworkGameList * const *a, NetworkGameList * const *b)
 
	{
 
		int r = (*a)->info.game_date - (*a)->info.start_date - (*b)->info.game_date + (*b)->info.start_date;
 
		return (r != 0) ? r : NGameDateSorter(a, b);
 
	}
 

	
 
	/** Sort servers by joinability. If both servers are the
 
	/**
 
	 * Sort servers by joinability. If both servers are the
 
	 * same, prefer the non-passworded server first. */
 
	static int CDECL NGameAllowedSorter(NetworkGameList * const *a, NetworkGameList * const *b)
 
	{
 
		/* The servers we do not know anything about (the ones that did not reply) should be at the bottom) */
 
		int r = StrEmpty((*a)->info.server_revision) - StrEmpty((*b)->info.server_revision);