Skip to content

Open Halo PC's server browser filters from FILTERS - #8

Closed
medic-code wants to merge 5 commits into
feat/browser-sort-columnsfrom
feat/browser-filters
Closed

medic-code wants to merge 5 commits into
feat/browser-sort-columnsfrom
feat/browser-filters

Conversation

@medic-code

@medic-code medic-code commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Why

Players asked for Halo PC's server browser filters (MilesMetal, on the OpenCE Discord).

With about 40 public games listed, a player cannot hide full or empty games, distant hosts, or game types they do not play.

Halo PC had a FILTERS button and a filters screen. Both are in the port's menus, but hidden.

What it does

  • FILTERS in the server browser opens Halo PC's filters: SHOW EMPTY SERVERS, SHOW FULL SERVERS, PING (under 50 to under 300 ms), GAME TYPE, TEAMPLAY OPTIONS and SHOW MISSING MAPS. OK applies them; B or CANCEL closes without changes.
  • Hidden games are not shown, and their hosts are not pinged. Games hidden by PING are still pinged now and then, so they can come back.
  • When the filters hide every game, the line below the list says how many are hidden.
  • The filters are remembered from one run to the next. Nothing new is sent between computers.

Screenshots

Look at the list behind the panel: with SHOW FULL SERVERS set to NO and GAME TYPE set to CTF, OK hides both Slayer games. Opened again, a change followed by CANCEL leaves the list as it was.

Halo PC's filters hiding games

Decisions

Decision Reason Easy to change?
FILTERS opens the panel over the browser, as in Halo PC; the controller reaches it by moving down to the buttons, then right PC's join_game_button_filters and its filters_screen child of the join screen. The screen's own focus order is used, with no new button Yes
The browser's rows are hidden while the panel shows The pointer moving over the rows under the panel would otherwise take the focus from the panel Yes
Filters apply to the server browser only, not to LAN or Direct Link PC's filters were for its GameSpy list. LAN and Direct Link list a few games Yes
The hosts of hidden games are not timed The probes follow what is shown (OpenCommunityEdition#441). Timing hosts that nobody sees adds load to them Yes
...except the games that PING hides: these hosts are timed again on REFRESH and every two minutes Otherwise a game hidden for one slow ping can never show again Yes
PING < N hides a game whose known ping is N ms or more. A game with no ping (not yet timed, a password's, a failed join) stays A game with no ping yet must stay so that it can be timed. Password games are never timed Yes
SHOW FULL means players ≥ most players. SHOW EMPTY means no players These fields are in the listing. A "CLOSED" game that is starting but not full is not counted as full Yes
GAME TYPE matches the listing's game engine (CTF, Slayer, Oddball, King, Race). An OpenCE gametype shows under its engine (Infection under SLAYER) PC's five types are engines, and the listing carries the engine. Matching the OpenCE kind as well would add rows that PC did not have Yes
TEAMPLAY OPTIONS matches the listing's has_teams. FREE-FOR-ALL and TEAMPLAY both hide co-op games Co-op is neither of the two Yes
SHOW MISSING MAPS: the Xbox maps, campaign levels and installed Custom Edition maps (including another version of the same name) count as installed. A name that fills the listing's full 32 characters never counts as missing The listing carries only the scenario name, cut to 32 characters. Map sharing downloads a missing map when you join, so the default (YES) keeps those games Yes
SHOW MISSING MAPS is applied on the game's thread, so those hosts are still timed The check reads the maps folders, which the p2p thread that times the hosts must not do. It is done once for each map while the browser is open Yes, with a list of hidden maps passed to p2p_lobby.c
The filters are saved as six network.browser_* settings, with defaults that show every game. OK writes only the rows that changed Players should not have to set them again at each start. Whether Halo PC kept its filters was not checked Yes
A setting value that a row does not list (a ping of 75) shows and applies as its default The spinner can only show PC's values Yes
The "N games are hidden by FILTERS" line shows only when no game is shown The line below the games already describes the selected game. With no games shown, "No public games found" would be wrong Yes
Network version stays 38 Only what is shown and timed changes. All the fields used are already in the listing No, by design

Details

  • Flow: FILTERS runs gamespy select button → lobby_browser_select, which calls browser_filters_show (menu_functions.c). OK runs gamespy update filter settings → browser_filters_save, which writes the changed settings and calls p2p_lobby_set_filter (p2p_lobby.c). Each frame, p2p_lobby_games returns only the games that the filter shows, and update_probes uses the same test to choose which hosts to time. Builds on the sort PR (browser-sort-columns) and Time server browser hosts in the order shown, with dots OpenCommunityEdition/OpenCE#441.
  • port/linux/src/p2p_lobby.c: listing_shown applies the filter. update_probes calls it with the ping ignored, and p2p_lobby_games and p2p_lobby_filtered_games call it in full. The filter is kept for the run, also while the browser is closed.
  • port/linux/src/p2p.h: struct p2p_lobby_filter (all zero shows every game), P2P_LOBBY_TEAMS_*, p2p_lobby_set_filter, p2p_lobby_filtered_games.
  • port/linux/game/menu_functions.c: the FILTERS section. Each row has a spinner, a setting with its values, and its help lines. browser_filters_load runs when the browser opens. The panel is shown and hidden from there. SHOW MISSING MAPS (browser_map_missing, each map looked up once while the browser is open) runs after the name check. The help shows PC's lines: one for each value, but one line for PING and one for GAME TYPE. gamespy back handler closes the panel when it shows. FILTERS shows in the server browser only.
  • port/linux/src/port_config.c, port/linux/README.md: the six settings, the settings table, and the "Server browser" section.
  • tools/ce_menus.py, port/assets/menus/UNWIRED.md: gamespy update filter settings moves to the wired functions.

User experience

  1. Open Join Game > Server Browser. The games show as before, and FILTERS sits between REFRESH and JOIN GAME.
  2. Move down to the buttons, right to FILTERS, then press A (or click it). The filters show, with the focus on SHOW EMPTY SERVERS and its help below.
  3. Move down to PING and press right for < 50. Move down to the buttons and press A on OK. The games whose ping is 50 or more are no longer listed, and the focus is back on FILTERS.
  4. Open FILTERS again, set SHOW FULL SERVERS to NO and press OK. A full game is no longer listed.
  5. Quit and start the game again. The browser opens with the same filters.
  6. Set GAME TYPE to a type that no game plays and press OK. The line below the games says "4 games are hidden by FILTERS".
  7. Press B (or CANCEL) in the filters: the panel closes and nothing changes.

How to test

  1. python3 configure.py && ninja linux
  2. python3 -m pytest -q tools/test_linux_port.py -k p2p_signatures tools/harness/tests/test_browser_filters.py (Linux, or the halo-toolchain container: the harness needs a 32-bit C runtime).
  3. Run three or more hosts with HALO_NETWORK_TEST=host:<map>[:<variant>] and HALO_NETWORK_TEST_PUBLIC=true on a local broker. Open the Server Browser on another copy (HALO_MENU_OPEN=main_menu/multiplayer_type_select/join_game/join_game_screen), then try steps 2 to 7 above.

Tested

  • tools/p2p_lobby_check.c (via test_linux_port.py): five games through each filter (empty, full, PING < 100 and < 40, Slayer, free-for-all, teams). Each filter hides only its games, and their hosts are not probed on Refresh, except for the hosts hidden by PING. The game with no ping is kept. Every filter off shows all five again. A game hidden by its ping shows once its ping is under the limit. The filter is kept while the browser is off. Thirteen mutants of p2p_lobby.c each fail it.
  • tools/harness/tests/test_browser_filters.py: 7 cases, 23 negative controls.
  • pytest tools/test_linux_port.py tools/test_web_build.py tools/harness in the halo-toolchain container, at each commit (893, 917 and 923 passed, 4 skipped)
  • Null-renderer run in the container: four local hosts (one full at 2 of 2) and a browser on a local broker, driven by the controller. FILTERS opened and B closed it with the focus back on FILTERS. PING < 50 hid the 120 and 200 ms hosts, and REFRESH timed them again. SHOW FULL NO hid the full game. A second run read the filters back from config.toml, did not time the full game's host, and said "4 games are hidden by FILTERS" after GAME TYPE RACE. The pings were spread by instrumentation, because loopback pings are all 0.
  • Mouse clicks on the panel's spinners and buttons, and how the panel looks (the container cannot render)
  • ninja android, ninja web
  • CI on the fork: Linux, Android, web and Windows.

Halo PC's server browser had FILTERS: empty games, full games, a ping
limit, a gametype and free-for-all or team games. The filter lives in
p2p_lobby.c, next to the order, so that p2p_lobby_games and
update_probes agree: a game the filter hides is not shown and its host
is not timed. A game hidden only by its ping is still timed again on
Refresh and every two minutes, so it shows once its ping is under the
limit; a game with no ping (not yet timed, a password's, a failed
join) is never hidden by the limit. Free-for-all and team filters hide
co-op games, which are neither. The filter is kept for the run, also
while the browser is closed, and all zero (the start) hides nothing.
Nothing sent between machines changes: the network version stays 38.

Checked: tools/p2p_lobby_check.c shows five games through each filter
(empty, full, PING < 100 and < 40, Slayer, free-for-all, teams), each
hiding only its games and their hosts not probed on Refresh but for the
ping's; the game with no ping kept; every filter off shows all five; a
game hidden by its ping shows once it is under; the filter survives the
browser going off and on. Thirteen mutants of p2p_lobby.c each fail it.
PC's join game screen has a FILTERS button and a filters panel over the
list (join_game.filters.xml), which the port hid. In the server browser
FILTERS now shows the panel, with the focus on its first row; OK
("gamespy update filter settings"), B or CANCEL ("gamespy back
handler") hide it, the focus back on FILTERS. The browser's rows are
hidden under the panel, so that the pointer does not take the focus
through it. Each row shows PC's help for its value. LAN and Direct Link
have no FILTERS, as before. The rows do not hide any game yet.

Checked: tools/harness/tests/test_browser_filters.py (the panel shown
and hidden with its focus, OK, LAN, each row's help), with seven
negative controls; ninja linux.
The filters panel's rows now hide games. Each row opens on its value; OK
keeps the rows and applies them through p2p_lobby_set_filter, the
browser's games from the first, and B or CANCEL drops the rows changed.
SHOW MISSING MAPS hides a game on a map this machine has not got: the
Xbox's maps, a campaign level and a Custom Edition map (another version
of its name too) count as got, and a name of the listing's full 32
characters, which may be cut, never counts as missing. Those games'
hosts are still timed, as the maps are looked for on the game's thread,
each once while the browser is open. The values last until the game
quits.

Checked: tools/harness/tests/test_browser_filters.py (the filter from
the values, the panel shown with them and hidden, OK, LAN, each row's
help, SHOW MISSING MAPS on seven maps and each map looked for once),
with eighteen negative controls; ninja linux. Network version stays 38.
When the filters hid every game, the browser said "No public games
found", as if none were listed. The line below the games now says how
many the filters hide: those p2p_lobby_filtered_games counts, and those
SHOW MISSING MAPS hides.

Checked: tools/harness/tests/test_browser_filters.py (SHOW MISSING MAPS
counts the game it hides, and none with YES); the line itself is not
under test; ninja linux.
A player who sets the filters should not have to set them again at each
start, so each row now has a setting (network.browser_show_empty,
_show_full, _ping, _game_type, _teamplay, _show_missing_maps), with a
default that shows every game. The browser reads them as it opens, and
OK writes those changed; a value not among a row's (a ping of 75, an
unknown gametype) shows and applies as its default. The settings are in
port/linux/README.md's table, and the Server browser section says the
filters last from one run to the next. Whether Halo PC kept its filters
was not checked.

Checked: tools/harness/tests/test_browser_filters.py (the defaults, the
settings' values, a value not among a row's; OK writes only the rows
changed, and they read back), with twenty-three negative controls;
tools/test_linux_port.py's settings checks; ninja linux.
@medic-code
medic-code force-pushed the feat/browser-sort-columns branch from 142b622 to 48c5482 Compare October 25, 2026 16:40
@medic-code
medic-code force-pushed the feat/browser-filters branch from 3d3d203 to 198363b Compare October 25, 2026 16:40
@medic-code

Copy link
Copy Markdown
Owner Author

Closing as redundant: OpenCE main (OpenCommunityEdition#490, 815d3a0) now opens Halo PC's FILTERS panel from the server browser and keeps the filters in config.toml (network.browser_show_empty, browser_show_full, browser_maps, browser_gametype).

@medic-code medic-code closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant