A mods folder: load every DLL in %LOCALAPPDATA%\victory\mods before the title runs #136

Closed
leonidarider wants to merge 0 commits from upstream-pr/136 into main
leonidarider commented 2026-11-29 02:47:52 +00:00 (Migrated from github.com)

Imported from uiliannn/VItoriaBr. Originally posted by leonidarider on 2026-11-29T02:47:52Z.


What it changes

A mod DLL has no clean way into victory today: it has to pose as a system DLL beside the program or inject itself from outside.

This adds a mods folder. Every .dll in %LOCALAPPDATA%\victory\mods is loaded by name order with LoadLibraryW just before the title runs. Each one is named on the console whether it loaded or not, and a DLL that fails to load costs the run nothing. An empty or missing folder changes nothing, and off Windows the function is empty.

One self-contained function, load_mods, in apps/victory/src/main.rs, and a call before run::run. No new dependency.

What uses it

We wrote it for OpenRage's mod loader: a DLL that serves loose files from a mods folder beside the game in place of the archives' own, with no archive rewritten. Nothing in this change is specific to it: any mod DLL dropped in the folder loads the same way.

How it was tested

Honestly: not on this tree. The same behaviour is open and in daily use on the NVIDIA fork as trustno1-coder/VIctory-NVIDIA#1892, where it goes through that fork's own DLL-loading call. This version is rewritten to stand alone because this tree has no such call. The function compiles and passes rustfmt on its own under edition 2024 with warnings denied, but I have not built this repository with it, so please treat it as a proposal to check rather than a tested change.

<!-- greyfinch-sync:uiliannn/VItoriaBr:issue:5546937919 --> Imported from [uiliannn/VItoriaBr](https://github.com/uiliannn/VitoriaBr2.0/pull/136). Originally posted by [leonidarider](https://github.com/leonidarider) on 2026-11-29T02:47:52Z. --- ## What it changes A mod DLL has no clean way into victory today: it has to pose as a system DLL beside the program or inject itself from outside. This adds a mods folder. Every `.dll` in `%LOCALAPPDATA%\victory\mods` is loaded by name order with `LoadLibraryW` just before the title runs. Each one is named on the console whether it loaded or not, and a DLL that fails to load costs the run nothing. An empty or missing folder changes nothing, and off Windows the function is empty. One self-contained function, `load_mods`, in `apps/victory/src/main.rs`, and a call before `run::run`. No new dependency. ## What uses it We wrote it for [OpenRage](https://github.com/openragee/openrage)'s mod loader: a DLL that serves loose files from a `mods` folder beside the game in place of the archives' own, with no archive rewritten. Nothing in this change is specific to it: any mod DLL dropped in the folder loads the same way. ## How it was tested Honestly: not on this tree. The same behaviour is open and in daily use on the NVIDIA fork as trustno1-coder/VIctory-NVIDIA#1892, where it goes through that fork's own DLL-loading call. This version is rewritten to stand alone because this tree has no such call. The function compiles and passes `rustfmt` on its own under edition 2024 with warnings denied, but I have not built this repository with it, so please treat it as a proposal to check rather than a tested change.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
uiliannn/VItoriaBr!136
No description provided.