Repository navigation
Open Halo PC's server browser filters from FILTERS - #8
Closed
medic-code wants to merge 5 commits into
Closed
medic-code wants to merge 5 commits into
medic-code wants to merge 5 commits into
Conversation
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
force-pushed
the
feat/browser-sort-columns
branch
from
October 25, 2026 16:40
142b622 to
48c5482
Compare
medic-code
force-pushed
the
feat/browser-filters
branch
from
October 25, 2026 16:40
3d3d203 to
198363b
Compare
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.
Decisions
join_game_button_filtersand itsfilters_screenchild of the join screen. The screen's own focus order is used, with no new button< Nhides a game whose known ping is N ms or more. A game with no ping (not yet timed, a password's, a failed join) stayshas_teams. FREE-FOR-ALL and TEAMPLAY both hide co-op gamesp2p_lobby.cnetwork.browser_*settings, with defaults that show every game. OK writes only the rows that changedDetails
gamespy select button→lobby_browser_select, which callsbrowser_filters_show(menu_functions.c). OK runsgamespy update filter settings→browser_filters_save, which writes the changed settings and callsp2p_lobby_set_filter(p2p_lobby.c). Each frame,p2p_lobby_gamesreturns only the games that the filter shows, andupdate_probesuses 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_shownapplies the filter.update_probescalls it with the ping ignored, andp2p_lobby_gamesandp2p_lobby_filtered_gamescall 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_loadruns 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 handlercloses 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 settingsmoves to the wired functions.User experience
< 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.How to test
python3 configure.py && ninja linuxpython3 -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).HALO_NETWORK_TEST=host:<map>[:<variant>]andHALO_NETWORK_TEST_PUBLIC=trueon 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(viatest_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 ofp2p_lobby.ceach 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/harnessin the halo-toolchain container, at each commit (893, 917 and 923 passed, 4 skipped)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.ninja android,ninja web