Repository navigation
feat(bfeserver): add Battlefront Eternal server - #5116
Merged
Merged
Conversation
Battlefront Eternal is a GPL-3.0 engine for STAR WARS Battlefront (Classic, 2004) with a native headless Linux server that runs on Node.js. - SteamCMD downloads the retail game (appid 1058020, Windows depot) with an owning steamuser. The server prepares its game data from that copy. - update_bfe.sh downloads the signed release .deb from get.battlefronteternal.com, checks its SHA256, and extracts only the server runtime, preparation tools and Python toolchain from it with ar and tar, so it works on every distro. - Node.js 24 is installed into serverfiles/node from nodejs.org with its published SHA256, as no supported distro ships Node 22.13 or later. - Game data is prepared with the release's own tools/prepare.py --core-only into serverfiles/bfe-data, and only prepared again when the release's tools or toolchain change. - config.json lives in serverfiles/bfe-state (BFE_STATE_DIR), together with the server identity, operator token and stats database. - update and check-update follow Battlefront Eternal releases. validate re-downloads the retail game. - stopmode 2 (the server shuts down on SIGINT), querymode 5 (TCP, the HTTP /info listener on the game port).
check_executable.sh looks for the executable directly in executabledir, so executabledir is node/bin and the server script path is absolute.
Node names its main thread MainThread, which is what ss shows.
Battlefront Eternal now publishes battlefront-eternal-server_<version>_linux-<arch>.tar.xz beside the .deb, listed in SHA256SUMS. It holds host-runtime, tools, toolchain and bfe-tree.json at its root, so it extracts with the standard fn_dl_extract and no longer needs ar or the package's internal paths. About half the download size.
The Battlefront Eternal server runs on Node.js and never loads steamclient.so; SteamCMD only downloads the retail game data. On a fresh container SteamCMD is not installed yet at start, so both links failed with Could not copy any steamclient.so. The libtinfo fix for SteamCMD still runs.
The sdk32 and sdk64 steps now look for SteamCMD's steamclient.so first and create the link only when one exists. Before SteamCMD has ever run there is nothing to link, and the next start after it runs creates the link. This replaces the bfe shortname check: servers updated outside SteamCMD, such as Battlefront Eternal, reach start on a fresh install before SteamCMD exists and printed Could not copy any steamclient.so.
Node was only checked when a new Battlefront Eternal release was applied, so Node fixes waited for the next release. update and check-update now check Node on every run and apply a Node-only update through fn_update_apply. The new Node is extracted into node.new and swapped in only after it extracts, so a failed download or extract keeps the old runtime.
3 tasks done
3 tasks done
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.
Description
Adds Battlefront Eternal as a new server:
bfeserver, shortnamebfe. Battlefront Eternal is a GPL-3.0 engine for STAR WARS Battlefront (Classic, 2004), with a native headless Linux dedicated server that runs on Node.js. It is a new project and still in development preview, so expect its releases to change often.Fixes #5112
Affected servers: bfe
Needs GameServerManagers/Game-Server-Configs#164 (the default
config.json) merged first. Install downloads that file, and the Details Check job fetches it.How it works
appidis 1058020 withsteamcmdforcewindows="yes"(the app only has a Windows depot), andsteamusermust own the game, as with Running With Rifles. The ~2.8 GB game lands inserverfiles(GameData/). Nothing from the game is redistributed.update_bfe.sh):SHA256SUMSfromhttps://get.battlefronteternal.com/downloads/latest, the project's release feed, and picks the server-only archive for the machine (battlefront-eternal-server_<version>_linux-<amd64|arm64>.tar.xz, published since preview 327 at our request). The version comes from the file name (0.1.0~preview.327today) and is stored inlgsm/data/<instance>-bfe-versionforcheck-updateandupdate.force-updateworks becauseappidis set.serverfiles/bfewithfn_dl_extract:host-runtime/(engine and server),tools/,toolchain/(a bundled Python),bfe-tree.jsonandlegal/. The desktop client is not downloaded.serverfiles/nodefrom nodejs.org, checked against its published SHA256. The server needs Node 22.13 or later, which no supported distro ships (Debian 13 has 20).updateandcheck-updatecheck for a newer 24.x on every run, not only when a new release is out, so Node fixes land without waiting for a release. A Node-only update stops and starts the server like any update and sends the update alert. The new Node is extracted intonode.newand only replacesnodeonce it extracts, so a failed download or extract leaves the old one in place.tools/prepare.py --core-onlyintoserverfiles/bfe-data(about 2.2 GB, a few minutes). It is only prepared again when the release's tools or toolchain change: the key is a hash of their entries inbfe-tree.json, the same inputs the project's own updater uses. Preparation runs intobfe-data.newand replaces the old data only on success, and its log islog/script/<instance>-prepare.log.updateandcheck-updatefollow Battlefront Eternal releases.validatechecks the retail game and leaves the server files alone.config.jsoncomes from Game-Server-Configs#164 and lives inserverfiles/bfe-state, the server's state directory (BFE_STATE_DIR), which also holds its identity key, operator token and stats database. New servers do not accept the project's online notice, so they are LAN or direct-connect only until the operator sets"onlineNoticeAccepted": trueto list publicly.detailsreads the server name, max players, game port and LAN discovery port from it.executabledirisserverfiles/node/binandexecutableis./node.preexecutablesetsBFE_STATE_DIR,BFE_ENGINE_DIR,BFE_DATA_DIRandPORTwithenv, then node runsbfe/host-runtime/server/src/main.js --serve. A newhealthportsetting (default 18450) is the server's loopback health and admin port, so more than one instance can run on a machine./infoon TCP 18451, and LAN discovery on UDP 18452. gamedig has no protocol for this game, so monitor uses querymode 5 (TCP) on the game port. The port diagnostic command greps forMainThread, the name Node's main thread shows inss.fix_steamcmd.sh): the sdk32 and sdk64 link steps now create the link only when SteamCMD'ssteamclient.soexists, and otherwise skip quietly. Battlefront Eternal updates from its own feed, so on a fresh install it reachesstartbefore SteamCMD has ever run, and the old code printed "Could not copy any steamclient.so" twice. Steam games are unchanged: their SteamCMD files exist by the time they start, and the link is created as before.Type of change
Testing
./linuxgsm.sh bfeserverandauto-installfrom this branch, with a Steam account that owns the game. SteamCMD installed app 1058020, Node v24.22.2 and release 0.1.0~preview.323 were downloaded and passed their SHA256 checks, and the game data was prepared with no failed steps. Theconfig.jsondownload returns 404 until Game-Server-Configs#164 merges, so for the test that file was put in place by hand.start: the server came up with/healthzreportingrunningandmultiplayerReady: true, and/infoanswering on TCP 18451.ssshows UDP 18451 and 18452 on IPv4 and IPv6, TCP 18451, and TCP 18450 on loopback.details: server name, max players and all three ports read fromconfig.json, each listed as listening.monitor: TCP query on 18451 OK.check-update: "No update available" (0.1.0~preview.323 on both sides).force-updatewhile running: stopped the server (graceful CTRL+c in 2 s), downloaded and extracted the release, kept Node and the prepared game data, and started the server again.check-updatereported the release current and Node v24.0.0 to v24.22.2 available.updatedownloaded v24.22.2, passed its SHA256 check, replacednode, cleared tmp and sent the update alert. Runningupdateagain reported no Node.js update.force-updatewith the stored data key changed: prepared the game data again and wrote the new key.updatefrom 0.1.0~preview.326 to preview.327 on a running server stopped it gracefully, downloaded and verified the archive, extracted it, kept the prepared game data (the data key is unchanged, as the archive carries the samebfe-tree.json), and started the server again./infoanswered from outside the host afterwards.steamclient.soabsent,restartprinted no steamclient lines and no FAIL. With it present,restartcreated both links (hardlink count 2). A furtherrestartwith the links in place did nothing.validate: Steam validated app 1058020, and thebfe,bfe-data,bfe-stateandnodefolders were untouched.stop: graceful CTRL+c, no server process left.serverlist-validate.shandserverlist-validate-game-icons.shpass. shellcheck is clean on the new and changed modules.onlineNoticeAccepted).gameservermanagers/linuxgsm:ubuntu-26.04container on a test server.Risk and rollback
bfebranches in shared modules, apart from the steamclient.so step infix_steamcmd.sh, which now skips instead of printing a failure when there is nothing to link.Breaking changes
Documentation
A Battlefront Eternal game server page (game ownership, game data preparation, the online notice) is still to be written.
Checklist
PR will not be merged until all steps are complete.
Thank you for your Pull Request!