Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
GameAPI Compat Shim
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 flood.
| Last updated | 6 hours ago |
| Total downloads | 18 |
| Total rating | 0 |
| Categories | Mods Libraries AI Generated |
| Dependency string | TheMorningStar-GameAPI_Compat_Shim-1.0.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
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 |
Installation
- Install BepInEx.
- Put
GameApiCompatShim.dllinBepInEx/patchers/, notplugins/. 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
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,callthe current overload,popany 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 three overloads listed. 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.