GameAPI Compat Shim

版本 v1.1.0·更新於 2026-07-13

Restores game methods a REPO update removed, so mods built against the old signatures work again. A BepInEx preloader patch that re-adds the removed overloads and stops the MissingMethodException floo

模組介紹 作者原文

GameAPI Compat Shim

Restores game methods a R.E.P.O. update removed, so mods built against the old signatures work again.

What it does

A R.E.P.O. update added a trailing parameter to several game methods. Mods compiled against the old signatures now throw MissingMethodException on every call. That can leave a modded enemy dealing no damage, and it fills the log with errors. This is a BepInEx preloader patch. It edits the game assembly in memory at load and re-adds the removed overloads as thin forwarders that call the current versions with the new parameter's default.

Restored overloads:

| Method | Forwards with |

|---|---|

| PlayerHealth.HurtOther, 4-arg | hurtByHeal = false |

| EnemyNavMeshAgent.Warp, 1-arg | force = false |

| Sound.PlayLoop, 4-arg | volumeMultiplier = 1.0 |

| PhysGrabber.OverrideGrabRelease, 0-arg | viewID = -1, releaseTime = 0.5 |

Installation

  • Install BepInEx.
  • Put GameApiCompatShim.dll in BepInEx/patchers, not plugins. In the wrong folder it does nothing. A mod manager puts it in the right place.

Confirmed working with

  • OrtonLongGaming-FreddyEnemy: Freddy's attacks deal damage again and the error storm stops
  • Rosayy-Echohold: the plasma gun stops throwing OverrideGrabRelease errors every frame

For developers - detailed breakdown

No plugin GUID, this is a preloader patcher. Log source GameApiCompatShim, TargetDLLs = { "Assembly-CSharp.dll" }.

It has to be a preloader because the target is the game assembly, which loads from the Managed folder during preload. Plugin time is too late to add methods, and Harmony cannot patch a method into existence.

For each row in the table, Patch(AssemblyDefinition) uses Mono.Cecil to:

  • Find the current overload: same name, non-static, with more parameters than the old count. The shortest such overload wins.
  • Stop if the type is missing, the longer overload is gone, or an overload with the old argument count already exists. Each case is logged. A future game update that reverts the signature makes this a no-op.
  • Emit a new public instance method with the old parameter list whose body is ldarg.0, load each parameter, push the default constant for the added trailing parameter, call the current overload, pop any non-void return, ret.

The edit happens on the in-memory AssemblyDefinition during BepInEx's preload chain. Nothing on disk changes.

It restores exactly the overloads listed in the table above. A mod that throws MissingMethodException on some other signature is not covered, and the exception text names the method a future version would need. Old callers get the new parameter's default, which is all they could ever have used, since the parameter did not exist when they were compiled.

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
GameAPI_Compat_Shim-1.1.0.zip
檔案大小
15.6 KiB