feature: BEAMMP_PROVIDER_DISABLE_MP_SET environment variable#461
Open
TechStreetDev wants to merge 2 commits intoBeamMP:minorfrom
Open
feature: BEAMMP_PROVIDER_DISABLE_MP_SET environment variable#461TechStreetDev wants to merge 2 commits intoBeamMP:minorfrom
TechStreetDev wants to merge 2 commits intoBeamMP:minorfrom
Conversation
fix: using wrong feedback method
WiserTixx
requested changes
Jan 15, 2026
WiserTixx
requested changes
Jan 17, 2026
src/LuaAPI.cpp
Outdated
|
|
||
| void LuaAPI::MP::Set(int ConfigID, sol::object NewValue) { | ||
| if (mDisableMPSet) { | ||
| beammp_lua_error( |
Collaborator
There was a problem hiding this comment.
Could the lua state name/plugin name be included instead of "A script"?
and could you use the format version of the log functions to make the code cleaner?
Example:
Line 157 in 9fa9974
Author
There was a problem hiding this comment.
Could the lua state name/plugin name be included instead of "A script"?
I could not figure out how to do this, and there is no other method which does this as far as I can tell (to copy from)
Collaborator
There was a problem hiding this comment.
I suppose you could move the check (and error message) to
BeamMP-Server/src/TLuaEngine.cpp
Line 921 in 6f196ac
Something like:
if (mDisableMPSet) {
MP.set_function("Set", [this](int ConfigID, sol::object NewValue){
beammp_lua_errorf("A script ({}) tried to call MP.Set to change setting '{}' but this was blocked by your server provider.", StateId, GetSettingName(ConfigID));
});
} else {
MPTable.set_function("Set", &LuaAPI::MP::Set);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds BEAMMP_PROVIDER_DISABLE_MP_SET variable (true/false/1/0) to disable MP::Set for providers.
By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion.
I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.