| 1684 | if (filter.minPlayers > 0) |
| 1685 | { |
| 1686 | AddCondition(value, Format("numplayers >= %d", filter.minPlayers)); |
| 1687 | } |
| 1688 | if (filter.maxPlayers > 0) |
| 1689 | { |
| 1690 | AddCondition(value, Format("numplayers <= %d", filter.maxPlayers)); |
| 1691 | } |
| 1692 | |
| 1693 | if (!filter.fullServers) |
| 1694 | { |
| 1695 | AddCondition(value, "numplayers < maxplayers"); |
| 1696 | } |
| 1697 | |
| 1698 | return value; |
| 1699 | } |
| 1700 | |
| 1701 | void DisplayMultiplayer::UpdateServerList() |
| 1702 | { |
| 1703 | if (!_sessions) |
| 1704 | { |
| 1705 | return; |
| 1706 | } |
| 1707 | |
| 1708 | // Test seed (triSeedSessions) freezes the list — skip the refresh so the |
| 1709 | // injected rows aren't cleared by the (empty) LAN/master fetch. |
| 1710 | if (_testSeeded) |
| 1711 | { |
| 1712 | return; |
| 1713 | } |
| 1714 | |
| 1715 | // (Re)fetch only on an explicit refresh — kick the query asynchronously so |
| 1716 | // the menu keeps rendering while the HTTP round-trip is in flight; the |
| 1717 | // results land on a later frame below via ThinkMasterServerBrowser(). |
| 1718 | if (_refresh) |
| 1719 | { |
| 1720 | _refresh = false; |
| 1721 | |
| 1722 | RString host = GetNetworkMasterServer(); |
| 1723 | if (host.GetLength() <= 0) |
| 1724 | { |
| 1725 | _sessions->_sessions.Resize(0); |
| 1726 | _sessions->SetCurSel(0); |