Commit Graph

169 Commits

Author SHA1 Message Date
EvilFactory
3aff717600 Added Hook.Exists 2022-10-30 18:00:30 -03:00
EvilFactory
ba1157b07d Make init logs nicer 2022-10-30 16:34:01 -03:00
EvilFactory
e7d98dc887 Update Moonsharp for the new pcall exception handling 2022-10-29 20:30:02 -03:00
EvilFactory
b77dde156b Get docs in line and added networking manual 2022-10-29 19:44:23 -03:00
EvilFactory
09979cb4c9 Fix client-side commands working when they shouldn't 2022-10-28 15:14:43 -03:00
EvilFactory
d88a6b5ef0 Move logging stuff to a separate file 2022-10-28 13:19:23 -03:00
EvilFactory
9502d70290 Rename field and remove unnecessary usings 2022-10-28 12:42:35 -03:00
EvilFactory
5e29d1d8ba Fix mixed spaces and tabs 2022-10-28 12:29:35 -03:00
EvilFactory
43810a3509 Use WorkshopId instead and minor cleanup 2022-10-28 12:26:47 -03:00
EvilFactory
8158213471 Added AccountId, Endpoint and TimeSpan for later 2022-10-25 12:50:17 -03:00
EvilFactory
18ee41c610 Remove unnecessary null checks and added missing return statement 2022-10-07 11:30:59 -03:00
EvilFactory
1eed13fcd0 added support for None<T> and Some<T> and added some missing types from last update 2022-10-05 20:55:15 -03:00
EvilFactory
729110484f texture loader and option support 2022-10-05 12:17:40 -03:00
EvilFactory
6c38a555bb Re-add ForceVoice and ForceLocalVoice as compatibility 2022-09-29 16:20:47 -03:00
EvilFactory
faad59f20d fix projects and compile errors 2022-09-29 14:08:59 -03:00
EvilFactory
245e76cd8d Fix #106 turn list into an array before looping through hooks 2022-09-23 11:42:49 -03:00
peelz
cc414692be Change Hook.Patch exceptions to lua errors 2022-09-17 00:11:09 -04:00
peelz
cd8316ea4c Fix NRE in LuaUserData.GetType 2022-09-17 00:11:09 -04:00
peelz
6da732e997 Fix Hook.Patch confusing .ctor with .cctor 2022-09-17 00:11:09 -04:00
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
EvilFactory
ca89cbe418 refactor workshop installation: make LuaCsInstaller a little less cursed 2022-08-23 14:58:42 -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
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
40814a1723 expose AccumulatorMax 2022-08-10 16:35:12 -03: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
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
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
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
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
Evil Factory
b9ebf04a6a fix undefined identifiers in patches overriding each other 2022-07-14 20:55:39 -03:00
Evil Factory
09971905e1 whoops 2022-07-10 19:22:57 -03:00
Evil Factory
32fb3c3317 attempt in fixing mysterious timer crash again 2022-07-10 14:06:48 -03:00