Commit Graph

3475 Commits

Author SHA1 Message Date
peelz 2cdd3f3ec5 Add constructor support to Hook.Patch 2022-09-15 19:31:47 -04:00
peelz 8774a33914 Fix possible NRE when stopping while a patched method is running 2022-09-15 19:31:47 -04:00
peelz 025b840625 Fix test concurrency issues 2022-09-15 19:31:41 -04:00
peelz 32a96e39ee Update MoonSharp 2022-09-15 18:09:32 -04:00
EvilFactory 3914831921 register PropertyConditional and Xml classes, and create global references for them 2022-09-14 14:09:33 -03:00
EvilFactory ae3b68d417 remove non-functional error handler 2022-09-14 14:08:56 -03:00
EvilFactory f41962f75d forgot a Voronoi2 class 2022-09-02 19:51:16 -03:00
EvilFactory e972777cf6 register Voronoid Elements 2022-09-02 14:13:34 -03:00
EvilFactory d6b82cd591 better error handling in LuaUserData.lua 2022-08-31 14:53:32 -03:00
EvilFactory 9ef581ecfb register EventManager and EventManagerSettings 2022-08-31 14:52:33 -03:00
EvilFactory 4d156b6509 register HumanoidAnimController and FishAnimController 2022-08-25 13:38:11 -03:00
EvilFactory ca89cbe418 refactor workshop installation: make LuaCsInstaller a little less cursed 2022-08-23 14:58:42 -03:00
EvilFactory 199d9b78f0 fix LuaCsUpdateChecker throwing fatal error when having a missing file 2022-08-20 19:43:47 -03:00
peelz 13d0510d37 Make lua converters private 2022-08-20 11:32:18 -04:00
peelz d547c97c80 Fix Hook.Add compatibility with C# mods 2022-08-20 11:32:18 -04:00
EvilFactory 9fb25252a6 added custom converters for GUICustomComponent's delegates 2022-08-20 12:03:05 -03:00
peelz 860449aaed Fix NRE in GUI lua converters 2022-08-17 19:49:08 -04:00
EvilFactory b8707c1f32 register TextPack 2022-08-16 13:24:52 -03:00
EvilFactory 53b92e3a44 added RespawnManager to Game 2022-08-14 10:54:50 -03:00
EvilFactory 582d6a5c26 fix inverted check for SaveGame 2022-08-11 19:14:14 -03:00
EvilFactory 53c586b22f add save folder to whitelist 2022-08-11 12:59:20 -03:00
EvilFactory 4bccc33c4f added Game.ServerSettings for clients and Game.Client/Game.Server 2022-08-10 16:52:54 -03:00
EvilFactory 412a9e0055 register GameMain, BanList and BannedPlayer 2022-08-10 16:52:27 -03:00
EvilFactory 40814a1723 expose AccumulatorMax 2022-08-10 16:35:12 -03:00
peelz eabc611a63 Fix typo in cl_xxx commands 2022-08-10 05:59:41 -04:00
peelz dd1b404c9b Refactor error/exception/message handling
This adds:
- LuaCsSetup.ExceptionHandler so we can decide how we want to handle
exceptions for unit tests
- LuaCsSetup.MessageHandler so we can redirect logs to the XUnit output
  helper
2022-08-10 05:59:41 -04:00
peelz 4f17a88781 Fix incorrect LuaXXX type converter used in overload disambiguation 2022-08-10 05:36:17 -04:00
peelz 267644695a Add Sigil.dll to the list of files to deploy/update 2022-08-10 05:36:17 -04:00
peelz 4e41d5c4fb Fix item.interact hook not passing the correct parameters 2022-08-10 05:36:17 -04:00
peelz 33a29741df Change DefaultHook.lua to use Hook.Patch 2022-08-10 05:36:17 -04:00
peelz 4a6e13a0dc Refactor LuaDocs generator 2022-08-10 05:36:16 -04:00
peelz 2f5add1999 Don't conflate fields with tables 2022-08-10 05:36:16 -04:00
peelz 1bb7843811 Move docs to luacs-docs/{lua,cs,landing-page}
luacs-docs/cs also has a proper http server for testing locally
2022-08-10 05:36:16 -04:00
peelz 69c627b651 Deprecate Hook.HookMethod 2022-08-10 05:36:16 -04:00
peelz 9a621237f0 Add unit tests for LuaCsHook Patch API 2022-08-09 17:50:00 -04:00
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 fb1005d255 Clean up dependencies 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
peelz a5bffce33b Move prohibitedHooks check to a method 2022-08-09 17:50:00 -04:00
peelz 7ce7e6e763 Support resolving methods with ref/out parameters 2022-08-09 17:50:00 -04:00
Evil Factory 9386181fce Merge branch 'Regalis11:master' into master 2022-08-09 13:39:27 -03:00
Juan Pablo Arce b17019db95 v0.18.15.1 2022-08-09 13:37:15 -03:00
EvilFactory 0948c6dc35 added Quality.SetValue 2022-08-08 17:36:50 -03:00
EvilFactory 9fd550e8f5 fixed wrong type of CharacterEditorScreen 2022-07-31 08:14:58 -03:00
EvilFactory 069567c681 LuaCs is now initialized after sub editor screen is first selected, added Game.IsSubEditor, Game.SubEditorScreen and registered editor screens 2022-07-27 20:01:20 -03:00
EvilFactory 1b020ff99e don't prevent further cs mods from being executed if one of them has a runtime error 2022-07-25 09:25:06 -03:00
EvilFactory 3fc6892571 fix exceptions not being handled correctly inside Network.Receive and Timer.Wait 2022-07-23 12:23:27 -03:00
EvilFactory 31b0bbd3d9 fix jobsAssigned hook not working for respawn shuttles 2022-07-16 11:28:33 -03:00