Skip to content

fix: start new profiles with no server browser filters - #75

Open
AlexRuiz7 wants to merge 1 commit into
B2BF:mainfrom
Forgotten-Hope-2-community-addons:fix/no-default-browser-filters
Open

AlexRuiz7 wants to merge 1 commit into
B2BF:mainfrom
Forgotten-Hope-2-community-addons:fix/no-default-browser-filters

Conversation

@AlexRuiz7

@AlexRuiz7 AlexRuiz7 commented Nov 9, 2026 •

Copy link
Copy Markdown

Closes #74

Change

  • GeneralSettings constructor and setDefaultValues seed the toggle-filter mask with 0
    instead of the retail 63616. Both assignments are marked [CHOSEN, not recovered].
  • general_settings_runtime expectations updated to 0.
  • New docs/server-browser-filters.md: filter bit values, their query clauses, how the mask,
    setToggleFilter and updateFilter interact, and the default's history.
  • New Code/Tools/SwfDisasm/avm1_disasm.py: AVM1 disassembler used to read the masks from
    mainMenu.swf (Python 2.7/3, no dependencies).

Evidence

Masks and clauses come from the ActionScript of External/FlashMenu/mainMenu.swf in both the
retail mods/bf2/Menu_client.zip and FH2's menu_client.zip (identical values). The retail
default is the immediate of mov dword ptr [esi+0F4h], 0F880h in setDefaultValues
(0x4B6AB0) and the constructor.

Compatibility

No ABI, protocol or file-format change. Only new profiles are affected.

Validation

  • cmd /c Code\Tests\general_settings_runtime.cmd
  • cmd /c Code\Tests\syntaxcheck.cmd Code\BF2\Game\GeneralSettings.cpp
  • New profile writes GeneralSettings.setToggleFilters 0 and the Filters page shows all
    boxes unchecked

Retail GeneralSettings seeds the toggle-filter mask with 63616
(PunkBuster, small/medium/large maps, same version only and same mod),
which hides servers from new players. New profiles now start with 0.
Both assignments are marked [CHOSEN, not recovered] and the
general_settings_runtime expectations are updated to match.

Also document the filter bit assignments recovered from the Flash main
menu (docs/server-browser-filters.md) and add the AVM1 disassembler
used to read them (Code/Tools/SwfDisasm/avm1_disasm.py).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two moderate active issues remain: the reset path can overwrite an existing profile’s filter mask, and the disassembler omits embedded function bodies needed to reliably inspect the documented calls.

2 open issues
What changed in this PR

This pull request changes the default server-browser filter mask for newly initialized profiles from retail value 63616 to 0, documents the filter behavior and evidence, and adds a standalone AVM1 disassembler.

Changes:

  • Initializes GeneralSettings and runtime expectations with an empty filter mask.
  • Documents filter bits, query clauses, persistence, and default history.
  • Adds an AVM1/SWF inspection utility and links the guide from the documentation index.
File Description
docs/​server-browser-filters.md Documents server-browser filter bits, query behavior, persistence, default history, and the SWF inspection workflow.
docs/​README.md Adds a link to the server-browser filter documentation.
Code/​Tools/​SwfDisasm/​avm1_disasm.py Adds a dependency-free Python AVM1/SWF disassembler for inspecting menu ActionScript.
Code/​Tests/​general_settings_runtime.cpp Updates runtime expectations for the default filter mask of 0.
Code/​BF2/​Game/​GeneralSettings.cpp Changes the constructor and default-value initialization filter mask from 63616 to 0.

Review effort: Lite

Comment on lines +490 to +492
// [CHOSEN, not recovered] Retail seeds 63616; new profiles start with no server browser
// filters. See docs/server-browser-filters.md.
m_toggleFilters = 0;
Comment on lines +135 to +137
elif code in (0x8E, 0x9B):
function_name, _ = _cstr(body, 0)
out.append('%s %s %r' % (tag_path, name, str(function_name)))
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.

Disable all internet filters by default

2 participants