Skip to content

Optimize and decouple debug hook manager for modern event system - #5272

Merged
FileEX merged 2 commits into
multitheftauto:masterfrom
MohabCodeX:perf/optimize-debug-hooks-master
Aug 28, 2026
Merged

Optimize and decouple debug hook manager for modern event system#5272
FileEX merged 2 commits into
multitheftauto:masterfrom
MohabCodeX:perf/optimize-debug-hooks-master

Conversation

@MohabCodeX

Copy link
Copy Markdown
Contributor

Summary

for #5240

  • Decoupled debug info extraction to work directly with Lua function references, fully restoring all 4 event hook types without legacy dependencies.
  • Added inlined presence checks to reduce the hotpath hook check to an $O(1)$ branch, ensuring zero function-call overhead during normal gameplay when no hooks are active.
  • Fixed event triggering to properly mark events as cancelled and return false when aborted by a pre-event hook.
  • Kept backward compatibility wrappers for server-side event handling.

Testing

  • Tested with an automated test_debug_hooks.zip verifying all 4 event hook types, metadata extraction, selective handler skipping, and cancellation handling.

Comment thread Client/mods/deathmatch/logic/CClientEntity.cpp Outdated
Comment thread Client/mods/deathmatch/logic/CClientEntity.cpp Outdated
@FileEX FileEX added this to the 1.7 (Current) milestone Aug 28, 2026
@FileEX
FileEX merged commit 7fab391 into multitheftauto:master Aug 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants