[INACTIVE][SEC] OwnBlocks v10.0 - Players may not break blocks placed by others [860]

Discussion in 'Inactive/Unsupported Plugins' started by cvenomz, Apr 19, 2011.

  1. Offline

    cvenomz

    OwnBlocks:
    Version: v10.0

    (7-10-2011) - Please see the latest branch of OwnBlocks, called OwnBlocksX. It is recommended you use OwnBlocksX now.

    OwnBlocks keeps track of placed blocks, and who placed them. Players are not allowed to break blocks placed by other players. Note however, that indirect breaking may still occur (i.e. fire, tnt).

    Features:
    • Blocks you place cannot be broken by others
    • Persistence; Server remembers who owns what blocks after a restart or "reload"
    • Toggleability! Use /ownblocks or /ob to toggle OwnBlocks on and off
    • Ability to exclude certain blocks from being protected
    • Support for Permissions AND non-Permissions servers
    • Auto-saving intervals for database protection
    • Add (pre-placed) blocks to the database manually
    Download OwnBlocks v10.0



    please note - If you are using iConomy, only version 4.6 is currently supported.

    Source Code
    OwnBlocks is released under the WTFPL License.

    Config File Options:
    Please note that at any time you may move/rename/delete you config file, and restart your server to produce the example/default config file with these options pre-filled along with descriptions. Also remember that lines preceded by a '#' are comments, and are ignored.
    exclude - enter comma separated integers of block-ids you wish to exclude from being protected and entered into the database. An example would be to enter the block-id for saplings, so planted trees do not have a single log at the bottom that is protected when a tree is harvested by another player.
    iConomy - enter an integer greater than '0' (zero) to enable. The number entered becomes the 'Basic Rate' at which players are charged to place protected blocks. Players will not be able to place blocks if they have insufficient funds.
    debug - If you are experiencing errors, and want to post them here to resolve them, or just want to spam your server log with information, set debug equal to 'true'
    status-message - Set this to 'disable' to not receive the message "[Username] - OwnBlocks is now activated for you....". Set this to 'simple' to receive a simple "OwnBlocks activated/deactivated" instead. Lastly, set this to 'disable' to disable messages entirely. Now that I think of it, disabling status-messages seems like a really bad idea......but the choice is yours.
    save-interval - Enter the number of seconds specifying the interval between database saves. The default is 60 seconds. Increase this number if you have an obscenely large database that takes a long time to write to disk. Decrease this number if you are paranoid and/or have very fast disk IO.
    info-id - Enter the integer representing the ID of the material or tool you would like to use as your "information tool" which will display the Owner of a block you right click with specified tool. Default is 269, which is the wooden shovel.
    add-id - Enter the integer representing the ID of the material or tool you would like to use as your "add tool" which will add the block you left click with the tool to the database. Default is 268, which is the wooden sword.
    enabled-on-login - True means that OwnBlocks is automatically activated for every player as soon as they log in. False means that OwnBlocks must be activated manually by each player when they want to start building protected blocks.


    Permissions Nodes:
    You will need to add these nodes to your Permissions configurations if your server uses Permissions:
    'OwnBlocks.ignoreOwnership' - Allows player to break blocks placed by others. This node is typically given to admins.
    'OwnBlocks.use' - Allows a player to even use OwnBlocks. If you want everyone to be able to protect blocks with OwnBlocks, and assuming you have a "normal" Permissions configuration, then add this node to your "default" class.
    'OwnBlocks.info' - Allows a player to use the info-tool to display who owns a protected block.
    'OwnBlocks.add' - Allows a player to use the add-tool to add blocks to the database for protection.


    Changelog:
    • Version 10.0 (5-20-2011)
      • Added configuration to set whether OwnBlocks is activated for players upon login
      • Added tool to add pre-built blocks to the protection database
      • Improved process of saving database
      • Fixed status-message configuration options (inconsistent verb tense)
      • Default to protecting all blocks when Permissions is not detected
    • Version 9.0 (5-5-2011)
      • Added support for Servers without the Permissions plugin
      • Added 'OwnBlocks.use' and 'OwnBlocks.info' nodes
    • Version 8.2 (5-4-2011)
      • Fixed NullPointerException when right clicking with empty hand
    • Version 8.1 (5-4-2011)
      • Added ability to use tool to display who a block belongs to. use info-id in your config file
    • Version 7.0 (5-3-2011)
      • Added database auto-saving intervals
      • Added ability to enable/disable 'status message'
    • Version 6.5 (4-29-2011)
      • Added iConomy support for charging a basic rate for each block placed
      • Added config option for debug mode
    • Version 5.0 (4-23-2011)
      • Added Permissions Integration :)
      • I think I fixed a bug that occurred when the 'reload' command is issued
    • Version 4.0 (4-23-2011)
      • Added properties file (/plugins/Ownblocks/OwnBlocks.properties)
      • 'exclude'
      • Blocks are now removed from database when broken by their owners
    • Version 3.0 (4-22-2011)
      • Added the ability to toggle OwnBlocks on and off
      • Added commands: /ownblocks or /ob
    • Version 2.0 (4-21-2011)
      • Moved data directory from main folder to the plugins folder
      • Added/fixed serialization (Persistence)
      • Made database searching more efficient
    • Version 1.0 (4-20-2011)
      • Initial Testing Release
    ToDo: Should there be continued interest in this plugin, I will consider looking into:

    • MySQL support
    • Support for group projects
    • Add configuration option to prevent "adjacent construction", where a player builds blocks on blocks owned by another player
    • Add support for Metadata values
    • Area Selection
    • Update this iConomy shenanigans.
    • Look into solution for chest protection
    • Add command to check the database for blocks that have become air because they were deleted externally by something like WorldEdit
    [​IMG]
     
  2. Offline

    Mercury

    Waiting for iCon 5 support.

    What happens if you build house and someone blocks your path to it with his blocks?
    Yes, I would like to give out that permission for all players, no exceptions.

    Maybe it would possible that near protected block (Player A), can't place another block by Player B.
     
  3. Offline

    bruceweed

    Sweeeeeet sounds good man!
     
  4. Offline

    EscoN2

    If possible
    Can you make it compatible with world edit :D?I Know is difficult but..is worth the ask.?Cus i like making my walls with the WAND not all of the walls.But some when they gonna be huge.People can just break in from other ways i made with ^^^ :/.
     
  5. Offline

    cvenomz

    I have good news and bad news.

    The GOOD news!
    It seems that I have successfully made a database conversion utility!
    It is converting a database right now!

    The BAD news!
    It is still converting the database right now!
    It is a longish story, so here is the shortened version
    Unfortunately, due to design choice I made for the original OwnBlocks database format, you cant just pull the coordinates from each protected block. So, in order to add each block to the MySQL database, you have to essentially bruteforce each protected block.
    The speed at which this is accomplished is dependent on A) the number of blocks in total that are protected, and B) How far away these blocks are from the origin.
    A sample database pulled from a working environment with roughly a quarter of a million blocks is at ~2.17% after running for ~20 minutes.
    So....yeah....

    To end on a happier note, this conversion process can take place while the minecraft server is running as long as no one is placing more protected blocks if the server is not running OwnBlocksMySQL, or if the server is running OwnBlocksMySQL, people will be able to add protected blocks, its just that blocks further away from the origin may take a while to become protected again.

    Ill keep you guys updated as to how this goes.

    EDIT: ~7.5% at ~2hrs
    ~13.4% at ~3hrs
    ~23.9% at ~5.5hrs
    ~55.4% at ~17hrs
    ~95.4% at ~37 hrs
    done at ~38 hrs
     
  6. Offline

    Random123

    Thanks!
    Can you make a tool that unregister a block?
     
  7. Offline

    JesterB

    I think having the override permission and breaking the block should do this? But it would be handy to be able to unregister without breaking.

    And not to kick an old horse, but iConomy 5 support will make this the most useful plugin evar. I eagerly await the day!
     
  8. Offline

    vasil7112

    For the new version???of bukkit!!
     
  9. Offline

    cvenomz

    So it seems that the import tool finished. If my dropbox will ever sync, then this should be the link. just run the program from the command line. like:
    Code:
    java -jar OwnBlocksDatabaseConverter.jar
     
  10. Offline

    bruceweed

    Well this sucks, now I'm getting this problem...

    Code:
    2011-07-01 12:12:37 [SEVERE] [OwnBlocks] Failed to add block.  Probably SQL error
    2011-07-01 12:12:37 [SEVERE] java.sql.SQLException: Data truncated for column 'world' at row 1
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662)
    2011-07-01 12:12:37 [SEVERE]     at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
    2011-07-01 12:12:37 [SEVERE]     at me.cvenomz.OwnBlocks.MysqlDatabase.addBlock(MysqlDatabase.java:76)
    2011-07-01 12:12:37 [SEVERE]     at me.cvenomz.OwnBlocks.MysqlBlockListener.onBlockPlace(MysqlBlockListener.java:87)
    2011-07-01 12:12:37 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader$27.execute(JavaPluginLoader.java:427)
    2011-07-01 12:12:37 [SEVERE]     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    2011-07-01 12:12:37 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    2011-07-01 12:12:37 [SEVERE]     at org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:90)
    2011-07-01 12:12:37 [SEVERE]     at org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:74)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.ItemBlock.a(ItemBlock.java:82)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.ItemStack.placeItem(ItemStack.java:56)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:226)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:563)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.Packet15Place.a(SourceFile:57)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    2011-07-01 12:12:37 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    EDIT: Nevermind LOL fixed the problem
     
  11. Offline

    Mercury

    cvenomz, When will be there official version of MySQL and iConomy 5?
    Thanks. Keep up the good work!
     
  12. Offline

    prefix

    Works great with newest bukkit for 1.7.2 :) Only it doesnt protect extended pistons. You have to manually add it while its extended or other people can extend it and destroy it :)
     
  13. Offline

    sterg

    doesnt work with pistons :(
     
  14. Offline

    Comrade Dmitri

    I'm scared to turn my server to public because half of my city was created before I got OwnBlocks
     
  15. Offline

    sterg

    use worldguard
     
  16. Offline

    cvenomz

    Interesting idea, hadnt thought of that before.
    Hmm, can't say for sure. I will say though, it doesnt seem that there are any problems with the current MySQL pre-release. If it stays that way for a little longer, then the only thing that may change will be just tidying up the code a little bit before making the 'official' release. Once MySQL behaves, then I will work on iConomy 5. I know people have been asking to have that updated for a while now :(
    Glad to hear it. Thanks for letting us all know :)
    Yeah :( I realized just the other day that pistons are going to completely screw up everything. Maybe once bukkit adds piston API calls then we can work out some solutions.
    I hope to some time soonish add the ability to select large regions and add them to the OwnBlocks database that way. Maybe that will help you out. EDIT: Or yes, as sterg said, you could try WorldGuard
     
  17. Offline

    Comrade Dmitri

    I fixed it. Thanks sterg.
     
  18. Offline

    Mercury

    I just want to know if you will release update before 9 July. I'll be gone for a long time and i am setting plugins for my server now.

    :)
     
  19. Offline

    Eth0

    Hey

    its work to god :)

    is i posseble to add a friend. so 2 players can build toghter and remove there friends blocks?
     
    Mercury likes this.
  20. Offline

    Mercury

    I support. :)
     
  21. Offline

    Random123

    Can you please read the whole thread before posting??
     
  22. Offline

    korin125

    Need iConmy 5 support :s
    Either my server will be griefed without this or my players will be able to protect for free :(
     
  23. Offline

    bruceweed

    I would look into possibly making this a little easier on MySQL databases, for an example.

    Some hosters cap a size limit on the database, and 50000 blocks is around 5-6mb. With a 50 person server that can grow FAST. I doubt there's a way to decrease it but it's ok.
     
  24. Offline

    cvenomz

    I dont think this is possible. This is just the nature of logging every block players place and protect.


    So, anyone been trying the database converter tool? How is it working?
     
  25. Offline

    Mercury

    For me its nothing to try because I have fresh server and waiting for fresh OwnBlocks update :)
     
  26. Offline

    Hacr

    Looking forward for the new update :)
     
  27. Offline

    Mercury

    cvenomz, time is running out for me. If I use MySQL version v0.2. And I'll start using that, will you support that version in further?
     
  28. Offline

    cvenomz

    Yes. And, there should be no significant functionality changes from v0.2 to the "official" release version
     
  29. Offline

    Mercury

    Thank you.
     
  30. Offline

    Mercury

    I am using MySql v0.2 and everything is cool.
     
  31. Offline

    ghost15

    Guess I'm glad I was reading the thread to see if your still working on OwnBlocks (Great plugin btw!). I'm running mySQL for a other plug-ins and glad to see your moving to it too. (Sometimes your plug-in is writing to it's database when my backup script runs which makes it fail)

    Since you didn't update your first post with information, anything special or specific post I should look for on how to migrate from Existing OwnBlocks (flat-file) to the mySQL version? Very interested in this version and helping test!
     

Share This Page