Online-Fix Integration
Relevant source files
The following files were used as context for generating this wiki page:The Online-Fix integration is a core feature of SOFL, designed to streamline the installation, management, and launching of games that use "Online-Fix" patches. These games are typically distributed as password-protected RAR archives and require a specific environment, including Steam and Proton, to function correctly. This system automates the process, from extracting the game from an archive to configuring its launch environment, making it accessible for Linux users.
The integration provides a specialized installation dialog, a dedicated game data class (OnlineFixGameData) for handling launch logic, and specific configuration options within the application's preferences. This allows users to manage Online-Fix games alongside titles from other sources like Steam or Lutris in a unified library.
Core Components
The Online-Fix functionality is built upon several key classes that handle installation, data management, and user interaction.
This diagram shows the main classes involved in the Online-Fix feature. OnlineFixGameData extends the base GameData class with specialized launch and uninstall logic. The InstallDialog orchestrates the installation process, using an OnlineFixInstaller and ArchiveVerifier to handle the game archive.
Sources: sofl/onlinefix_game.py, sofl/dialogs/install_dialog.py, sofl/importer/onlinefix_source.py
Installation Process
Installing an Online-Fix game is handled through a dedicated InstallDialog. The process begins when the user selects a .rar archive. The system then verifies the archive, extracts it, and adds the game to the library.
Installation Flow
The following diagram illustrates the step-by-step process of installing an Online-Fix game.
Key Steps and Logic
- File Selection: The user opens the
InstallDialogand selects a.rarfile using aGtk.FileDialog.
Sources: sofl/dialogs/install_dialog.py:141-150 - Archive Verification: The
_check_rar_archivemethod is called asynchronously. It usesArchiveVerifier.verify_archive_passwordto check if the archive can be opened with the hardcoded password "online-fix.me". If successful,ArchiveVerifier.extract_game_titleattempts to parse the game name from the filename.
Sources: sofl/dialogs/install_dialog.py:44, 194-203 - Installation: Upon clicking "Install", the
_install_game_taskruns asynchronously. It callsOnlineFixInstaller.install_game, which handles the extraction of the archive to the designated Online-Fix games path and finds the main executable.
Sources: sofl/dialogs/install_dialog.py:277-310 - Adding to Library: If installation is successful,
_add_game_to_libraryis called. It generates a unique ID for the game (e.g.,online-fix_1), creates anOnlineFixGameDataobject using theGameFactory, and adds it to the central game store.
Sources: sofl/dialogs/install_dialog.py:312-327, 349-368, sofl/details_dialog.py:183-228 - Final Setup: The
DetailsDialogis shown to allow the user to review and edit the game's details before it is finalized in the library.
Sources: sofl/dialogs/install_dialog.py:380-386
Game Launch Mechanism
Launching an Online-Fix game is a specialized process handled by the OnlineFixGameData.launch method. It ensures that Steam is running and prepares a Proton-based environment for the game.
Launch Sequence
This sequence diagram details the interactions when a user launches an Online-Fix game.
Sources: sofl/onlinefix_game.py:77-164
Launch Logic
- Steam Requirement: The launch process first checks if Steam is running using
SteamLauncher.check_steam_running. If not, it prompts the user to start Steam.
Sources: sofl/onlinefix_game.py:98-101, 237-256 - Proton Version: It retrieves the configured Proton version from settings. If no version is selected or the selected one is not found, it prompts the user to open the Proton Manager in the preferences.
Sources: sofl/onlinefix_game.py:104-119, 258-272 - Wine Prefix Creation: A dedicated Wine prefix is created for the game. On Flatpak, this is located in
~/.var/app/org.badkiko.sofl/data/wine-prefixes/, while on native installs it's in a folder namedOFME Prefixnext to the game executable.
Sources: sofl/onlinefix_game.py:48-74 - Environment and Command: The
SteamLauncherutility class is used to prepare environment variables (likeWINEPREFIX) and construct the final launch command, which wraps the game executable with the selected Proton version and any user-defined arguments.
Sources: sofl/onlinefix_game.py:133-152 - Process Tracking: The game is launched as a subprocess, and the process object is passed to the main window to be tracked, allowing the UI to show the game's running state and provide a stop button.
Sources: sofl/onlinefix_game.py:155-159
Configuration
Users can configure the Online-Fix integration via the Preferences dialog. These settings are stored using Gio.Settings and control the installation path, launch behavior, and Proton version.
| Setting | Schema Key | UI Control | Description |
|---|---|---|---|
| Installation Path | online-fix-install-path | online_fix_entry_row | The directory where new Online-Fix games will be installed. Defaults to ~/Games/Online-Fix. |
| Proton Version | online-fix-proton-version | online_fix_proton_combo | The specific GE-Proton version to use for launching all Online-Fix games. |
| Use Steam Runtime | online-fix-use-steam-runtime | (Not directly in UI, but used) | Boolean to determine if the Steam Runtime should be used for launching. |
| Arguments Before | online-fix-args-before | (Not directly in UI, but used) | Custom command-line arguments to prepend to the launch command. |
| Arguments After | online-fix-args-after | (Not directly in UI, but used) | Custom command-line arguments to append to the launch command. |
Sources: sofl/preferences.py:313-345, sofl/onlinefix_game.py:104, 135, 149-150
The Proton version is selected from a list of installed GE-Proton versions discovered by the ProtonManager. The preferences dialog includes a full "Proton Manager" page for downloading and managing these versions.
Sources: sofl/preferences.py:461-467, 571-574
Game Management
Changing Game Type
A regular game can be converted to an Online-Fix game (and vice-versa) through the DetailsDialog. A "Game Type" combo box allows the user to switch between "Online-Fix Game" and "Regular Game". Changing this value updates the game's source property to either online-fix or imported and moves it to the correct source group in the data store.
Sources: sofl/details_dialog.py:237-268
Uninstallation
Online-Fix games can be uninstalled directly from the application. The OnlineFixGameData.uninstall_game method provides this functionality.
- It first verifies that the game is located within the configured Online-Fix installation directory.
- If the game is outside this directory, it is simply removed from the SOFL library list without deleting any files.
- If it is inside the directory, the system detects the game's root folder and presents a confirmation dialog.
- Upon confirmation, the entire game folder is deleted using
shutil.rmtree.
Sources: sofl/onlinefix_game.py:177-235