Commit Graph

10 Commits

Author SHA1 Message Date
peelz
d9dc84425d Make LuaCsSetup easier to integrate into unit tests 2022-08-09 17:50:00 -04:00
peelz
d98daf008e Add lua types for C# primitives 2022-08-09 17:50:00 -04:00
peelz
08836088fb Refactor hooking API
This completely changes how method patching works under the hood. Unlike
the previous API (`Hook.HookMethod`), the new API (`Hook.Patch`)
generates a Harmony patch method at runtime, using IL generation.

This fixes methods with ByRef (out/ref) parameters getting silently corrupted
due to the ByRef semantics being lost when passed through the `object[] __args`
parameter.

This new API also makes it possible to:
  - modify parameters (including ByRef params)
  - change the return value to `null` (old API would use `return nil`
    for Harmony control flow)
  - prevent execution of the original method (and other harmony
    patches), independently of modifying the return value
2022-08-09 17:50:00 -04:00
peelz
768abd5ce1 Remove LuaResult 2022-08-09 17:50:00 -04:00
Evil Factory
6ee6b5cd15 improve custom converters 2022-05-18 19:09:28 -03:00
Evil Factory
74bf5d12ca added Steam.DownloadWorkshopItem and Steam.GetWorkshopItem 2022-05-17 19:15:44 -03:00
Oiltanker
da251099a3 working serialization + cs mods one-time warning 2022-04-19 22:35:08 +03:00
Evil Factory
f439cabc9a fix patch hooks and rename delegates 2022-04-16 12:44:50 -03:00
zhurengong
67767d5c9d added OnValueEnteredHandler handler 2022-04-16 18:16:31 +08:00
Evil Factory
b7395bedea Refactor and fix #56 2022-04-15 19:08:27 -03:00