Skip to content

Kataiser/tf2-rich-presence

Repository files navigation

Github all releases GitHub release GitHub Release Date Platform: Windows Kataiser on Steam Ko-fi

GitHub commits since latest release GitHub last commit Updates Codacy Badge Github Actions build Coverage

TF2 Rich Presence

Discord Rich Presence for Team Fortress 2

  • Detects current game state, queue info, playtime, and more
  • Configurable, reliable, and performance-efficient
  • Version 2 (GUI, map images, and more): out now!

Preview image

GUI preview image

Download and install

Installer: TF2RichPresence_v2.1.11_setup (18.8 MB)
Alternatively, get the latest autobuild (may be untested/buggy): TF2RichPresence_v2.1.11_setup
Note that having Python installed is not required. Requires Discord and Steam to be running as well, and will wait until the game and both programs are running.

Changelogs

Linux and MacOS support?

At the moment, both are considered unsupported. They probably work since Jan200101 did some work on Linux a while ago, but the release builds are formatted for Windows. Contributors are very welcome! Also check out cyclowns/tf2-discord, which is confirmed to work on both Windows and Linux, or EmeraldSnorlax/TF2-RPC, which is a much less mature program but is built on Linux and theoretically cross-platform too. Alternatively, following most or all of the "building from source" instructions might work, or possibly running python resources/launcher.py in a --nocython build.

VAC safe?

Almost certainly. If you don't want to risk it then fair enough, but I've run this on my main account for years and feel comfortable with it. The game's runtime and memory are never touched in any way to read its state. For transparency, here's the complete list of external files that are read from and/or written to: \tf\console.log, \tf\cfg\*class*.cfg and steam_appid.txt in TF2's install, and \userdata\*id*\config\localconfig.vdf and \steamapps\libraryfolders.vdf in Steam's. The game process is also queried for its start time and install path, and the server you're playing on is queried for player count, server name, or kill counts. RCON is not used.

Building from source

For making and testing changes, or simply always running the most up-to-date code.

  1. Either clone the repo or download the source.
  2. Copy the entire source to another location (sorry) and put the files outside of TF2 Rich Presence into that folder.
  3. Make sure the python and pip commands point to Python 3.9.x (future versions should work too).
  4. Install a C compiler (see Installing Cython). I personally use MinGW, but it's a pain on Windows. Alternatively, use the --nocython flag when building to disable compiling.
  5. From within TF2 Rich Presence, run pip install -r requirements.txt.
  6. Either run python build.py to compile and build, or python launcher.py to launch in debug mode.

Version 2 goals

  • A GUI (Done, ended up using discoIPC still)
    • I'm fairly confident I know how to implement this (it's a bit of work though)
    • Would require doing RPC with pypresence due to a bug in discoIPC
    • Would also have the benefit of not requiring two (slow) Python interpreter launches
    • This is the only criteria I'll require for release v2.0, any of the others could be in later versions
  • Run as a service (Abandoned because "launch TF2" button OP)
  • Map-specific images, instead of gamemodes (Done, also Discord increased the limit to 300)
    • Would cause all sorts of problems, including removing the class icon style option
    • Discord art asset limit is 150, the rest of the program uses 47, and there are 118 vanilla maps in the game
    • So won't be able to get every map, can just limit to the most popular though
  • A proper installer (Done with Inno Setup, no autoupdater though)
    • Also maybe store DB.json and settings in AppData\Roaming
    • Make a Chocolatey package as well, ideally would need to fix antivirus detection
    • Possibly include an autoupdater, either Squirrel or rolling my own