Skip to content

refactor steam integration#1623

Open
cebarks wants to merge 42 commits intoRimSort:mainfrom
cebarks:steamworks-interface-singleton
Open

refactor steam integration#1623
cebarks wants to merge 42 commits intoRimSort:mainfrom
cebarks:steamworks-interface-singleton

Conversation

@cebarks
Copy link
Copy Markdown
Collaborator

@cebarks cebarks commented Dec 21, 2025

This refactors the steamworks integration heavily:

  • replaces multiprocessing steamworks api calls with a QT thread implementation
    • allows for the reuse of the SteamworksInterface instance across all usecases
    • simplifies control flow and removes the need for chunking and IPC.
    • allows for async queuing of steamworks operations so the UI doesn't block for it to return.
  • query steamworks api for mod installation/update timestamp instead of parsing possibly stale ACF data
  • refactor entire download workflow. There is now a single queue (viewed via the new downloads tab)
    • mod downloads/updates are now triggered using the steamworks DownloadItem() call instead of unsubscribing and resubscribing which is much more consistent. (also fixes
    • mod download status are now tracked via callbacks and polling mod status instead of watching and parsing .acf files

This fixes:

Additional misc changes:

Disclaimer: Claude Code was used to generate SOME of the code. HOWEVER, all changes and implementations were reviewed and double checked by an experienced human for accuracy.

@cebarks cebarks marked this pull request as draft December 21, 2025 02:16
@LionelColaso
Copy link
Copy Markdown
Member

#1460 and #1587 are the only 2 big bugs which are related and fixing them would really be of great help
Thanks

@cebarks
Copy link
Copy Markdown
Collaborator Author

cebarks commented Dec 21, 2025

I haven't been able to reproduce #1460 locally. Maybe if @Skydea777 or @JinJanODWan can confirm that this PR fixes it? If not it might be best to address #1460 in a follow u PR.

@cebarks cebarks force-pushed the steamworks-interface-singleton branch 2 times, most recently from 252a233 to a0182bf Compare December 21, 2025 06:16
@LionelColaso LionelColaso added bugs 🪲 bugs and errors, something is not working as intended feature/improvement 🆕 Use this label to mark new feature or improvement requests Code refactoring 🧹 improving the structure and organization of the code; restructuring, cleaning up accessibility 👀 ℹ️🤓 user-friendly optimization, like notifications, warnings and action alerts submodules Pull requests that update Submodules code labels Dec 21, 2025
@cebarks cebarks marked this pull request as ready for review December 21, 2025 09:08
@cebarks cebarks requested a review from LionelColaso December 21, 2025 09:16
@cebarks cebarks self-assigned this Dec 21, 2025
@cebarks cebarks marked this pull request as draft December 22, 2025 00:56
@cebarks
Copy link
Copy Markdown
Collaborator Author

cebarks commented Dec 22, 2025

I want to at least look into the following things before marking this ready to merge:

@cebarks
Copy link
Copy Markdown
Collaborator Author

cebarks commented Dec 25, 2025

I've resubmitted philippj/SteamworksPy/pull/91 as philippj/SteamworksPy/pull/114

@cebarks cebarks force-pushed the steamworks-interface-singleton branch from ada489d to 17614f7 Compare December 26, 2025 04:01
@github-actions github-actions Bot added the Linux🐧 Linux-specific issues label Dec 26, 2025
@cebarks cebarks added the third party 📲 Anything related to 3rd party software used in the app label Dec 26, 2025
@cebarks cebarks marked this pull request as ready for review December 27, 2025 02:26
@cebarks
Copy link
Copy Markdown
Collaborator Author

cebarks commented Dec 27, 2025

This currently uses my branch of steamworkspy until philippj/SteamworksPy#116 is merged, at which point we can swap over.

@github-actions github-actions Bot added Windows 🪟 Windows-specific issues macOS 🍏 macOS-specific issues labels Dec 27, 2025
cebarks and others added 5 commits December 26, 2025 23:32
… detection

Enhances the Steam Workshop mod update detection system with comprehensive
diagnostic logging and improved error handling.

Changes:
- Add detailed timestamp comparison logging in filter_eligible_mods_for_update()
  showing human-readable dates, deltas, and timestamp sources
- Add timestamp fallback to internal_time_updated when internal_time_touched unavailable
- Enhance refresh_workshop_timestamps_via_steamworks() with detailed logging
  and statistics return value (total_mods, updated, failed, steam_unavailable)
- Add user feedback dialog when Steam client unavailable explaining potential
  false positives from stale ACF timestamps
- Add comprehensive test coverage for update detection edge cases

The improved logging makes it easy to diagnose update detection issues by
showing exact timestamp values and comparisons. The fallback logic and better
error handling improve robustness when Steam is unavailable.

Tested with 723 Workshop mods - successfully refreshed all timestamps via
Steamworks API with no false positives.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cebarks cebarks force-pushed the steamworks-interface-singleton branch from 050acc9 to 68ee8ec Compare December 27, 2025 06:32
@cebarks cebarks requested a review from oceancabbage December 28, 2025 22:48
  Integrates Steam auto-launch functionality from PR RimSort#1637 with the current
  branch's singleton-based SteamworksInterface architecture and proper linux support. Steam can now be
  automatically launched on startup if not running, with user configuration.

  Features:
  - Platform-specific Steam executable detection (Windows, macOS, Linux)
  - Process-based Steam detection using psutil for accurate status checking
  - 45-second initial timeout with interactive user prompts to continue waiting
  - Configurable via Settings > Advanced > "Automatically launch Steam if not running"
  - Manual launch via Help > Launch Steam menu action
  - Disabled by default to avoid startup delays

  Implementation:
  - Added _find_steam_executable(), _is_steam_running(), and _launch_steam()
    utility functions to app/utils/steam/steamworks/wrapper.py
  - Added auto_launch_steam boolean setting to Settings model (default: False)
  - Added checkbox UI in SettingsDialog Advanced tab
  - Extended SteamStatusHandler with auto-launch logic and timeout handling
  - Added "Launch Steam" menu action to Help menu

  Bug fixes:
  - Fixed signal timing issue where steam_not_running emitted before
    SteamStatusHandler created by adding initialization check in __init__()
  - Fixed Help > Launch Steam showing warning dialog before launching by
    using direct _is_steam_running() check instead of check_steam_availability()
  - Fixed blocking dialog preventing immediate launch by removing pre-launch
    notification and only showing result dialogs
@cebarks
Copy link
Copy Markdown
Collaborator Author

cebarks commented Dec 29, 2025

updated to pull in features from #1637 but based on this SteamworksInterface architecture.

Also fixes steam launching on linux and autostart setting

cebarks and others added 2 commits December 28, 2025 17:58
…ngleton

Merges upstream improvements:
- CSV export refactored to separate utility module (RimSort#1646)
- Steam integration validation only when checkbox enabled (RimSort#1645)
- Enhanced translation guide with batch operations (RimSort#1643)
- Enhanced translation helper with automated features (RimSort#1642)

Conflict resolutions:
- settings_controller.py: Adopted upstream's conditional Steam validation
- csv_export_utils.py: Accepted upstream refactoring to separate module
- acf_log_reader.py: Updated to use csv_export_utils import
- .translation_cache.json: Excluded from version control, added to .gitignore
- All translation files: Accepted upstream improvements

All tests pass (322 tests), code quality checks pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
cebarks added a commit that referenced this pull request Dec 29, 2025
This commit completes the integration of PR #1623's QThreadPool-based
Steamworks API with the CLI by adding proper Qt event loop support.

Key changes:
- Add QCoreApplication initialization to CLI build-db command for headless Qt support
- Replace QThreadPool.waitForDone() with QEventLoop.exec() in ISteamUGC_GetAppDependencies
  - Ensures Qt signals are properly delivered from worker thread to main thread
  - Allows progress callbacks to function correctly in CLI context
- Add QEventLoop to PySide6.QtCore imports

Rationale:
- QThreadPool signals require an event loop to deliver signals from worker threads
- waitForDone() blocks without processing events, preventing signal delivery
- QEventLoop.exec() processes events while waiting, enabling proper signal handling
- QCoreApplication provides headless Qt support without GUI overhead

This eliminates the need for multiprocessing (which caused broken pipe errors)
and provides a single, unified code path for both GUI and CLI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@nyabinary
Copy link
Copy Markdown

What the status of this?
cc: @LionelColaso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility 👀 ℹ️🤓 user-friendly optimization, like notifications, warnings and action alerts bugs 🪲 bugs and errors, something is not working as intended Code refactoring 🧹 improving the structure and organization of the code; restructuring, cleaning up feature/improvement 🆕 Use this label to mark new feature or improvement requests Linux🐧 Linux-specific issues macOS 🍏 macOS-specific issues submodules Pull requests that update Submodules code third party 📲 Anything related to 3rd party software used in the app Windows 🪟 Windows-specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants