Skip to content

Development Safety and Troubleshooting

buntatoes edited this page Nov 28, 2026 · 1 revision

Development, Safety, and Troubleshooting

Anti-Cheat Safety and Privacy

VAC & Anti-Cheat Safety

RubyLock RPC is designed to be completely non-invasive and VAC-safe:

Technique Used by RubyLock RPC? Details
Read Deadlock's -condebug console text log (game/citadel/console.log) Yes (read-only) Uses standard Source 2 -condebug file logging supported natively by Valve engines.
Enumerate OS process names (deadlock.exe) Yes (read-only) Uses CreateToolhelp32Snapshot on Windows and /proc/<pid>/comm + cmdline on Linux — never opens a handle to the Deadlock process itself (OpenProcess is never called).
Process memory reading (ReadProcessMemory / process_vm_readv) No Never reads or inspects Deadlock process memory.
DLL injection / hooking / overlay rendering No Zero code injection or graphics hooks.
Game file modification No Never writes to or patches any files inside the Deadlock installation.
Network packet capture / MITM No Never intercepts Steam or Deadlock game server traffic.

Privacy Guarantees

  • No Personal Discord IDs Stored: Connects directly to whichever local Discord client is running on your machine over local IPC. The built-in DEFAULT_DISCORD_APP_ID (1566683259763429509) is a public Discord Application ID, not a personal user ID.
  • Opt-In Statlocker Button: presence.show_statlocker_button defaults to false. Even when your Steam3 account ID ([U:1:<id>]) is parsed locally from console.log to track Hideout party events, no external Statlocker link is published to Discord unless you explicitly enable show_statlocker_button = true.
  • Minimal, Transparent Outbound Network Traffic:
    1. https://api.deadlock-api.com/v1/assets/heroes/by-name/<hero> — fetches public hero display names, Hideout flavor text, and portrait image URLs (only when show_hero_image = true and a hero is active).
    2. https://api.github.com/repos/buntatoes/rubylock-rpc/releases/latest (and GitHub release download hosts in TRUSTED_HOSTS) — checks for updates on startup unless --no-update-check is passed.
    3. No analytics, telemetry, crash reporting servers, or third-party tracking endpoints exist anywhere in the codebase.

Development, Testing, and Packaging

Development Prerequisites

  • Ruby 3.2+ (CI runs Ruby 3.4 on both ubuntu-latest and windows-latest). Zero external gems required.
  • Optional C toolchain for building native release packages (scripts/package.rb):
    • Windows native: MSYS2 / RubyInstaller UCRT64 gcc.exe + windres.exe.
    • Linux building Linux bundle: gcc (builds the native ELF wrapper rubylock-rpc; if absent, the .tar.gz still builds and falls back to bin/rubylock-rpc).
    • Linux cross-compiling Windows .exe: x86_64-w64-mingw32-gcc + x86_64-w64-mingw32-windres.

Syntax Checks & Unit Tests

# 1. Verify Ruby syntax across all source, packaging, and test files
ruby -c bin/rubylock-rpc lib/rubylock_rpc.rb lib/rubylock_rpc/*.rb rubylock-rpc.gemspec scripts/package.rb test/test_rubylock_rpc.rb

# 2. Run the Minitest suite directly
ruby -Ilib:test test/test_rubylock_rpc.rb

# Or via Rake (enables Ruby warnings)
rake test

The Minitest suite (test/test_rubylock_rpc.rb) validates:

  • Custom Toml.parse / Toml.dump round-tripping on DEFAULT_TOML.
  • ConfigManager schema migration (v4 -> v6), custom discord_app_id, empty corner_image, and {var} template substitution.
  • Hero key normalization (_v2 stripping, hero_ prefixing) and HeroCache.static_fallback.
  • Full LogWatcher + GameState state machine replay (Hideout, hero loading, account ID, party count, queue start/stop, dl_midtown 12-player Standard Match inference, hero lock-in, monotonic timer formatting, Post Match).
  • DiscordIpcClient.build_activity_payload (hero assets, corner badge suppression, Statlocker button).
  • Native ProcessWatcher.process_running? self-detection without spawning subprocesses.
  • Updater semver comparison, platform asset selection, TRUSTED_HOSTS validation, and path-traversal-blocking extract_tar_gz.
  • Tray::DbusWire binary encode/decode round-trip of a DBusMenu GetLayout response.

Continuous Integration (.github/workflows/ci.yml)

GitHub Actions runs on pushes and pull requests to main across ubuntu-latest and windows-latest with Ruby 3.4:

  1. ruby -c syntax verification across all Ruby files.
  2. ruby -Ilib:test test/test_rubylock_rpc.rb.
  3. ruby scripts/package.rb package build verification.

Building Distributable Packages (scripts/package.rb)

# Build all available targets for the current host
ruby scripts/package.rb

# Build only the Windows installer: dist/RubyLock-RPC-Setup-v1.3.0-win64.exe
ruby scripts/package.rb --exe

# Build only the Linux release archive: dist/rubylock-rpc-linux-x86_64.tar.gz
ruby scripts/package.rb --linux

Windows Installer Build Pipeline

  1. Compiles assets/icon.ico into a COFF resource (windres) and builds rubylock-rpc.exe from packaging/host/rubylock_rpc_host.c (-O2 -Wall -Wextra -s -static-libgcc -mwindows with -ffile-prefix-map).
  2. Packs rubylock-rpc.exe, LICENSE, README.md, bin/rubylock-rpc, assets/icon.{ico,png}, and all lib/**/*.rb files into a binary RLPC payload ("RLPC" magic + uint32 file count + per-file [path_len, data_len] + UTF-8 relative path + raw bytes).
  3. Embeds the icon (1 ICON) and RLPC payload (101 RCDATA) into packaging/windows/installer.c, linking -lole32 -lshell32 -luuid -ladvapi32 to produce dist/RubyLock-RPC-Setup-v1.3.0-win64.exe.

Linux Release Tarball Pipeline

  1. If gcc is present on Linux, compiles packaging/host/rubylock_rpc_host.c into a stripped native ELF wrapper (rubylock-rpc) with -ffile-prefix-map.
  2. Normalizes line endings (\r\n -> \n) for .rb, .sh, .desktop, and bin/rubylock-rpc.
  3. Writes dist/rubylock-rpc-linux-x86_64.tar.gz using Ruby's built-in Zlib::GzipWriter and Gem::Package::TarWriter.

Troubleshooting & FAQ

Rich Presence stays on "Waiting for Deadlock" or never updates

  1. Verify -condebug is active: Deadlock only writes game/citadel/console.log when launched with -condebug. Launch through the RubyLock RPC shortcut, use rubylock-rpc --launch-with-command -- %command% in Steam Launch Options, or add -condebug to Deadlock's Steam Launch Options manually.
  2. Check the monitored log path: Open <data_dir>/logs/rubylock-rpc.log (via tray -> Open Config Folder) and look for [rubylock-rpc] Monitoring: .... If Deadlock is installed in a custom library not listed in libraryfolders.vdf, set game_folder under [general] in config.toml to the directory containing game/citadel.

[discord] Connect failed... Retrying in 10s...

  • Make sure the desktop Discord app is running (Discord web in a browser does not expose local IPC sockets/pipes).
  • Linux Flatpak / Snap / Vesktop: RubyLock RPC automatically scans $XDG_RUNTIME_DIR, $TMPDIR, $TMP, $TEMP, and /tmp for native, app/com.discordapp.Discord, app/dev.vencord.Vesktop, and snap.discord sockets (discord-ipc-0..9). If Discord runs in a sandboxed Flatpak, verify it is exporting its runtime IPC socket under $XDG_RUNTIME_DIR.
  • Check that Discord's Settings -> Activity Privacy -> Share your detected activities with others is enabled.

No system tray icon appears on Linux (GNOME)

GNOME Shell does not display StatusNotifierItem icons by default. Install and enable the AppIndicator and KStatusNotifierItem Support GNOME Shell extension (included by default on Ubuntu and Pop!_OS). On headless or non-D-Bus sessions, RubyLock RPC logs [tray] No Linux D-Bus session bus detected and continues running normally without a tray icon.

Windows shows "Ruby 3.2+ was not found on PATH or C:\Ruby*-x64"

rubylock-rpc.exe looks for rubyw.exe / ruby.exe in <install_dir>\ruby\bin\, your system PATH, and C:\Ruby*-x64\bin\. Install Ruby 3.2+ (x64) from RubyInstaller and re-run the shortcut.

Windows Defender SmartScreen blocks RubyLock-RPC-Setup-v1.3.0-win64.exe

The prebuilt Windows installer is not signed with a commercial Authenticode certificate. Click More info -> Run anyway, or inspect the source code and build the installer locally with ruby scripts/package.rb --exe.

How do I keep RubyLock RPC running after closing Deadlock?

Either right-click/click the system tray icon and uncheck Exit When Game Closes, or set exit_when_game_closes = false in config.toml. When Deadlock closes, RubyLock RPC clears your Discord activity and waits cleanly for the next Deadlock session.

Where are logs and config.toml stored?

Click Open Config Folder in the system tray menu, or check:

  • Windows installer: %LOCALAPPDATA%\RubyLock-RPC\ (config.toml and logs\rubylock-rpc.log)
  • Linux installer: $HOME/.local/share/rubylock-rpc/ (or $XDG_CONFIG_HOME/rubylock-rpc/ if the app directory is read-only)

License & Attribution

  • Author: Buntato (buntatoes.dev)
  • License: GNU General Public License v3.0 (GPL-3.0)
  • Upstream Attribution: RubyLock RPC is a pure-Ruby reimplementation based on the original GPL-3.0 Rust project HeyTariq/deadlock-rpc.
  • Disclaimer: Not affiliated with, endorsed by, or connected to Valve Corporation. Deadlock, all hero names, images, and related assets are the property of Valve Corporation. Hero images displayed in Discord are sourced from the community-maintained Deadlock API and remain the property of Valve.

Clone this wiki locally