Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
b1d17ec
fix: restore retail sv.numPlayersNeededToStart
Nov 3, 2026
fad6b3a
AI: engine-side support for the AI reconstruction
Nov 3, 2026
ecffd5f
AI: libaidll reconstruction and engine-side AI interface
Nov 3, 2026
cc1bf5e
AI: build manifests for the Windows AIDLL and the native Linux AI lib…
Nov 3, 2026
519ad45
Core: one retail random instance name, dice::hfe::Rand, in both images
Nov 3, 2026
1b679a0
ci: fix Windows x86 runtime-pair and x64 dedicated links
Nov 3, 2026
b7284c4
Merge branch 'main' into ai/reconstruction
kr4uzi Nov 3, 2026
5ddf524
Update runtime_pair.cpp
kr4uzi Nov 3, 2026
f903156
Merge pull request #1 from kr4uzi/ai/reconstruction
kr4uzi Nov 3, 2026
3b977e7
AI: cross-check against the AIDLL_r debug build (names, TU placement)
Nov 5, 2026
34944ed
Merge pull request #2 from kr4uzi/ai/aidll-r-crosscheck
kr4uzi Nov 5, 2026
b840398
Memory: recover Memory.dll (111/111 functions, differential-tested ag…
Nov 6, 2026
e5ce10d
Merge pull request #3 from kr4uzi/memory/recover-dll
kr4uzi Nov 6, 2026
d6d0ba7
Engine, game, AI and client UI updates
Nov 7, 2026
19728c8
macOS client with the Metal renderer, macOS CI
Nov 7, 2026
95c1709
RendDX9 fully recovered, Bink port and Windows x64 movies
Nov 7, 2026
c154e0e
CI: run the macOS job on macos-15
Nov 7, 2026
e878b5a
CI: install Perl's JSON module for vkd3d's configure on macOS
Nov 7, 2026
7c78c69
CI: the Windows x86 D3DX check accepts the fallback and no longer fai…
Nov 7, 2026
cc5debf
CI: Vulkan and SPIR-V headers and pkg-config for vkd3d on macOS
Nov 7, 2026
7d49013
CI: build the Windows x64 client too
Nov 7, 2026
20cc322
InputScript: float constants for the minimum steering step (MSVC C4244)
Nov 7, 2026
9cbaeb3
Merge mac/pr1-engine (InputScript C4244 fix) into mac/pr3-macos
Nov 7, 2026
ee2ebfe
Merge pull request #5 from kr4uzi/mac/pr1-engine
kr4uzi Nov 7, 2026
cb595df
Merge pull request #7 from kr4uzi/mac/pr3-macos
kr4uzi Nov 7, 2026
4240c9b
Destructor and warning fixes: complete delete types, class keys, nodi…
Nov 7, 2026
7416254
Merge pull request #8 from kr4uzi/fix/msvc-warnings
kr4uzi Nov 7, 2026
fc73b33
Remaining MSVC warnings: shipped comparisons and shifts made explicit
Nov 7, 2026
8e170ab
x64 warnings: GameSpy's lengths and void* indices, PasswordCodec's count
Nov 7, 2026
ad5ae4c
Merge pull request #9 from kr4uzi/fix/msvc-warnings-2
kr4uzi Nov 7, 2026
e5864f9
Windows packaging: x64 client package, strict links, install instruct…
Nov 8, 2026
425ff92
Windows x64: native AI library aidll.dll (closes #11)
Nov 8, 2026
cc59d25
CI: accept dumpbin's 'name = name' export lines for aidll.dll
Nov 8, 2026
67e1336
AI: explicit 32-bit widths for the MSVC x64 warnings (C4267, C4334)
Nov 8, 2026
c47317b
Merge pull request #10 from kr4uzi/fix/windows-packaging
kr4uzi Nov 8, 2026
c8fa55b
SwiffPlayer: recovered gameswf engine, menu fixes and client options
Nov 10, 2026
988e7a8
SwiffPlayer: interpreter complete, retail tesselator, last ledger rows
Nov 11, 2026
91d1453
macOS native effect cache: key on the linked shader libraries, never …
Nov 11, 2026
1cde5a3
Merge pull request #12 from kr4uzi/mac/flash-clients
kr4uzi Nov 11, 2026
4f90c45
Clean client quit and the demo lists of the menus
Nov 11, 2026
0bfc81e
macOS client: write the replacement log into the client data directory
Nov 11, 2026
cb78dd7
Build the macOS app disk image in CI and attach it to releases
Nov 11, 2026
2c358d4
Merge pull request #13 from kr4uzi/mac/clean-quit
kr4uzi Nov 11, 2026
a82b8c9
macos-app: pass absolute paths to the setup release script
Nov 11, 2026
4326ac4
Merge pull request #14 from kr4uzi/mac/release-installer
kr4uzi Nov 11, 2026
6263419
macOS port and v0.2.0: native macOS app, voice chat, demos, Windows x64
Nov 14, 2026
6acf4de
CI: build the macOS app from setup v0.3.0 (Developer ID signing, laun…
Nov 15, 2026
ff75619
Editor: link the GameSpy voice objects the client objects need
Nov 15, 2026
a9fe7ac
CI: setup v0.3.1 (its release check of the embedded client survives s…
Nov 15, 2026
14e5599
Merge pull request #15 from kr4uzi/mac/setup-pin-030
kr4uzi Nov 15, 2026
9739d28
CI: pass secrets to the reusable build workflow
Nov 15, 2026
ce90739
Merge pull request #16 from kr4uzi/ci/release-secrets
kr4uzi Nov 15, 2026
250413c
Online services: retail GameSpy host names, +gamespy selects the domain
Nov 15, 2026
980ec3f
CI: release no macOS dedicated server packages
Nov 15, 2026
7697e06
GameSpy: 5-second connect limit for the server list, presence and HTTP
Nov 15, 2026
8dff5c0
GameServer: print the internet-backend failure text
Nov 15, 2026
360ec37
HTTPRequest: skip retail's hosts-file check of the stats host
Nov 15, 2026
2a2fda1
Package: say that a release macOS server is signed but not notarized
Nov 15, 2026
3d6555f
Online services: +gamespy only from the process command line
Nov 15, 2026
6795dd1
Add reconstruction-aware code review guidance
kr4uzi Nov 15, 2026
1b2b39d
Merge pull request #21 from kr4uzi/docs/codex-review-guidance
kr4uzi Nov 15, 2026
dfb7cb8
Merge pull request #19 from kr4uzi/ci/no-macos-server-release
kr4uzi Nov 15, 2026
c1375e1
Windows: ship the client for x64 only
Nov 15, 2026
824cd29
Archive the Novint Falcon integration
Nov 15, 2026
3c20d80
Windows: delay-load d3dx9_25.dll and report a missing D3DX runtime
Nov 15, 2026
dad524e
CI: list the Windows client and editor imports
Nov 15, 2026
6b1fbc1
Windows x64 client: bundle OpenAL Soft as BF2OpenAL.dll
Nov 15, 2026
a3753c5
Release: no Windows x64 dedicated server package
Nov 15, 2026
39fb8f5
Merge pull request #22 from kr4uzi/ci/no-macos-server-release
kr4uzi Nov 15, 2026
8f6ca59
Merge pull request #18 from kr4uzi/online/provider-override
kr4uzi Nov 15, 2026
078ad86
Windows: ship the x86 client again
Nov 15, 2026
e5a2a86
Windows x64 client: state that it has no PunkBuster support
Nov 15, 2026
133f2d2
CI: list the x86 client imports and the executables' manifests
Nov 15, 2026
88f003b
Windows x86 client: bundle OpenAL Soft as BF2OpenAL.dll too
Nov 15, 2026
dd0f834
macOS: BF2_HITCH_TRACE frame-hitch trace and the first-shots scenario
Nov 15, 2026
dfb0ec4
Effects: scan #include lines without std::regex
Nov 15, 2026
dd33977
Metal: compile shader libraries in the background when shaders are cr…
Nov 15, 2026
52c2a6b
Metal: give every shader the same compiled form, alone or in any batch
Nov 15, 2026
4478daa
Effect cache: keep the #include directives of a file for the process
Nov 15, 2026
258058d
Metal: skip a colour-only blended draw until its pipeline state is built
Nov 15, 2026
ddb39c6
Metal: keep two frames in flight instead of waiting for the GPU at Pr…
Nov 15, 2026
f5a5528
Windows client: read CD keys from a per-user DPAPI Registry.dat
Nov 15, 2026
3e58fed
Metal: clear the asynchronous failure latch at a successful Reset
Nov 15, 2026
3003dc8
Hitch trace: keep a present capture alive until its trace scope ends
Nov 15, 2026
ab7aacc
Reject malformed VoIP packets and exclude client voice from Linux def…
kr4uzi Nov 15, 2026
e16c157
Releases: one package per platform
Nov 15, 2026
02f3547
Refuse oversized data block announcements
Nov 15, 2026
3ffca3f
Guard a missing player in FireComp::requestFire and HudChat::addPlaye…
Nov 15, 2026
3643a3a
Animate the 3D water continuously
Nov 15, 2026
912dc00
Merge pull request #29 from kr4uzi/ci/one-package-per-platform
kr4uzi Nov 15, 2026
c15c217
Merge pull request #28 from kr4uzi/fix/review-26-voip-linux
kr4uzi Nov 15, 2026
aa35b23
Merge pull request #25 from kr4uzi/rend/shader-prebuild
kr4uzi Nov 15, 2026
fbc230c
Merge main into the Windows packaging branch
Nov 15, 2026
579e1c6
Merge pull request #24 from kr4uzi/win/x64-client-openal-falcon-archive
kr4uzi Nov 15, 2026
70641c2
Merge pull request #31 from kr4uzi/fix/upstream-review-items
kr4uzi Nov 15, 2026
af4151a
hud, FOV and water fix
kr4uzi Nov 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
440 changes: 434 additions & 6 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ concurrency:
jobs:
build:
uses: ./.github/workflows/build.yml
# A reusable workflow only receives the `release` environment's secrets when the caller
# passes secrets on; without this they resolve to empty strings.
secrets: inherit
52 changes: 38 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
jobs:
build:
uses: ./.github/workflows/build.yml
# A reusable workflow only receives the `release` environment's secrets when the caller
# passes secrets on; without this they resolve to empty strings.
secrets: inherit

upload:
name: Attach packages to the release
Expand All @@ -23,10 +26,12 @@ jobs:
permissions:
contents: write
steps:
- name: Download this run's packages
# Only the release-* artifacts: one package per platform. The per-role and per-architecture
# packages-* artifacts stay CI artifacts (docs/ci-releases.md).
- name: Download this run's release packages
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: packages-*
pattern: release-*
path: packages
merge-multiple: true

Expand All @@ -38,18 +43,37 @@ jobs:
working-directory: packages
shell: bash
run: |
packages=(
openbf2-windows-x86-server-diagnostic
openbf2-windows-x86-client-diagnostic
openbf2-windows-x86-editor-diagnostic
openbf2-windows-x64-server
openbf2-linux-x64-server
)
# Both Windows clients bundle OpenAL Soft (LGPL): the release carries the exact source.
shopt -s nullglob
sources=(openal-soft-*.tar.bz2)
shopt -u nullglob
test "${#sources[@]}" -eq 1
files=(openbf2-macos.dmg openbf2-windows.zip openbf2-linux.zip "${sources[0]}")
assets=()
for package in "${packages[@]}"; do
test -s "$package.zip"
test -s "$package.zip.sha256"
sha256sum --check "$package.zip.sha256"
assets+=("$package.zip" "$package.zip.sha256")
for file in "${files[@]}"; do
test -s "$file"
test -s "$file.sha256"
sha256sum --check "$file.sha256"
assets+=("$file" "$file.sha256")
done
# Exactly these assets: nothing else may reach the release page.
expected=$(printf '%s\n' "${assets[@]}" | sort)
actual=$(ls -A | sort)
if [ "$expected" != "$actual" ]; then
echo "::error title=Unexpected release files::expected only: ${assets[*]}"
diff <(echo "$expected") <(echo "$actual") || true
exit 1
fi
# build.yml fails release runs without D3DX; check the archive itself as well.
python3 - <<'EOF'
import json
import zipfile

with zipfile.ZipFile("openbf2-windows.zip") as archive:
names = set(archive.namelist())
info = json.loads(archive.read("openbf2-windows/build-info.json"))
for entry in ("x64/BF2.exe", "x86/BF2.exe", "server/bf2_w32ded.exe", "editor/BF2Editor.exe"):
assert "openbf2-windows/" + entry in names, "openbf2-windows.zip lacks " + entry
assert not info.get("omitted"), "openbf2-windows.zip omits " + ", ".join(info["omitted"])
EOF
gh release upload --repo "$GH_REPO" --clobber -- "$RELEASE_TAG" "${assets[@]}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ compile_commands.json
!/Code/Build/bf2audio_diff/
!/Code/Build/bf2audio_smoke/
!/Code/Build/textureatlas_diff/
!/Code/Build/macos/
!/Code/Build/bin/
/Code/Build/bin/**
!/Code/Build/bin/README.md
Expand Down
4 changes: 2 additions & 2 deletions .run/bf2_client (game dir).run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="bf2_client (game dir)" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="+modPath mods/bf2 +fullscreen 0 +multi 1" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$PROJECT_DIR$/../../B2BF Launcher/Battlefield2" PASS_PARENT_ENVS_2="true" PROJECT_NAME="OpenBF2PrivateDevTools" TARGET_NAME="bf2_client" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="OpenBF2PrivateDevTools" RUN_TARGET_NAME="bf2_client">
<configuration default="false" name="bf2_client (game dir)" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="+modPath mods/bf2 +fullscreen 0 +multi 1" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$PROJECT_DIR$/../../B2BF Launcher/Battlefield2" PASS_PARENT_ENVS_2="true" PROJECT_NAME="BF2Rebuilt" TARGET_NAME="bf2_client" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="BF2Rebuilt" RUN_TARGET_NAME="bf2_client">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
</component>
62 changes: 60 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ This is the canonical policy for every coding agent working in this repository.
instruction files must import or point here instead of copying these rules. If guidance conflicts,
the user's current request wins, followed by this file, then the subsystem documentation.

## Code Review Rules

For code review and regression investigation, also read [docs/reviewing.md](docs/reviewing.md).
This file remains the canonical policy. Review alone does not authorize source changes;
explicit user authorization to implement fixes still applies.

- **Report concrete regressions.** Review the PR diff and affected callers for memory/lifetime
errors, initialization and teardown failures, malformed-input handling, and broken builds.
Explain the reachable trigger and consequence; distinguish pre-existing defects from changes
introduced by the PR. Legacy style, raw pointers, lack of Asio, and opportunities to adopt
newer C++ are not defects by themselves.
- **Preserve the applicable compatibility contract.** Check ABI, protocols, serialized data,
and reconstructed behavior for each affected image and architecture. Respect the documented,
issue-backed native ABI and editor exceptions; do not restore retired compatibility adapters
or infer unknown signatures and layouts. State missing binary evidence and continue checks
that do not depend on it.
- **Account for parallel upstream work.** Where accessible, inspect relevant B2BF/OpenBF2 PRs
and branches at their current SHAs. Identify semantic conflicts and existing fixes with
evidence; upstream code is not automatically proof of correctness. State unavailable context
and continue the scoped review instead of assuming that another branch was checked.

## Agent prerequisites and human ownership

- Before implementing behavior as recovered engine code, the agent must have **IDA or Ghidra
Expand Down Expand Up @@ -150,6 +171,42 @@ Use the repository's evidence vocabulary consistently:
frontiers because `BF2Log` may not be initialized yet. If the signature/ABI is not known well
enough to define a safe callable body, keep the symbol declaration-only and document the caller
boundary instead of inventing a signature merely to add logging.
**Unimplemented-slot exception (owner decision 2026-11-02, libaidll reconstruction):** a
virtual slot that is `__cxa_pure_virtual` in every vtable of every class that has it, in
every inspected image, has no body anywhere. Reaching it in retail aborts with "pure virtual method
called". The same applies to a class member that no instruction reads or writes. Its name and
source-level type cannot be recovered, but its behaviour is fully determined.
- Such a slot or member may be declared with a `[CHOSEN, not recovered]` name, so that the
surrounding recovered code can be completed.
- The declaration must reproduce what the instructions prove:
- the slot position in both ELF vtables;
- the receiver and argument registers or stack slots each call site prepares;
- whether any caller reads a result (if none does, declare `void`; if a caller tests `eax`/`al`,
declare the narrowest integer type the test proves);
- for a member, the size and alignment implied by the neighbouring offsets in each image.
- Keep the slot pure (`= 0`); never give it a body. Every call site stays exactly as the listing
shows.
- Cite the vtable addresses and call-site addresses beside the declaration.

This covers only slots and members with no body and no access. A slot that has an override
anywhere, or a member that is accessed anywhere, keeps the ordinary evidence rules. The matching
build (`MATCHING_BUILD_PLAN.md`) re-checks every such declaration at its call sites.

**Unobservable-type exception (owner decision 2026-11-05, RendDX9 reconstruction):** a body may be
recovered with a `[CHOSEN, not recovered]` type or name when all of the following hold:
- no inspected image (retail PE, `_r`, editor, Linux ELF) has a caller that reaches it, or every
reachable path only ever sees empty data, so its behaviour is fully determined;
- the instructions of every image have been read and the body reproduces everything they prove
(reads, writes, offsets, call order, slot dispatch, return register);
- only a name or a type that no instruction can expose is missing. Examples: the element type of a
container that is never filled, or the name of a property pair that nothing calls.

Mark each chosen piece `[CHOSEN, not recovered]` beside it, with the evidence (addresses in every
image, and why the choice cannot be observed). Prefer the choice the instructions point to, such as
float for an `st0` return. This replaces a [FRONTIER] stop only in that situation; a body that any
path reaches with real data keeps the ordinary evidence rules. First applied to: LightManager +0xBC/+0xC0
(PE 0x1015C130/0x1015C140), GeometryTemplateManager +0x2C/+0x30 (PE 0x1015D940/0x1015D430) and
ObjectDrawer::flushDeferredGeometry (PE 0x100F8C00).
- Test fixtures belong under `Code/Tests`, must be labeled as scaffolding, and may
only model the specific condition the test needs.
- When a production implementation lands, remove any Probe/harness override that would shadow it.
Expand Down Expand Up @@ -191,8 +248,9 @@ Use the repository's evidence vocabulary consistently:
sound it would have driven; each call site keeps its own hit count and is rate-limited, never
silenced; NO value is fabricated, because every shipped call site discards the result, so
continuing returns nothing at all; and the surrounding body is written as far as the evidence
honestly reaches, so the seam covers only the sound call. The shared implementation and the full
rule live in `Code/BF2/Core/SoundSeamFrontier.h`; it reports to stderr only, deliberately, because
honestly reaches, so the seam covers only the sound call. No sound seam remains (the shared
helper `Core/SoundSeamFrontier.h` was removed with its last caller); a future sound seam re-adds
that helper with this rule. It reports to stderr only, deliberately, because
`Debug(DebugTypeError, ...)` aborts in this tree and `BF2Log` is not guaranteed to be up on the
HUD paths that reach these seams. The cost is real and is the point: a sound retail would start or
stop keeps doing whatever it was doing. This exception covers sound seams ONLY - every other
Expand Down
Loading