-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using debug hook to get a function name and argument(s) #528
Comments
JD802
changed the title
Using debug hooks to get a function parameter
Using debug hooks to get a function argument
Mar 8, 2024
JD802
changed the title
Using debug hooks to get a function argument
Using debug hook to get a function name and argument
Mar 8, 2024
JD802
changed the title
Using debug hook to get a function name and argument
Using debug hook to get a function name and argument(s)
Mar 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
First of all, thank you for NLua, it's a wonderful project that has provided enormously useful for us.
We are using sandboxed NLua that executes user generated scripts on server side. I have setup a Lua debug hook to kill scripts that are running too long, and this works fine. I'd now like to optimize specific Lua function calls that users's scripts may contain, but I'm unsure how to set it up.
Example case
Lua function that needs to be optimized: GetParamValue(paramName) -> returns either string, integer, or float value.
I need to check whether a specific Lua function (GetParamValue) is invoked by utilizing a debug hook event handler. If the specific Lua function is called, it's crucial to examine the argument (paramName). In certain scenarios, which are not detailed here, executing Lua code within the C# event handler is necessary before allowing the execution of the user's Lua script to proceed to completion.
Is this possible to do in NLua? If yes, could someone more experienced provide some pointers?
NLua Initialization and event Subscription
Event handler
The text was updated successfully, but these errors were encountered: