Skip to content
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

StartMessage/EndMessage (get state g_IsMsgInExec) #1693

Closed
wS-SM opened this issue Jan 17, 2022 · 3 comments
Closed

StartMessage/EndMessage (get state g_IsMsgInExec) #1693

wS-SM opened this issue Jan 17, 2022 · 3 comments

Comments

@wS-SM
Copy link

wS-SM commented Jan 17, 2022

For example, if several plugins have done "say_team" hook and are doing this:

StartMessage..
return Plugin_Handled;

An error occurs:

// https://github.com/alliedmodders/sourcemod/blob/1fbe5e1daaee9ba44164078fe7f59d862786e612/core/smn_usermsgs.cpp#L421
if (g_IsMsgInExec)
{
    return pCtx->ThrowNativeError("Unable to execute a new message, there is already one in progress");
}

Do just return INVALID_HANDLE or let plugins know the value of variable "g_IsMsgInExec".

@asherkin
Copy link
Member

This error indicates a plugin bug, it appears to be correct.

@wS-SM
Copy link
Author

wS-SM commented Jan 17, 2022

This is not a plugin bug, but an incompatibility between two plugins because they do the same thing. The problem is that the native CanStartMessage does not exist.

@asherkin
Copy link
Member

Holding a global resource (like having a started usermessage) over a context switch is a plugin bug, UMs should be started, written to, and sent all within a single execution cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants