Skip to content

Commit

Permalink
Change: prioritize servers without password over ones with in server …
Browse files Browse the repository at this point in the history
…listing (#39)

The in-game client already does this, and it makes a lot more sense
to show servers you are free to join.
  • Loading branch information
TrueBrain authored Oct 20, 2021
1 parent 8cc5e9f commit dcd8a15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webclient/pages/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _split_version(raw_version):
def _sort_servers(servers):
servers.sort(
key=lambda x: _split_version(x["info"]["openttd_version"])
+ [x["info"]["clients_on"], x["info"]["companies_on"]],
+ ["0" if x["info"]["use_password"] else "1", x["info"]["clients_on"], x["info"]["companies_on"]],
reverse=True,
)

Expand Down

0 comments on commit dcd8a15

Please sign in to comment.