[Plugin]WorldProtection (Auto area protection script)

    We've posted a status update with some first screenshots of the new terrain generation. There is also a new update available for the Java version!

    • Sneaky_Koala wrote:

      Cheers Yahgiggle - works a treat.

      Is there anyway you can create an equivalent of /showareas /hideareas? Probably not or I'm guessing you'd have implemented it but just throwing it out there :)

      I know it displays the name of the owner down the bottom - but I'm in a situation of wanting to protect a bunch of different areas that were built before I installed the plugin and I have to keep backtracking to see if I've missed anything heh.
      Sorry but how the database is setup i cannot do this oO maybe i could add this but you would needed to re protect the areas over ?

      sharkbitefischer wrote:

      I am trying your plugin on single player. It seems to be working.
      That is Awesome :D

      sharkbitefischer wrote:

      -I remember something being said about it being able to read the area protection data base? Do I just move the data base into the world protection folder?
      That's sort of right i have been adding the code for this plugin to be able to also do what the old area protection did, but once finished you will be able to copy your old area database over and this plugin will take over, but ATM its not ready.

      sharkbitefischer wrote:

      '2-Also when you turn off the auto protection then you can set the areas by hand like the old way? also what are the commands to create the area by hand?
      once the old area protection code that i am adding is working your be able to do both. ATM the button to turn off auto area just turns it off for one player the player that is using it

      sharkbitefischer wrote:

      3-It would also be nice to have a text file in the zip folder giving instructions and the command list in it.
      i don't see the point to this when it has on screen instructions just push the key p anytime oO maybe you could let me know why this text file would be good

      sharkbitefischer wrote:

      4-I also need it to read the old data from areaprotection for me to be able to use this on my server, there are just to many claims to have to reset them all.
      yep as i said above, that is the plan :)

      sharkbitefischer wrote:

      5-also do we have different groups like in area protection restricting access to different objects or does this just protect land plants and blocks and we use object and furnace protection for the other stuff? and if we don't use the other protections , how do we allow access to just 1 chest or door or crafting table or furnace to others like in object and furnace protection?
      ATM there is no groups everything that can be protect is protected, you have to also understand that the API has limits ATM its still been worked on and why red51 has not taken the old lua script system away, i am finding limitations just about everyday, some i work around and others i report to red51 he then has to test or look in to it and then code it too, this can take weeks oO but its realy getting there now.

      sharkbitefischer wrote:

      6-also when you turn off the auto claiming does it stay off and is it for everybody?'
      As above, its only for the one player, maybe i should add a admin button that can disable everyone, but i dont see the point in this plugin if you do this.

      sharkbitefischer wrote:

      7-also can this be made to work with multiple worlds? It would be nice for private servers that have more then 1 world they switch between to not have the protected areas from the previous world show up.
      i could do this but would need a reliable server that has good internet connection, but if that server went down everyone's areas would become unprotected oO also you would get database connection errors, so its not something im going to add because of the risks

      sharkbitefischer wrote:

      8-and the plug in is still showing a lot of red errors on startup in the chat window.
      could you please post your error log, i no longer get any errors so with your help we can find out whats going on, you can use pastebin.com/

      sharkbitefischer wrote:

      9-and I agree with Sneaky_Koala that we need a /showareas and a /hideareas function to be able to see where other claims are even if you are using the auto claim function. Especially on large servers.
      yes i some what agree too in hindsight i should have coded that in, but with how this is setup i cannot do this without making everyone re add there areas oO

      sharkbitefischer wrote:

      10-some of my claims go all the way to hell and reach to the building limit in the sky. How hard is it to set such a claim that is like 180x1200x180 blocks?
      very hard because this code works on chunks the game is made up of block area chunk areas and Areas areas, to make it simple for the user i took the PlayerEnterChunkEvent and turned it into a area i can protect but the area is preset by the game, you cannot change it, but it turns out a chunk area is a good size for auto area protection i think 16x64x16 x y z

      sharkbitefischer wrote:

      11- On a survival server, with economy intended in the near future, where land becomes a commodity and the admins are basically real estate agents, removing credits from the system, manual commands, not automatic are needed.
      i don't know what your mean ^^ :whistling:


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S

      The post was edited 1 time, last by yahgiggle ().

    • yahgiggle wrote:

      Sneaky_Koala wrote:

      Cheers Yahgiggle - works a treat.

      Is there anyway you can create an equivalent of /showareas /hideareas? Probably not or I'm guessing you'd have implemented it but just throwing it out there :)

      I know it displays the name of the owner down the bottom - but I'm in a situation of wanting to protect a bunch of different areas that were built before I installed the plugin and I have to keep backtracking to see if I've missed anything heh.
      Sorry but how the database is setup i cannot do this oO maybe i could add this but you would needed to re protect the areas over ?

      Ahh well nevermind. I've done it all now anyway (there was bugger all really heh).

      I note in one of your responses to shark you said: "..i have been adding the code for this plugin to be able to also do what the old area protection did".

      Once done this would be the perfect 'one stop shop' plugin. The only problem with the autoprotect is it works well until someone new to the game bundles along and starts building right alongside where you've temporarily finished but wanted to extend some days later. I guess I could have placed random blocks extending outward to where I wanted to build to, but then there'd be a lot of chucks in the world with just a single block in em if everyone else did the same. It also means there is no real 'buffer' like there is with areaprotect because even placing blocks to where I wanted to build someone could build a parapet right up against my final wall.
    • Sneaky_Koala wrote:

      yahgiggle wrote:

      Sneaky_Koala wrote:

      Cheers Yahgiggle - works a treat.

      Is there anyway you can create an equivalent of /showareas /hideareas? Probably not or I'm guessing you'd have implemented it but just throwing it out there :)

      I know it displays the name of the owner down the bottom - but I'm in a situation of wanting to protect a bunch of different areas that were built before I installed the plugin and I have to keep backtracking to see if I've missed anything heh.
      Sorry but how the database is setup i cannot do this oO maybe i could add this but you would needed to re protect the areas over ?
      Ahh well nevermind. I've done it all now anyway (there was bugger all really heh).

      I note in one of your responses to shark you said: "..i have been adding the code for this plugin to be able to also do what the old area protection did".

      Once done this would be the perfect 'one stop shop' plugin. The only problem with the autoprotect is it works well until someone new to the game bundles along and starts building right alongside where you've temporarily finished but wanted to extend some days later. I guess I could have placed random blocks extending outward to where I wanted to build to, but then there'd be a lot of chucks in the world with just a single block in em if everyone else did the same. It also means there is no real 'buffer' like there is with areaprotect because even placing blocks to where I wanted to build someone could build a parapet right up against my final wall.
      well you don't need to add blocks or build to expand your area, you can just click the p key and click the button add area

      if you feel someone is taking over land you need talk to them in a nice manner and ask them to give you a little more room, i guess some users will take land and your never see them back, if this happens you could ask a admin to remove the unwanted areas, i feel this is better than getting admins to protect your areas because we can all wait for something to be unprotected but waiting for something to get protected can end up been more of a pain.

      btw there is a bug with the buttons that i am working on fixing, it seems the guestbook red51 made has the same problem, and that's that the buttons stop working when another player logs off the server oO to re-enable them you will need to leave the server and come back.


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • sharkbitefischer wrote:

      sorry I removed all plugins and ran this along side area protection script and it checks out fine. no errors. Now I am on a hunt to find what is kicking the errors out.
      if you run the auto level up plugin, that one has a error that i need to fix, well the error is not that important its nothing, but it does need to be fixed, its to do with how the plugin does not work for admins some parts do work, and lets just say those parts try to look up some admins info and it returns null then gives the error, but of cause its null because admins don't level up, other than that i don't know why you would be getting errors if you would like me to look at your error report i can help you at lest pin point the plugin that gives you the error.


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • yahgiggle wrote:

      well you don't need to add blocks or build to expand your area, you can just click the p key and click the button add area
      if you feel someone is taking over land you need talk to them in a nice manner and ask them to give you a little more room ..

      <snip>

      Ahh of course - p key; add area - *facepalm*

      Re other people, I think building right up close might be inadvertent (and why it's probably people new to the game doing it).. they bundle along, find a spot, and start building without fully looking what's around or even fully understanding what's going on.. granted I only had a foundation down so it didn't really stand out.
    • to repeat it here your world protection has a hole in it. I can empty chests that are protected on your server. Are you not aware of the glitch that plegs even your area protection lua? I would describe the prosess here if it wouldn't tell everybody how to do it. I would not be surprised if I can get around your chest protection and object protection plugins, too, with the same glitch. This is a very old glitch that was found way back in last may in your areaprotection lua and it seems to have followed you through your new plugins. Chests are not safe!
    • sharkbitefischer wrote:

      to repeat it here your world protection has a hole in it. I can empty chests that are protected on your server. Are you not aware of the glitch that plegs even your area protection lua? I would describe the prosess here if it wouldn't tell everybody how to do it. I would not be surprised if I can get around your chest protection and object protection plugins, too, with the same glitch. This is a very old glitch that was found way back in last may in your areaprotection lua and it seems to have followed you through your new plugins. Chests are not safe!
      we can not fix the glitch with out knowing what your doing to do it, oO could you message me the info on steam cheers :)

      Btw my new world protection wont even let you open the chest to take anything out, well it shouldn't anyway lol


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Minotorious wrote:

      it is the split stack picking from chests thing but the API does not intercept that event yet (should be included in the chestToInventoryEvent I think) :(
      oh yes of cause oO but that is impossible to do if you cant even open the chest in the first place oO witch is how world protection works

      PlayerObjectInteractionEvent event event.setCancelled(true);


      Source Code

      1. @EventMethod
      2. public void onPlayerObjectInteraction(PlayerObjectInteractionEvent evt) throws SQLException{
      3. Player player = evt.getPlayer();
      4. String Playername = player.getName();
      5. player.setListenForObjectInteractions(true);
      6. Definitions.ObjectDefinition definition = Definitions.getObjectDefinition(evt.getObjectTypeID());
      7. if(definition.isChest()){
      8. int chestID = evt.getObjectInfoID();
      9. Database database = getSQLiteConnection(getPath() + "/" + "database.db");
      10. try(ResultSet result = database.executeQuery("SELECT * FROM `Chest` WHERE `ChestID` = '"+ chestID +"' AND `ChestName` = 'Owner'")){
      11. // lets test the result
      12. if(result.next()){
      13. String lockinfo = result.getString("Locked");
      14. String Owner = result.getString("PlayerName");
      15. evt.getPlayer().sendTextMessage("You Just Opended Chest ID"+ chestID +" owned by "+ Owner +" Stasis "+ lockinfo +", type /cp for help");
      16. return;
      17. }
      18. }
      19. evt.getPlayer().sendTextMessage("opened chest ID" + chestID + "");
      20. }
      21. }
      Display All


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S

      The post was edited 1 time, last by yahgiggle ().

    • Love the plugin so far, would love the show/hide feature, but i do understand the issue(s) where that is concerned.

      would/will it be possible to have the WorldProtection Plugin run automatically w/ ranks? What i mean is have the limit of areas automatically adjust to match a preset limit for a rank
      (ex. guest 0 area, rank1 36 areas, rank2 81 areas...etc) kinda like the way permissions are set.
    • Savage1der wrote:

      Love the plugin so far, would love the show/hide feature, but i do understand the issue(s) where that is concerned.

      would/will it be possible to have the WorldProtection Plugin run automatically w/ ranks? What i mean is have the limit of areas automatically adjust to match a preset limit for a rank
      (ex. guest 0 area, rank1 36 areas, rank2 81 areas...etc) kinda like the way permissions are set.
      ive been thinking and talking about this with other players on my own server, i think it is possible to add some type of (if in group then area limit = setlimit for that group) in fact soon the database in this plugin wont work with the next RW update , so its sad to report all areas will need re protecting oO not such a big deal realy unless you have 1000s lol anyway now will be a good time for me to add the option for seeing your areas like Show Areas


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Bump

      the plugin has been updated

      The updated database will now support the changes coming up to the API

      this means you can use this plugin now but you still need to remove the old database and start over

      also because i had to make adjustments to the database i decided this would be the right time to add

      /wpp showareas
      /wpp hideareas
      /wpp showallareas

      also when you are laying areas the area will light up green for 2min then go clear this lets you run around adding areas and see the ones your adding as you add them

      if you only want to add one area but want the green area gone just type /wpp hideareas


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S

      The post was edited 2 times, last by yahgiggle ().

    • devyn wrote:

      Been folowing closely and i like what i'm seeing,

      Was thinking a way for admins to see a list of protected areas, who they belong to and teleport to those areas would be handy

      would that be hard to implement?

      Thanks
      DEvyn
      that's ^^^ on the to do list admins will be able to do /wpp list areas /wpp list yahgiggles areas /wpp tp areaid <--- teleports to the area with that id

      this should be added very soon. another option im going to add is by hitting the keys r and c for r you can remove a area you are inside and own and c you can claim the area you are inside if no one owns it.


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Is there anyway for admins to default the Auto Claim being "on" and changing it to "off". The reason i ask is that i have this plugin on my server and a "troll" came on and was just running around auto claiming land for no reasons. If it was defaulted or even able to be switched to off this would help server owners/admins a lot. Of course the user would then be able to manually add areas to their claim as per normal.
    • Lucky7s wrote:

      Is there anyway for admins to default the Auto Claim being "on" and changing it to "off". The reason i ask is that i have this plugin on my server and a "troll" came on and was just running around auto claiming land for no reasons. If it was defaulted or even able to be switched to off this would help server owners/admins a lot. Of course the user would then be able to manually add areas to their claim as per normal.
      trolls are always going to be a pain

      go into the area a troll has made and type /wpp delete all username

      this command removes all his areas in one go

      for turning off the auto protection only users can do this, i see no point in letting admins turn off all users been able to add areas but i am going to add groups so group A gets a set amount of areas and group B gets another amount

      if you realy want to turn off the areas now you can turn down the limit to 0 /wpp set limit 0

      then when your on set it back up this wont remove any areas from your added areas so its safe to do


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Bump

      Updated plugin

      can now teleport

      /wpp listallareas lists all the areas so you can get there IDs
      /wpp tp ID teleports you to the center of the given area with that ID

      /wpp areatp ID teleports you to the ground level above or below an area


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S

      The post was edited 1 time, last by yahgiggle ().