Inactive [SEC/ADMN] OwnBlocksX v0.2.3 - Protect your blocks (MySQL, iConomy 5) [1000]

Discussion in 'Inactive/Unsupported Plugins' started by cvenomz, Jul 10, 2011.

  1. Offline

    cvenomz

    OwnBlocksX - (OwnBlocks eXtended)
    Version: v0.2.3

    OwnBlocksX is a branch off the original OwnBlocks plugin. OwnBlocksX is intended to add support for many features which may not be suitable for the original plugin. Such features include MySQL support (completed), iConomy 5 support (completed), and group project support (in progress).

    See original plugin thread for more information

    Features:
    • Blocks you place cannot be broken by others
    • Ability to exclude certain blocks from being protected
    • Support for Permissions AND non-Permissions servers
    • Add (pre-placed) blocks to the database manually
    Notable Changes:

    -MySQL is now required
    -If you are migrating from OwnBlocks, you will need to convert your database unless you are starting fresh. Here is a helpful link
    -Permissions nodes are now OwnBlocksX.* (note the X)
    -toggle command is now /obx or /ownblocksx
    -New configuration file name and path
    -If you are upgrading from the test builds (OwnBlocksMySQL) then you need to rename your database table from OwnBlocks to OwnBlocksX.If you are using MySQL, the command is:
    "RENAME TABLE OwnBlocks TO OwnBlocksX"

    Download OwnBlocksX v0.2.3
    Source Code
    OwnBlocks is released under the WTFPL License.

    Other Notes:
    If you are having problems, you may need to have the MySQL JDBC driver installed

    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.

    host - enter the MySQL database host. 'localhost' unless you are running the database on a separate server
    databaseName - name of the MySQL database you will use on the MySQL server
    username - the MySQL user with which OwnBlocksX will authenticate with the MySQL database
    password - password for the MySQL user
    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.
    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:
    'OwnBlocksX.ignoreOwnership' - Allows player to break blocks placed by others. This node is typically given to admins.
    'OwnBlocksX.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.
    'OwnBlocksX.info' - Allows a player to use the info-tool to display who owns a protected block.
    'OwnBlocksX.add' - Allows a player to use the add-tool to add blocks to the database for protection.

    Changelog:

    • Version 0.2.3 (8-7-2011)
      • Fixed another permissions bug (OwnBlocksX.ignoreOwnership) [Thanks MineJob!]
    • Version 0.2.2 (8-7-2011)
      • Fixed permissions bug (OwnBlocksX.use) [Thanks Worlther!]
    • Version 0.2.1 (8-3-2011)
      • Fixed bug where enable-on-login did not function
    • Version 0.2 (7-15-2011)
      • Implemented MySQL connection timeout workaround [Thanks ghost15!]
      • Moved tracking of enabled/disabled players to MySQL
    • Version 0.1.1 (7-11-2011)
      • Added message when player tries to break block not owned by them
    • Version 0.1 (7-10-2011)
      • Initial release
      • Added MySQL support
      • Added iConomy 5 support
     
    dark_hunter, Lunthus, Hacr and 3 others like this.
  2. Offline

    VeryInsane

    Looks pro! Just don't know if my survival server will like it or not..
    :oops:
     
  3. Offline

    Hacr

    THANKS ALOT!!

    :D

    Will you be able to make an message when users try to break blocks that are placed by other?

    like:

    [playername] owns this block

    or something like that :)
     
  4. Offline

    cvenomz

    updated for this

    And how long does it take until this gets moved to the Releases section? :\
    It only took OwnBlocks a few hours to get moved
     
  5. Offline

    BasBloem

    Can you add support for blocks being moved by pistons?
    Or is it already in it? :D
     
  6. Offline

    mavbear

    So what happens when a user surrounds another user in blocks, or walls off someone else's house? :S
     
  7. Offline

    Lolmewn

    They call an admin. I guess. Or do /spawn or /home or whatever they can.
     
  8. Offline

    Hacr

    Best plugin ever!

    Thanks man :D
     
  9. Offline

    captainawesome7

    There's been a pretty big build up of submissions over the past few days. It usually doesn't take this long :/
     
  10. Offline

    mrdrum

    is it spoused to work automaticly? if it is its not working
     
  11. Offline

    cvenomz

    This might be possible once the piston API events get solidified. Until then, no.
    This. It has also been suggested to add an option to disallow adjacent construction to help mitigate this problem.
    Thanks :)
    You need to set up your MySQL database, and the proper configurations in the OwnBlocksX config file
     
  12. Offline

    mrdrum

    how do i make a data base
     
  13. Offline

    cvenomz

    See if you can find a tutorial. Try some google searches and this
     
  14. Offline

    mrdrum

    how do i make a database?
     
  15. Offline

    Hacr

    Do you have MySql ?
     
  16. Offline

    ramzes1401ss3

    First, sorry for my bad english, i'm from Russia. Second - this is great plugin, thanks a lot for it! But tables in my DB of MySQL don't creating. I was made a user@localhost, db (minecraft) and password. After first starting of minecraft server i was change in "OwnBlocksX.properties" #MySQL CONFIG with my parameters. After i had see in DB new table with name "OwnBlocksX", but it is null always. Can you help me, please? Where is my trouble, maybe in my hands??? [creeper]

    Hmmmm.... When i was made myself by admin, after push "T" and wrote a "/obx" plugin is starting and wrote me: "OwnBlocks Activated; Blocks you build will be protected". Ok, so what i made wrong? Why simple players can't to use this plugin, they wrote /obx, but nothing happens, no messages from plugin in chat... Help me, please, who know answer on my question.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  17. Offline

    tombik

    You can use for example db4free.

    Have u got permissions set right?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  18. Offline

    waynereloa

    Thanks ofr making this plug in, youve releave me from people always griefing in my server :) but now since the new update with pistons, griefers are getting smarter, with pistons they can now use that to break into peoples houses and use it to ruin people creations:( is there a way to stop this from happening if not, for the next update of this plug in is it possible to add this feature in?
     
  19. Offline

    cvenomz

    You must add the permissions node 'OwnBlocksX.use' to the default user in your Permissions configuration
    No piston related features will be able to be added until after the bukkit API has added support for them
     
  20. Offline

    Mathiasbk

    It do doesn't automatically, when i connect and types /obx it's says "Owblocks enabled", and i'm pretty sure my config file i right. Would be nice if it was impossible for the user to turn of Ownblocks, maybe you can add that? :)
     
    I_ndex likes this.
  21. Offline

    IOn Vash

    Is there a way to port the old format to mysql? Because if there isn't I cant switch to this or everyone will lose protection on the stuff they built.
     
  22. Offline

    ledhead900

    This looks good, Im wondering how the iconomy plays into this tho, is it like u pay to place blocks down, or pay to toggle this on or off.

    Im wondering if it would possible to Sell the stuff you place with this like say u build a house you could Sell that house.

    Also I need the Group support so I'm waiting on that feature. :)
     
  23. Offline

    ghost15

    Yep, cvenomz wrote a converter, Here is a snipped version of his reply w/ information on migration:
     
  24. Offline

    cvenomz

    Shhhhhh! just dont tell them that OwnBlocksX is on your server lol
    iConomy is currently set as a pay-to-place blocks. Selling stuff would be complicated, but its a cool idea. I didnt think of that
     
  25. Offline

    Mercury

    What if i used OwnBlocks 0.2.1 before with MySQL and I dont want to loose my previous database?
     
  26. Offline

    Hacr

    Why dont it enable automaticly?

    I have set it to enable at log in. Strange... ?
     
  27. Offline

    cvenomz

    Check out the Notable Changes section in the original post. Namely, you will need to rename the database table, and move your configurations to the new config file. However, nothing changed regarding the guts of the database, just the names. Let me know if you are having trouble.
    There is an option in the configuration file: enabled-on-login. just set it from false to true and everyone will have OwnBlocksX enabled by default upon logging into the server
     
  28. Offline

    Hacr

    Code:
    #Set whether OwnBlocks is activated on player login (enabled by default) or if
    #players must enable OwnBlocks themselves (disabled by default)
    enabled-on-login=true
    
    
    It still dosent activate automaticly at log in?
     
  29. Offline

    ghost15

    Hi Cvenomz,

    Looks like you have a issue that I seem to find a lot with plug-ins that go to MySQL,

    It seems that after the initial mysql connect, the code doesn't check to make sure its still open. Eventually that initial connection will time out, and then you get the error below.

    Simple solutions, check connection state and reconnect if needed, or make and close connections as needed (this one probably isn't as good of an idea for this plugin)


    Log:

    Show Spoiler

    2011-07-15 10:00:38 [SEVERE] [OwnBlocksX] Failed to get block. Probably SQL error
    2011-07-15 10:00:38 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    The last packet successfully received from the server was 47,723,177 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
    2011-07-15 10:00:38 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2011-07-15 10:00:38 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    2011-07-15 10:00:38 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    2011-07-15 10:00:38 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Source)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3082)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2968)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3516)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1474)
    2011-07-15 10:00:38 [SEVERE] at me.cvenomz.OwnBlocks.MysqlDatabase.getBlock(MysqlDatabase.java:93)
    2011-07-15 10:00:38 [SEVERE] at me.cvenomz.OwnBlocks.MysqlBlockListener.onBlockBreak(MysqlBlockListener.java:39)
    2011-07-15 10:00:38 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$35.execute(JavaPluginLoader.java:483)
    2011-07-15 10:00:38 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    2011-07-15 10:00:38 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:160)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:122)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:469)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    2011-07-15 10:00:38 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-07-15 10:00:38 [SEVERE] Caused by: java.net.SocketException: Software caused connection abort: recv failed
    2011-07-15 10:00:38 [SEVERE] at java.net.SocketInputStream.socketRead0(Native Method)
    2011-07-15 10:00:38 [SEVERE] at java.net.SocketInputStream.read(Unknown Source)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2526)
    2011-07-15 10:00:38 [SEVERE] at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2979)
    2011-07-15 10:00:38 [SEVERE] ... 22 more

     
  30. Offline

    cvenomz

    Thanks for pointing this out AND for providing potential solutions :D
    I remember getting this problem in another plugin I wrote a few weeks ago. I wasnt sure if it was plugin-specific, or a "global" issue. Now I know. I added code that makes the server reset the MySQL connection every hour. This should resolve the issue. Later I hope to implement checking to make sure the connection is still valid when interfacing with the database, per your suggestion.

    Thanks man
     

Share This Page