Companion is a Steam client module that makes IW4x appear under its own name in your friends' game activity, without requiring the Steamworks publishing permissions normally needed to change how a game is displayed on Steam.
For details on how Companion works, including the protocol between the
game and Companion, see Companion manual (libcompanion/doc/manual.cli).
On Windows the game comes with companion and loads it into the Steam
client. On Linux the Steam client is started with the companion program
from the linux/ subdirectory of the IW4x installation. To build and install
companion from source, see companion/README.md.
The development setup uses the standard bdep-based workflow and needs a
C++26 compiler. On Linux, with GCC 16 or later:
git clone https://github.com/iw4x/companion.git
cd companion
bdep init -C @gcc cc config.cxx=g++ --create-host-config
bdep update
bdep test
The man page (companion/companion/companion.cli) and the manual
(libcompanion/doc/manual.cli) are generated by
CLI. In this setup bdep builds
cli in the host configuration that --create-host-config creates.
Consumers of the package build from the generated copies that its
distribution carries and don't need cli.
The Linux module is built for i386. Add an i386 configuration, which needs
the 32-bit glibc and libstdc++ development files (glibc-devel.i686 and
libstdc++-devel.i686 on Fedora, for example):
bdep init -C @gcc32 cc config.cxx="g++ -m32" \
config.cxx.target=i686-linux-gnu \
config.c="gcc -m32" \
config.c.target=i686-linux-gnu
bdep update @gcc32
bdep test @gcc32
GCC only reports the i386 target that -m32 selects if it is built with
multiarch support (Debian, Ubuntu), which is why the configuration specifies
the target explicitly.
The companion program links the C++ runtime statically, which needs the
static libstdc++ for each configuration (libstdc++-static.x86_64 and
libstdc++-static.i686 on Fedora, for example).
The Steam client only loads the Linux module at startup. The steam-restart
script installs the module from the @gcc32 and @gcc configurations,
restarts the Steam client with the companion program, and prints the
diagnostics:
libcompanion/etc/private/steam-restart \
--install ../companion-gcc32 \
--install ../companion-gcc
companion is also built and tested for Windows. From Linux, add a MinGW-w64
GCC configuration that runs the tests under Wine. Wine has to find the MinGW
runtime DLLs, so the test runner adds their directory to WINEPATH (here, as
on Fedora):
bdep init -C @mingw cc config.cxx=x86_64-w64-mingw32-g++ \
config.test.runner="env WINEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/bin wine"
bdep update @mingw
bdep test @mingw
On Windows, with MinGW-w64 GCC from MSYS2 in
PATH:
git clone https://github.com/iw4x/companion.git
cd companion
bdep init -C @mingw cc config.cxx=g++ --create-host-config
bdep update
bdep test
In PowerShell, a leading @ has a special meaning (splatting), so write the
configuration name as -@mingw, which bdep also accepts:
bdep init -C -@mingw cc config.cxx=g++ --create-host-config
See CONTRIBUTING.
companion is licensed under the GNU General Public License, version 3, with
the additional permissions of version 1.1 of the IW4x Linking Exception.
MinHook, vendored under libcompanion/libcompanion/minhook/, is licensed
under the BSD 2-Clause License.
See LICENSE, LICENSE-EXCEPTION, LEGAL, and AUTHORS.
