[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

    cvenomz

    Great. Please let me know if it starts acting up, or if there is anything you would like to see changed for the next version. (This goes for everyone who is testing)

    Thanks. And I greatly appreciate your interest in helping out. Links: Migration information, Migration tool, MySQL version information (dont get v0.2), and post for v0.2.1
    I couldnt find where I mentioned this (or if I didnt) but you need to add/edit four lines to your new config file. I think it is generated automatically, and you just need to edit it after you run it once.
     
  3. Offline

    Mercury

    Oh God i had SQL errors. :(
    Installing o.2.1 ...
     
  4. Offline

    cvenomz

    Introducing- OwnBlocksX! with MySQL support and iConomy 5 support!
    I plan to maintain the new plugin OwnBlocksX with newer features and such, but leave the option for smaller servers to use the original OwnBlocks.
     
  5. Offline

    ghost15

    Hi Cvenomz,

    Thanks for the information, I tried running the converter you provided but i'm getting the following error,

    C:\Users\Administrator\Downloads>java -jar OwnBlocksDatabaseConverter.jar
    Failed to load Main-Class manifest attribute from
    OwnBlocksDatabaseConverter.jar

    Should I be placing this jar somewhere special?

    Server is running x64 Java if that matters.
     
  6. Offline

    cvenomz

    Eek, sorry. It seems I forgot to make the jar executable. I replaced the bad jar with a new good one. Try re-downloading, and running it again.
     
  7. Offline

    PyPKjE

    Good plugin to prevent destroying the server, but there is one big drawback, you should do, that they can not build on the block is another person's private
     
  8. Offline

    ghost15

    So now it launches, but I'm getting a null-pointer exception, see the output below, password masked only.

    Show Spoiler

    C:\Users\Administrator\Downloads>java -jar OwnBlocksDatabaseConverter(2).jar
    This is the OwnBlocks Database Converter version: 0.1.1
    This utility will input your OwnBlocks flatfile data into a MySQL database
    If you know what you are doing, press enter to continue

    I am now going to ask for your MySQL information

    Please enter your database host: localhost
    Please enter your MySQL database name: minecraft
    Please enter your MySQL account username: minecraft
    Please enter your MySQL account password: *****
    There was an error connecting to the MySQL database
    with the information you provided.
    Print Stack Trace? (yes/no) : yes
    java.lang.NullPointerException
    at me.cvenomz.OwnBlocks.MysqlDatabase.establishConnection(MysqlDatabase.
    java:38)
    at me.cvenomz.OwnBlocksDatabaseConverter.OBDBConvert.connect(OBDBConvert
    .java:82)
    at me.cvenomz.OwnBlocksDatabaseConverter.OBDBConvert.main(OBDBConvert.ja
    va:35)
    I am now going to ask for your MySQL information

    Please enter your database host: 127.0.0.1
    Please enter your MySQL database name: minecraft
    Please enter your MySQL account username: minecraft
    Please enter your MySQL account password: ******
    There was an error connecting to the MySQL database
    with the information you provided.
    Print Stack Trace? (yes/no) : yes
    java.lang.NullPointerException
    at me.cvenomz.OwnBlocks.MysqlDatabase.establishConnection(MysqlDatabase.
    java:38)
    at me.cvenomz.OwnBlocksDatabaseConverter.OBDBConvert.connect(OBDBConvert
    .java:82)
    at me.cvenomz.OwnBlocksDatabaseConverter.OBDBConvert.main(OBDBConvert.ja
    va:35)
    I am now going to ask for your MySQL information

    Please enter your database host:


    I'm assuming if I managed to mistype the password twice I'd get a different error in the stack trace (Login Failed). The MySQL is running locally (the Jar, Minecraft Server, and MySQL are on one box)
     
  9. Offline

    Gules1

    I don't know how can I add preplaced blocks.
    Also entering The Nether made my database crash, there's no MultiWorld support.
    And I can't use OwnBlocksX because of the MySQL, I don't know how to install OBX (the crafbukkit can't load plugin).
     
  10. Offline

    cvenomz

    Bah! I left a line of code in there from the actual plugin that breaks the converter, and I forgot to take it out. I updated the download again.

    You have to use the add tool. this is by default the wooden sword, and you must have permissions to the OwnBlocks.add node, or if you dont have permissions installed, you must be OP. It would be helpful if you posted your craftbukkit error. I didnt think this was a problem
     
  11. Offline

    ghost15

    Got it running now, looks good. Noticed you updated the database to be the 'ownblocksx' so I don't have to do anything to upgrade when it's imported. Thanks for working through the little bugs in the migration code! I'll Update/Reply once I see how long it takes, I have 103,405 blocks protected, and I'd guess its processing about 10 per second.

    Update1: Seems like its slowed down quite a bit. about 50% done now. Maybe it's worth multi-threading the importer to speed things up? Prompt for # of threads, and use that as a magic number for starting the ID list. Get Total Count, and build out the ID lists for each thread, pass that to each thread, and have each thread query the DB for the ID's in it's own list, and process them.
     
  12. Offline

    cvenomz

    Yes, multi-threading would definitely speed things up, but it would be a pain in the butt to write, and it would take longer to write than it would to just import single-threaded. Yes, I am sorry it takes so long :(
     
  13. Offline

    Suembeaux

    does this still work if i were to move a creation done by a person using world edit?
     
  14. Offline

    ghost15

    Yeah, I guess the 'annoying' part is that it's not even using a whole CPU for that thread, total system usage is topping at 30% , no single core going above 35% , usually 20-25%. Still running, almost done. Just sucks having the server down this whole time, but it will be worth it.
     
  15. Offline

    Gules1

    read older posts, solved with World Guard + OwnBlocks

    thank you =D
     
  16. Offline

    cvenomz

    No, the empty void where the creation used to be would retain its protection
    If you are using a quad core, then 25% would be maxing out one core. But yeah, it sucks.
     
  17. Offline

    ghost15

    I'm assuming the import finished, I lost power at around midnight, but I only had about 1k left at around 9:30PM.
    It's on a i7 , so it has 8 Cores, but no single core was above 35% (if Java was being fast, I would have seen 90%-100% on a single core atleast, plus some load on another core from mysql)
    Either way, you have another completed test for your Importer, I've loaded up OwnBlocksX now as well. Haven't had a chance to play around with it but no errors on load. See you in the other thread if something comes up!

    Thanks again for your help with the importer
     
  18. Offline

    cvenomz

    Glad to hear it seems to have worked out. Side note: on multi-core machines, single threaded processes can max out, but hop from one core to the next, so four cores might show %25 each, as it hops from one to the other rapidly. Regardless, I am happy to hear there havent been any problems so far. :]
     
  19. Offline

    Suembeaux


    does the i7 seriously have 8 cores? i thought it was a quad core processor, sincerely wondering, making an important computer purchase soon so i would like all the info i can get.
     
  20. Offline

    ghost15

    as far as i know all i7 series are either Quad or Six-Core w/ HT , making them 8 or 12 Core systems.
     
  21. Offline

    killj0y

    i7 can be found in quad core or six core as mentioned above.. However they offer "Threads" which is what you get 8 and 12 from.. more information can be found via a quick google search
    http://en.wikipedia.org/wiki/Thread_(computer_science)


    As its recommended to use the new ownblocks however do you see any issue to keep using this one?
     
  22. Offline

    CoolAEW

    What about an option like WorldEdit so you can protect a marked Area?
     
  23. Offline

    paralytic

    doesnt let me use at all "Failed to load main-class manifest attribute from file"
     
  24. Offline

    AVirusC

    I just started adding our flatfile into sql and it said the flatfile didn't contain the name of the world and then asked me for the name of the world. I have a bad feeling about this as we have 6 worlds of ownblocks protected blocks. Is it going to smash all these worlds of protected blocks into world1? I'm glad I'm doing this on my test server. =)
     
  25. Offline

    AVirusC

    UPDATE 1:
    Here we are 48 hours later and I'm not even half way. I hope this works out ok because I don't want to have to restart this process!! 412488 of 1322956 rows added to MySQL.

    UPDATE 2:
    4+ days into the import: 678822 of 1322956

    UPDATE 3:
    Well after about 12 days it was taking around 30 minutes per row and halted at around 80000 rows. We decided to just start over on a clean database. I'm sure packing all 6 worlds of protected blocks into world1 wasn't going to work anyway. Thanks for the attempt to make a converter though, would have been nice to have our OB protected blocks in OBX, but no big deal. Our flatfile was just too big for the converter I think. =)
     
  26. how can i delete a block protection or add are area of blocks ?
    And how can I protect WorldEdit created Block automaticly
     
  27. How can I remove a Protection
     
  28. Offline

    TheCamachoNater

    You Should Make this Capable so we can just select the region , then manually protect it. Becuz I Dont wanna waste my time on my server protecting every single block that were placed before i installed the plugin
     
  29. Offline

    halvors

    I will recommend you to make some kind of group support. Lets say groups in PermissionsBukkit can break other group members blocks. :)
     
  30. Offline

    alex22808

    plugin is perfect except from old blocks not being protected, other than that it is perfect and keep up the good work :)
     
  31. Offline

    BatteryAcid

    UPDATE THIS TO 1060!
     

Share This Page