diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index 4a90db8e2b..c4501b97a6 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -39,6 +39,12 @@ int32_t ServerListEntry::CompareTo(const ServerListEntry& other) const return a.favourite ? -1 : 1; } + // Order by local + if (a.local != b.local) + { + return a.local ? 1 : -1; + } + // Then by version bool serverACompatible = a.version == network_get_version(); bool serverBCompatible = b.version == network_get_version(); @@ -241,6 +247,7 @@ std::future> ServerList::FetchLocalServerListAsync( auto entry = ServerListEntry::FromJson(jinfo); if (entry.has_value()) { + entry.value().local = true; entries.push_back(entry.value()); } diff --git a/src/openrct2/network/ServerList.h b/src/openrct2/network/ServerList.h index 6aaa510157..7a1f6b4ced 100644 --- a/src/openrct2/network/ServerList.h +++ b/src/openrct2/network/ServerList.h @@ -29,6 +29,7 @@ struct ServerListEntry bool favourite{}; uint8_t players{}; uint8_t maxplayers{}; + bool local{}; int32_t CompareTo(const ServerListEntry& other) const; bool IsVersionValid() const;