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
Add API to disable WE functions in areas #4
Comments
If the gallery plugin or the protectionareas plugin is loaded before the worldedit plugin, wouldn't they block the WorldEdit plugin? |
Not the WE commands, such as copy and paste. |
Hmm that's true. Shall I create a hook-like system? like |
Nay, I think it's enough to create a list of areas where WE is not allowed to change blocks; then each WE command checks the list and if the player's selection contains any intersection with that list, the command will not be carried out. |
Why dont allow worldedit only on owned player areas? |
Because WorldEdit isn't a security plugin :) |
WorldEdit doesn't provide any security (and it also shouldn't, there's other plugins for this). However, it shouldn't break those plugins' security either, and that's what this issue is about. |
First implentation is done. To add an area use |
I do think we should use a callback so you can make an per-player area protection. |
Yes, the callback makes much more sense for per-player protection |
Copying the input from the forum here: -- Register the callback for a_World
cPluginManager.Get():GetPlugin("WorldEdit"):Call(
"RegisterCallback", "WECallback", PLUGIN, a_World
);
-- The callback
function WECallback(
a_MinX, a_MaxX, a_MinY, a_MaxY, a_MinZ, a_MaxZ,
a_Player, a_World, a_Operation
)
-- Prevent the user from pasting in X < 0
if ((a_MaxX < 0) and (a_Operation == "paste")) then
-- Prevent and give the user a reason that WE displays
return true, "Prevented by an example WE callback";
end
return false; -- Allow
end Or if WE internally has a cCuboid for the selection, it could simply pass that instead of the coord ranges. The clients will most probably use cCuboid for intersections and others anyway. |
I implented everything exept for the return message. But it shouldn't be too hard. but on the other hand the callback function itself could send the message instead of the WE plugin. |
Okay, let's make the callback send the message. It has enough information to format it anyway. |
Then shall I close the issue? |
No, I'll close it for you :P |
Plugins such as ProtectionAreas and Gallery are now vulnerable to players with WorldEdit rights, since WorldEdit can overwrite the areas protected by those plugins.
I'm asking for an API to set (rectangular) regions where WorldEdit cannot be used. The basic version would cover a static list of regions shared among all players. An advanced version would have a per-player list of regions.
The text was updated successfully, but these errors were encountered: