Commit Graph

143 Commits

Author SHA1 Message Date
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
Evil Factory 8153e4af0c print out to the console if the content package Lua folder is being used or not 2022-07-08 19:44:23 -03:00
Evil Factory 1af1fe45ca potential fix for the RunConfig.xml being used by another process 2022-07-07 10:36:38 -03:00
Evil Factory e73cd0f398 fix crash if a cs mod errors in the dispose method 2022-07-07 09:52:29 -03:00
Evil Factory bf0ea54cdd fixed cs mods not being loaded when downloading directly from server 2022-07-05 19:16:01 -03:00
Evil Factory e5d4a38fd7 minor refactor to CsScriptLoader plus fixed source category regex not working as expected with some paths 2022-07-05 17:47:52 -03:00
Evil Factory aaa27229cf fix error not being handled if name is null 2022-07-03 12:41:15 -03:00
Evil Factory 57032eeb11 whoops 2022-07-03 10:39:42 -03:00
Evil Factory 316f1a5007 improve error handling in Hook 2022-07-03 10:19:41 -03:00
Evil Factory a6f7a4aff8 fix error handling in patches 2022-07-01 14:14:44 -03:00
Evil Factory 4a706c504a debug check for weird timer crash 2022-06-29 20:22:33 -03:00
Evil Factory 3418132b90 fix compile error 2022-06-29 17:08:33 -03:00
Evil Factory 20dabf502a cleanup 2022-06-29 16:48:34 -03:00
Evil Factory 4ad3b2cba0 Decursefication of patches 2022-06-29 16:13:51 -03:00
Evil Factory 47e0351403 fix some of the formatting and remove usage of CsScriptFilter as it's pretty much useless 2022-06-29 12:12:47 -03:00
Evil Factory a154558f0b fix HttpGet method 2022-06-22 20:38:49 -03:00
Evil Factory 64c81146fb added PerformanceCounter 2022-06-19 11:50:51 -03:00
Evil Factory 78716f4695 allow use of any http method 2022-06-19 10:58:01 -03:00
Evil Factory a2f8d0019f fix threading issues with initialization 2022-06-17 14:29:10 -03:00
Evil Factory 916fd7522e add Game.ForceVoice and Game.ForceLocalVoice
guess what i am going to use this for
2022-06-16 20:34:31 -03:00
Evil Factory 1136342b60 added Game.ActiveChatMode 2022-06-16 13:15:48 -03:00
Evil Factory efd1243754 Minor refactor for LuaUserData.lua 2022-06-14 13:09:52 -03:00
Evil Factory 9041f5ef0d forgot to include a file in the last commit (ed1fbdbe5) 2022-06-09 16:03:36 -03:00
Evil Factory ed1fbdbe5e Potential fix for threading issues and added CSActive var 2022-06-09 16:02:18 -03:00
Evil Factory 59d4ec8ad7 Game.LoadGame, Game.SaveGame and Game.LoadCampaign 2022-06-05 14:25:40 -03:00
Evil Factory 4ddbe69ee5 Merge pull request #92 from Cintique/LuaUserData-CreateUserDataOfType
Add `LuaUserData.CreateUserDataOfType`.
2022-06-02 12:47:49 -03:00
Cintique c39bf9f800 Allow wrapping unregistered types.
`LuaUserData.CreateUserDataFromType` will instantiate a default `StandardUserDataDescriptor` to allow wrapping unregistered types. Whoops!
2022-06-02 21:34:34 +10:00