You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-reference.md
+36-4Lines changed: 36 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# ChuModLoader API Reference (v2.5.0)
1
+
# ChuModLoader API Reference (v3.0.0)
2
2
3
-
This document describes the C ABI exposed by ChuModLoader v2.5.0. The ABI is intentionally append-only: older mods continue to work, and newer mods should check `ChuModAPI::struct_size` before using fields added after their target version.
3
+
This document describes the C ABI exposed by ChuModLoader v3.0.0. The ABI is intentionally append-only: older mods continue to work, and newer mods should check `ChuModAPI::struct_size` before using fields added after their target version.
4
4
5
5
For C/C++ projects, include `include/chumod.h`. Rust or other languages should mirror the same `#[repr(C)]` layouts and `extern "C"` function signatures.
Reloads a currently loaded mod by display name, file name, or file stem. The loader calls the target mod's `chumod_shutdown`, unloads the DLL with `FreeLibrary`, loads it again, then calls `chumod_init` and `chumod_on_ready` if present. The whole flow is panic-guarded and logged.
419
+
420
+
Parameters:
421
+
- `mod_name`: display name, DLL file name (`example.dll`), or file stem (`example`).
422
+
423
+
Return value: `0` on success, non-zero on failure.
424
+
425
+
Example:
426
+
427
+
```c
428
+
if (api->reload_mod) {
429
+
int ret = api->reload_mod("Example Mod");
430
+
if (ret != 0) api->log_error("reload failed");
431
+
}
432
+
```
433
+
434
+
External trigger: create `mods/reload.flag` to reload all currently loaded mods. The loader monitor thread deletes the flag after processing.
435
+
406
436
## Mod exports
407
437
408
438
All exports are optional except that mods needing the API should export `chumod_init`. Plain DLLs with only `DllMain` are still loaded.
Copy file name to clipboardExpand all lines: docs/mod-development.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# ChuModLoader Mod Development Guide (v2.5.0)
1
+
# ChuModLoader Mod Development Guide (v3.0.0)
2
2
3
3
ChuModLoader is a `version.dll` proxy that loads mod DLLs from `mods/` when `chusanApp.exe` starts. Mods can be written in several ways and can opt into progressively richer APIs.
4
4
@@ -19,13 +19,16 @@ LoadLibrary(mod.dll)
19
19
-> optional metadata/dependency exports are read
20
20
-> chumod_init(info, api)
21
21
-> after every successful mod init: chumod_on_ready()
Use `chumod_init` for local setup and hook creation. Use `chumod_on_ready` when you need other mods' services to exist. Use `chumod_shutdown` to disable hooks and release resources.
28
29
30
+
`chumod_on_frame` is optional. v3.0.0 uses a 16 ms fallback frame loop after `chumod_on_ready` for mods that export it.
@@ -267,7 +275,7 @@ The loader sorts mods before calling `chumod_init`. If dependencies cannot be sa
267
275
268
276
## Crash protection
269
277
270
-
ChuModLoader wraps `chumod_init`, `chumod_on_ready`, and `chumod_shutdown` with Rust `catch_unwind`. This protects against Rust panics crossing the loader boundary. It does **not** make arbitrary memory faults safe: access violations in native code can still crash the process.
278
+
ChuModLoader wraps `chumod_init`, `chumod_on_ready`, `chumod_on_frame`, and `chumod_shutdown` with Rust `catch_unwind`. v3.0.0 also installs a top-level SEH filter that writes minidumps and readable crash logs to `mods/crash/`. This does **not** make arbitrary memory faults safe: access violations in native code can still terminate the process after the dump is written.
0 commit comments