[Plug-in] Area Protection

  • I spoke too soon. Now it appears that NONE of the protections are working. If I try anything in an area that has all permissions turned off (except Enter - Leave) with a player (non-admin) that has no special permissions in that area, it lets me do ANYTHING (place, destroy, BP, etc.). Maybe this is a result of changing to the "ORing" of areas but would not see why this would be. I did not replace my actual "ap-XXXXXX.db" file, .preset files nor my settings.properties file with the update, just the other files including the .jar, but do not see how that would matter.


    Any ideas??

  • Yes, this is definitely a consequence of changing the AND into OR. I overlooked the fact that, while ANDing, you start with everything allowed (as when without any area) and each area you are within "carves" its prohibitions out.


    But, when ORing, you start with everything if within no area, but if within one or more, you start with nothing allowed and each area "adds" its permissions. So, this case is more complex logically and it is not simply a replacement of one logic operator with another.


    I'll fix it...

  • Version 1.0.7 released!


    Version 1.0.7 is available from the thread top post.


    1.0.7 Change log:


    - [new] Added a search box to area lists and to player lists: by entering at least 2 characters and pressing the Search icon, the list is
    shortened to the entries contains that sequence of characters
    - [new] Better explosion control (please read the relevant manual paragraph; feedback welcome)
    - [new] With blueprint events ("Create Blueprint" and "Place Blueprint") spanning several areas, to determine if the blueprint can be created/placed, the permissions of the areas are ANDed again
    - [fix] various bug fixes, including a nasty bug with permission ORing


    Enjoy!


    I am leaving for a week and I will be back on August 12th evening. In the meantime, I will not be able to read any post or message nor to do anything on the code. I hope there will be no serious problem with the last version of the plug-in...


    See you next week!

  • Didn't get around to testing things until Monday morning...


    - [new] Added a search box to area lists and to player lists: by entering at least 2 characters and pressing the Search icon, the list is
    shortened to the entries contains that sequence of characters

    This seems to work well. I noticed that newly created areas are always at the top of the list (not sorted alphabetically) until the server is restarted. Not a big deal, but can they be sorted right away?

    - [new] Better explosion control (please read the relevant manual paragraph; feedback welcome)

    This appears to work. Did not find anything about it in the manual? There is a little weirdness with removing dynamite that has been set but doesn't go off even by server admin?


    - [new] With blueprint events ("Create Blueprint" and "Place Blueprint") spanning several areas, to determine if the blueprint can be created/placed, the permissions of the areas are ANDed again

    This seems to work well. It appears that you can't quite put a BP right to the edge of an area that you have BP permission (can put one block in). This may be by design and should be fine.


    - [fix] various bug fixes, including a nasty bug with permission ORing

    As with the "pre-release" you gave me, the permissions all appear to be working right as far a intersecting areas.



    Did you change something? Now changes to permissions appear to be taking affect right away instead of having to re-log on my test server now. Yeah!


    Definitely still some issues, probably related to the "negative coordinates API issue", with setting things in the "Edit Extent" GUI.

  • when a regular player is set to manager he can not edit player permissions properly unless he adds himself to the area as owner or admin. This is not desirable as it could lead to players set to areas that were forgotten to be removed when the manager is finished with there job on the area leading to access to the sed areas when manager status is removed from the manager in the future. Instead, if a player is set as manager they should have full editing abilities without adding themselves to the areas. In this way there would be less clutter in the DB and posability of security risk when a manager status is removed by not having the names added to the property to begin with.


    also, when having owners rights or admin rights on an area, I placed a stick of tnt and lit it and it would not blow up. It doesn't blow if you have explosions on or off now. The fuse burns but no boom and you can't remove the tnt after it is lit. F7 removal tools will not remove the tnt either.


    The search box for adding names seem to work nicely.


    we still need a way to edit secondary areas while within them. A go to area list button would be very handy.


    When adding a player or editing a player's permissions, they have to log out and back in before the permissions take effect.

  • when a regular player is set to manager he can not edit player permissions properly unless he adds himself to the area as owner or admin.

    This only happens if "Admin priv." are turned OFF and it is more or less by design (as in this case, non-explicitly granted permissions ARE turned off); if admin priv. are turned ON, managers can edit all permissions of other players.


    "Admin priv. OFF" is a kind of debug setting; these privileges are assumed to be normally ON.

    also, when having owners rights or admin rights on an area, I placed a stick of tnt and lit it and it would not blow up. It doesn't blow if you have explosions on or off now.

    By "you have" you mean "you, as personal player permissions" or "generic area permissions"?


    The first case is in some circumstances expected: in some circumstances, the API does not tell the plug-in who the player is who planted the TNT and the plug-in has to rely on the generic area permissions (this is described in the manual). The latter is NOT expected.

    The fuse burns but no boom and you can't remove the tnt after it is lit. F7 removal tools will not remove the tnt either.


    I assume this has nothing to do with the plug-in, but with what happens as RW level when the explosion is cancelled.


    we still need a way to edit secondary areas while within them. A go to area list button would be very handy.

    The general "Go to Area" button is only two mouse clicks away (only one more than having the button in the Area Properties dlg box itself): press "UPDATE" and then press "Go to Area" in the main menu.


    After having thought about it, I prefer to have to press the "UPDATE" button explicitly.

    When adding a player or editing a player's permissions, they have to log out and back in before the permissions take effect.

    Well, I cannot replicate this in a debug session: to me, edited player permissions are immediately available to the player. Can you give me a precise list of steps?

    I noticed that newly created areas are always at the top of the list (not sorted alphabetically) until the server is restarted. Not a big deal, but can they be sorted right away?

    They should be sorted right away (in fact, they are in my test server)


    It appears that you can't quite put a BP right to the edge of an area that you have BP permission (can put one block in). This may be by design and should be fine.

    Very probably this is due to the same API bug about 1 block off coordinate conversions.

    Now changes to permissions appear to be taking affect right away instead of having to re-log on my test server now. Yeah!

    And then (in another message) they seems no longer work. As they consistently work (since several updates) on my local test server, I cannot reproduce this issue, which might be due to something other than the plug-in; see my answer above to sharkbitefischer: a precise list of steps could be useful.

  • we still need a way to edit secondary areas while within them. A go to area list button would be very handy.

    If you go outside all areas to an "open" area and do a "/ap edit" or do "/ap" and click "edit area" it will present you with a list of areas to find the intersecting one that you want to edit... A little "awkward" but works.


    Very probably this is due to the same API bug about 1 block off coordinate conversions.

    I'm not sure the "BP right to the edge" is the same "negative coord shift" issue as the "BP to the edge" issue happens whether the coord you are at is negative or not.


    The fuse burns but no boom and you can't remove the tnt after it is lit. F7 removal tools will not remove the tnt either.

    To start, I was able to give a player the right to explode dynamite in an area. As far as removing an un-exploded dynamite, I was able to remove as a server admin with or without F7, but it didn't show as being gone until a re-log. Think this is a general game issue for @red51

  • This only happens if "Admin priv." are turned OFF and it is more or less by design (as in this case, non-explicitly granted permissions ARE turned off); if admin priv. are turned ON, managers can edit all permissions of other players.

    Just FYI @sharkbitefischer, I had not realized it, but the "Admin priv: ON/OFF" is a "world setting". In other words, it is not a setting for each individual server admin/manager. If it is set OFF, this affects all server admins/managers. If it is turned "ON", this again affects all server admins/managers. But, as Miwarrre said, if it is "ON", then managers can manage all settings. Managers can not however turn "Admin priv" ON/OFF, so server admins should turn it "ON" when done "testing" privs which makes sense since this is for "debugging" and should be normally "ON".

  • And then (in another message) they seems no longer work. As they consistently work (since several updates) on my local test server, I cannot reproduce this issue, which might be due to something other than the plug-in; see my answer above to sharkbitefischer: a precise list of steps could be useful.

    Ok... Steps:


    - Go to area that I am a "Owner" with "Admin priv" OFF.
    - I can do everything an "Owner" can do.
    - Remove myself from the area completely.
    - I can still do everything an "Owner" can do.
    - Re-log
    - Now can't do anything in the area as expected.


    I have also tried changing things for a non-sever admin player both by setting presets and by individually turning on/off privs with same result.


    As I said above, for a while, the permission changes took affect right away. Not sure why it worked as you see it on your server for a while, but now changes require a re-log on my server again.

  • Ok... something interesting. I had done a restart on my test server for a change that I made and now the permissions DO take a affect right away. Don't understand??


    BTW, I noticed @sharkbitefischer that server admins appear to be able to edit all permissions regardless of whether "Admin priv" is ON or OFF (but permissions are enforced if "Admin priv" is OFF). For Managers, "Admin priv" must be ON for them to edit all permissions.

  • If you go outside all areas to an "open" area and do a "/ap edit" or do "/ap" and click "edit area" it will present you with a list of areas to find the intersecting one that you want to edit... A little "awkward" but works.

    I am aware of this method but it would be handy to have a "go to area edit list" button on the area edit page when inside areas is all I was saying. So we don't have to leave all areas to get the list.



    By "you have" you mean "you, as personal player permissions" or "generic area permissions"?
    The first case is in some circumstances expected: in some circumstances, the API does not tell the plug-in who the player is who planted the TNT and the plug-in has to rely on the generic area permissions (this is described in the manual). The latter is NOT expected.

    I tried this with admin priv on and off and added to the property as admin and owner. I did not try to change the area's base permissions. after loging out and back in the tnt remained with no burning fuse and the tnt could not be removed. I will do more testing of this and give another report.


    After a restart of the server the tnt has disappeared


    area base permissions explosions turned off:
    added to the property as admin and admin priv on tnt lights but does not blow
    added to the property as owner and admin priv on tnt lights but does not blow
    added to the property as admin and admin priv off tnt lights and does not blow
    added to the property as owner and admin priv off tnt will light but not blow
    removed from property and admin priv off tnt will light but not blow
    removed from property and admin priv on tnt will light but not blow


    area base permissions explosions turned on:
    added to property as owner and admin priv off tnt will blow
    added to property as owner and admin priv on tnt will blow
    added to property as admin and admin priv off tnt will blow
    added to property as admin and admin priv on tnt will blow
    removed from property and admin priv off tnt will blow
    removed from property and admin priv on tnt will blow


    it seems that area base permissions over ruel the player permissions and admin priv





    ditto for me on this.



    The general "Go to Area" button is only two mouse clicks away (only one more than having the button in the Area Properties dlg box itself): press "UPDATE" and then press "Go to Area" in the main menu.
    After having thought about it, I prefer to have to press the "UPDATE" button explicitly.

    and what I mean by go to area list is the list of areas that you get when you exit all areas and hit edit area. A direct link to that list would help when in a claim inside another claim when attempting to edit the secondary area.
    The list to choose what area to edit.

  • Ok... something interesting. I had done a restart on my test server for a change that I made and now the permissions DO take a affect right away. Don't understand??


    BTW, I noticed @sharkbitefischer that server admins appear to be able to edit all permissions regardless of whether "Admin priv" is ON or OFF (but permissions are enforced if "Admin priv" is OFF). For Managers, "Admin priv" must be ON for them to edit all permissions.

    this is probably the problem with managers not being able to edit player permissions without being added to the property. An admin has to turn on admin priv for them. lol

  • Ok... something interesting. I had done a restart on my test server for a change that I made and now the permissions DO take a affect right away. Don't understand??


    BTW, I noticed @sharkbitefischer that server admins appear to be able to edit all permissions regardless of whether "Admin priv" is ON or OFF (but permissions are enforced if "Admin priv" is OFF). For Managers, "Admin priv" must be ON for them to edit all permissions.

    same thing happened to me. now the permissions are updateing properly.

  • 1) Explosions:

    [about explosions] it seems that area base permissions over ruel the player permissions and admin priv

    This is precisely what I have said above:

    in some circumstances, the API does not tell the plug-in who the player is who planted the TNT and the plug-in has to rely on the generic area permissions.

    as there is no player for whom to check permissions or level.


    2) Immediate permission update:

    Ok... something interesting. I had done a restart on my test server for a change that I made and now the permissions DO take a affect right away. Don't understand??

    Do you mean that so far you replaced the plug-in with another version without restarting the server? It does not surprises me it was not working: chances are that, as far as the plug-in was concerned, the players did not result logged in at all and therefore their permissions were not updated.


    Can we consider this issue solved?


    3) Go to area:


    Perhaps I do not understand the point: why the current "Go to Area" command is not suitable? Do you require a special "Go to Area" command? Under which circumstances?

  • I am not talking about teleporting to an area I am talking about being able to edit an area that is within another area. The auto going to the area's edit page only works for the main area. It will list the sub area but not adjust it's permissions until you go to that area's permission edit page manually. To do this we have to leave all areas to gain access to the inside areas permissions edit page through the long list before we can adjust player permissions for the smaller area. The long list is what I want a shortcut to from the base permissions page without having to leave all areas and reopen the AP and go to the list of areas in edit. A sortcut to the main area list for edit is what is desired.


    I may be having a brain fart. Let me test something.


    Yes, I have to leave both the inner area and the outer area and pick the smaller area from the area list for edit to be able to see the players added to the smaller area and alter there permissions. I would like a shortcut to the area list for edit from the base area edit page when you are in an area.

  • Do you mean that so far you replaced the plug-in with another version without restarting the server? It does not surprises me it was not working: chances are that, as far as the plug-in was concerned, the players did not result logged in at all and therefore their permissions were not updated.


    Can we consider this issue solved?

    No, of course I restarted the server with the updates to the plug-in. What I'm saying is that the permission changes were not happening without a relog, then after a restarting the server (for other reasons) they started working without having to relog.


    I'm not sure if this can be closed or not. It appears that for some reason (not sure why yet) the "real time permission changes" stop happening, although a server restart seems to clear it up. Just have to let the test server keep running without restarts and see if the issue starts up again. Probably not an issue on my actual server as I do restarts ever 6hrs anyway.

  • BTW, I noticed @sharkbitefischer that server admins appear to be able to edit all permissions regardless of whether "Admin priv" is ON or OFF (but permissions are enforced if "Admin priv" is OFF). For Managers, "Admin priv" must be ON for them to edit all permissions.

    Nevermind... Even server admins can not edit all permissions unless "Admin priv" is ON. The only difference is that a server admin can turn "Admin priv" ON/OFF, but Managers can't.

  • Nevermind... Even server admins can not edit all permissions unless "Admin priv" is ON. The only difference is that a server admin can turn "Admin priv" ON/OFF, but Managers can't.

    and on your test server they are default off :)


    It would be nice to have the admin priv on/off be personal rather then global and just have the managers be on. Manager is intended for a temp position and an admin can always remove the manager's status, I believe. Just a thought.

  • and on your test server they are default off


    It would be nice to have the admin priv on/off be personal rather then global and just have the managers be on. Manager is intended for a temp position and an admin can always remove the manager's status, I believe. Just a thought.

    Actually the default is set to ON, but sometimes I forget to turn it back ON after "debugging" before I leave the server. As long as server admins remember to turn it back ON after "debugging", this really not an issue. In "normal" use of this plugin, there wouldn't be much need to turn it OFF. For me, I don't plan to use "Managers" anyway. If I trust a player enough to be a "Manager", I probably want them as a server Admin anyway.


    It would be "nice" if the "Admin priv" ON/OFF would be a per Admin/Manager setting and not global, but this in my "nice to have" list.

  • I'm not sure if this can be closed or not. It appears that for some reason (not sure why yet) the "real time permission changes" stop happening, although a server restart seems to clear it up. Just have to let the test server keep running without restarts and see if the issue starts up again. Probably not an issue on my actual server as I do restarts ever 6hrs anyway.

    Ok. There is still something going on here.


    My test server was running all night after having done a restart and getting the permissions to work "real time" (no relog needed). This morning I logged in and now the permissions again do not take affect until the player relogs. I think this, for some reason I do not understand, happens with some time with the server running without a restart. The other potential is the server running for a while with no activity. There are not players joining my test server regularly. The other interesting thing is that other plugins to include @Minotorious's Server Tools and Mailing_Syserm start not acting correctly as well! His "/st lastonline <playername>" and /mail lookup <string>" start not finding any palyers! No idea why, but it appears that on server that is not "active", something causes these issues??

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!