ConditionalConfigSyncOptionalPatch
A patch for ConditionalConfigSync to disable client side validation to allow users to join vanilla servers with mods.
模組介紹 作者原文
ConditionalConfigSync Optional Patch
This package allows Valheim clients to use mods that declare themselves as server-required through ConditionalConfigSync while connecting to a server that does not have those mods installed.
A small BepInEx preloader patch scans the installed client plugins before the game loads them. When it finds a ConditionalConfigSync ModRequired = true assignment, it changes that assignment to false.
This makes the affected mod treat its server-side presence as optional, allowing the client to connect to a vanilla server.
It does not redistribute or modify ConditionalConfigSync itself, and it does not include any of the third-party mods it patches.
Scope
- scans installed BepInEx plugin DLLs before the normal plugin loading process;
- detects ConditionalConfigSync.ConfigSync.ModRequired = true assignments at the IL level;
- changes only those true assignments to false;
- works generically with mods using ConditionalConfigSync rather than targeting individual mod names;
- leaves ModRequired = false assignments unchanged;
- leaves ConditionalConfigSync's own DLLs untouched;
- automatically creates a backup of every DLL before modifying it;
- records the SHA-256 hash of the patched DLL so the same binary is not unnecessarily patched again;
- automatically recognizes changed or updated mod DLLs and can patch them again;
- does not intentionally change the affected mod's configuration defaults, assets, mechanics, plugin identity, or network protocol.
The patch is intentionally narrow: it changes the value supplied to the ModRequired property and nothing else.
How It Works
ConditionalConfigSync mods can declare that their server-side counterpart is mandatory:
ConfigSync = new ConfigSync(ModId)
{
DisplayName = ModName,
CurrentVersion = ModVersion,
MinimumRequiredVersion = ModVersion,
ModRequired = true
};
The preloader detects the resulting IL instruction that loads true immediately before the ModRequired setter and changes it to false.
Conceptually, this:
ldc.i4.1
callvirt ConfigSync::set_ModRequired(bool)
becomes:
ldc.i4.0
callvirt ConfigSync::set_ModRequired(bool)
No source code or original mod package is redistributed.
Installation
Install this package normally with r2modman or Mod Manager.
The patcher should be installed on the client that needs to connect to servers without the affected mods.
The server does not need this patcher.
After installation, start Valheim normally. The BepInEx preloader will scan the installed plugins before they are loaded.
A successful patch produces log entries similar to:
DigDeeper.dll: FOUND ModRequired setter
DigDeeper.dll: PATCHED 1 ModRequired=true assignment(s) to false.
Sated.dll: FOUND ModRequired setter
Sated.dll: PATCHED 1 ModRequired=true assignment(s) to false.
Mods that already have ModRequired = false are left unchanged.
Backups and Safety
Before modifying a DLL, the patcher creates a backup beside the active plugin:
ModName.dll.ccs-original.bak
The patcher also creates a SHA-256 marker:
ModName.dll.ccs-patched.sha256
These files allow the patcher to determine whether the currently installed DLL has already been processed and provide a recovery copy of the original DLL.
The patcher only operates on DLLs inside the BepInEx plugins directory.
The following ConditionalConfigSync assemblies are deliberately excluded from patching:
- ConditionalConfigSync.dll
- ConditionalConfigSync.Plugin.dll
- ConditionalConfigSyncOptionalPatch.dll
Updating Mods
If a patched mod is updated to a new DLL, its SHA-256 hash changes. The patcher will therefore inspect the new DLL and patch it if it still contains a matching ModRequired = true assignment.
The previous backup is retained rather than overwritten.
Removal
To completely remove the compatibility patch:
- Remove ConditionalConfigSyncOptionalPatch.
- Reinstall the affected mods/r2modman.
This restores the official mod binaries.
Alternatively, an individua
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: