Inactive [ECON] hBank 1.53 - Banks, now with 100% more Bukkit permissions [1060]

Discussion in 'Inactive/Unsupported Plugins' started by hatstand, Jul 27, 2011.

  1. Offline


    hBank - Banks, now with 100% more register.

    Version: 1.53 (Permissionerer)

    Yes, iConomy 5 already has banks. But they're severely lacking in features. This is my first foray into a serious-ish plugin, and Java as a whole. This was written for my server originally, but I've made a few revisions to make it workable as a public plugin, and done alot more work on it than I thought I would be.

    How it works:
    You create a set of banks, users join the banks for a fee, and every 24 real hours (give or take a few minutes if your server restarts), they get interest. All of the fees get paid into the Bank Owner's account.

    Accounts are stored in the economy as <bank id>-<player name>. For example, my account with the Atlas Corp. Bank on my server (ID atlas) is stored as atlas-hatstand.

    • Any one of iConomy 4, 5, & 6+, BOSEconomy 6 & 7, Essentials Economy 2.2.17+ or MultiCurrency
    • WorldGuard 5 - Can be used to control bank access areas
    • Permissions (3.x) - Can be used for fine-grained feature access if you don't want to use bukkit's permissions.
    • Fully customisable banks, with player owners, interest rates & fees.
    • Private banks, which are invite-only
    • A dodgy admin command for in-game modifications
    1.3 Additions:
    • Bank Access Permissions:
      • Enabled via perbankpermissions in config.yml
      • This switch will only work if you've already enabled permissions, and will allow you to specify which users/groups can access which banks via a permission node in this format: hbank.banks.<bank id>
    • Custom Interest Interval
      • Changed via interestperiod in config.yml
      • The number here controls how often interest is calculated, in hours.
    1.1 Additions:
    • WorldGuard Regions:
      • Enabled via useworldguard in config.yml
      • In config.yml, you'll find an array called regions for each bank. The regions placed in here are where users can access that specific bank, eg: regions: [region1, regionaaa] Would allow members of that bank to access their bank in the regions region1 and regionaaa. Note that this only restricts join, leave, withdraw, deposit, balance, and info
    • Permissions:
      • Supports Permissions 3.x and Bukkit Permissions
      • Enabled via usepermissions in config.yml
      • There are permissions for each sub-command in /hbank, and one for bank access at all.
        • hBank.commands.use - User/Group can access /hbank
        • hBank.commands.<sub-command> - User/Group can access the sub command specified - See the command reference for the names to use
    • Download and install an economy framework - Any of iConomy 4, 5, & 6+, BOSEconomy 6 & 7, Essentials Economy 2.2.17+ or MultiCurrency will work.
    • Download and extract the hBank archive - link below. It contains a default, commented config file that won't be loaded on startup. I highly recommend editing this to suit your needs (set up banks, and bank owners) before starting the server up with hBank enabled.
    • /hbank - Banking command
      • Usage: /hbank <join|leave|invite|kick|withdraw|deposit|balance|info|list|accept|deny|members|check> [value]
        • Join: Attempts to join the bank with the ID you specified. Cannot join private banks.
        • Leave: Leaves your current bank. All bank funds are transferred out of your account.
        • List: Lists all available banks
        • Invite: Owner only. Invites a player to your bank. Only usable with private banks, and players with no existing account.
        • Kick: Owner only. Boots the player specified out of your bank. As with leaving a bank, they retain all funds. Can only be used with private banks.
        • Withdraw: Withdraws money from your bank account. Requires a bank account.
        • Deposit: Deposits money into your bank account. Requires a bank account.
        • Balance: Gives you information on your account - current balance, and the hours left until interest is calculated.
        • Info: Gives you the information of the bank ID given - Name, Owner, Fees, Interest rate, and if it is private or not.
        • Accept: Accepts an invitation to a private bank.
        • Deny: Rejects an invitation to a private bank.
        • Members: Lists the members of any non-private bank (Can list the members of a private bank you're a member of)
        • Check: Owner only. Checks the account balance of any of the members of your bank.
        • Reload: Reloads the hBank config. Checks against Op status for permission.
    • /hbanka - Admin command:
      • Usage: /hbanka <mode> <config node> <value>
        • Mode: 0 for general stuff, 1 for numbers
        • Config node: This is a bit more complex. For general usage, you'll be modifying bank nodes, so you'll want banks.<bank id>.subnode where subnode is the property, which can be any of name, owner, interest, private, fees.startup or fees.transaction.
        • Value: What you want to set the config node to. The nodes interest, fees.startup and fees.transaction are numbers, so not using the number input mode will break things, and throw errors.
      • This is basically a direct input into the config variable in the plugin, so there are no safety checks on what you do with it. Its access is limited to either ops, or those in the admins array in config.yml. If you aren't sure how to use it, ask me, or don't go near it.

    I will give support (Help you with errors, fix bugs) for this, but forum responses might be delayed. Generally catching me on steam (hatstand2371) is a lot faster.​


    .zip w/ Example Config file
    Direct .jar link

    Credit where its due:
    • Nijikokun - That genius Register API
    • Forecaster - Guineapig/Tester
    • 1.53
      • Fixed warnings for iConomy 4, 5 & 6's Register methods. Shouldn't change any functionality, but nice to have.
    • 1.52
      • Hopefully the final fix for disappearing users
    • 1.51
      • Another attempted fix for disappearing users - Didn't work either.
    • 1.5
      • Now has Bukkit permissions support, using the same node format. Will use these if no valid Permissions plugin is found and you've enabled permissions.
    • 1.42
      • Fixed errors with BOSEconomy & Potentially Essentials Economy
    • 1.41
      • Fixed interest ticks getting reset
      • Updated the reported version number
    • 1.4
      • Implemented register. Now supporting a pile of economy frameworks. Should hopefully fix some issues with other plugins.
    • 1.3
      • Fixed users vanishing on /reload - Nope.
      • Changed permission nodes - See above for information
      • Re-Fixed default config file
      • Added bank access permissions via perbankpermissions in config.yml
      • Added custom interest interval (in hours) via interestperiod in config.yml
      • Fixed a few nulls
    • 1.23
      • Fixed default config file creation, fixed error when not using WorldGuard, fixed a few other bugs
    • 1.22
      • Uses the default colours if it can't find a custom definition of them
    • 1.21
      • More bugfixes
    • 1.2
      • Added /hbank reload for configuration reloads (Read: Edit while the server is running), fixed a pile of bugs
    • 1.1
      • Fixed Commands, added optional WorldGuard & Permissions support
    • 1.0
      • Released
  2. Offline


    Will this support mysql?
  3. Offline


    For what? The config file? If your economy uses MySQL, so does this.
  4. Offline


    is there anyway to lower the length of time taken for the interest to kick in because it would be better for my server if it went faster but give less money
  5. Offline


    See the custom interval setting
  6. Offline


    Does this plugin create new tables to store the bank data?
  7. Offline


    No, it keeps it all within the economy framework... It basically creates and manages accounts.
  8. Offline


    i guess i'm wondering if i could pull this information out from mysql to a website frontend?
  9. Offline


    I guess you could, by pulling out the specific accounts, which are stored as <bankid>-<username> so,
    defaultbank-DefaultGuy, etc. You could parse the config.yml to get a list of accounts, I've seen some PHP YAML libraries around.
  10. Offline


  11. Offline


    Ah so this doesn't store its information in the database then?
  12. Offline


    No, it does, in the economy database. I suggested the config file, because how else are you going to get a list of accounts that exist?
  13. Offline


  14. Offline


    Thank you sooo much! very simple very fun and i love u soo much for creating it :)
  15. Offline


    /money hide <account name/player name> could be built into the plugin when the account is created. or the player can do it himself for now
  16. Offline


    By "Not too sure if there's any way to avoid it" I mean that I don't think its even possible to hide accounts automatically. I tried, via the iConomy hide function, but it didn't do a thing. Plus that method isn't in the register API, as not all economies have it.
  17. Offline


    ok. :)

    scrapped the error report i was about to send you. i solved it :)
  18. Offline


    make you maybe support for npc ?
  19. Offline


    Shared banks would be nice. (+ settings with max ammount in a day)
    We need a "Public Buldings Bank", where everyone can take some money for other public buildings :D
  20. Offline


    can you pls update to 1060 ? i become now with /hbank balance the "an internal error occurred while attempting to perform this command" notify :/
  21. Offline


    Working fine on 1060 here, Give me some more information.
  22. Offline


  23. Offline


    Give me an hour and it'll have Bukkit permissions.

    EDIT: Done. If it doesn't find a valid Permissions plugin when you enable permissions in the config, it defaults to Bukkit permissions. It auto-registers all the bank nodes on startup if you've enabled per-bank permissions as well, along with a * node for accessing all banks (hbank.banks.*). The nodes are in the same format, and there is a hbank.commands.* node for shorthanding all the command nodes.
  24. Offline


    Actually, I'm having this problem as well. I haven't nailed down for sure that it's during server restarts that accounts get dropped (I just notice they disappear) but I suspect it is. Looking through the log, I do see where hBank saves accounts that were made. It looks like it didn't save between creation of some accounts and a server restart (and they got lost), but then later it did save after creation of an account, and it survived the server restart. This is just a theory at the moment, you'd be more familiar with how the saving works.

    Anyway, I'm pretty new to the bukkit server thing, but this is the line in my log that I think should indicate what version I'm running:
    [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-980-g4ed23b1-b1060jnks (MC: 1.7.3)

    Not sure if that helps, let me know where else/for what to look, I'd really like to get this sorted because I love the plugin, it just stinks when I lost players' accounts. Thanks for all your work!

    Here is the contents of my config file, and I'm running iConomy 5 into a MySQL database (which seems to be working fine I believe).
    Show Spoiler

    ?interestperiod: 24
    time: 24
    opmode: true
    usepermissions: false
    useworldguard: true
    perbankpermissions: false
    - CoyleTrydan
    - RED
    - YELLOW
    - GOLD
    - WHITE
    interest: 0.25
    name: BankofBulwark
    owner: ThePengu
    - bank
    transaction: 10
    startup: 50
    private: false
    bank: BankofBulwark
    bank: BankofBulwark

    UPDATE: I had an idea, to use the /money command to check the balance of the bank accounts. Turns out they are still there in the DB, just hBank hadn't saved them in the config file, so it wasn't recognizing them anymore (not sure how that happened). Once I added the users back into the config file, everything was fine. Not sure if the plugin had an issue, or if my server somehow rolled back the file.
  25. Offline


    Thats very odd - Part of the fix for this problem is that it should automatically save everything when a new bank account is created. I've never had this issue pop up on my server since I implemented that fix... It could be a case sensitivity issue...
  26. Offline


    Works perfectly, but /hbanka gives me an internal error or something.
    Here's my server log.
    2011-08-31 17:58:29 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'hbanka' in plugin hBank v1.5
        at org.bukkit.command.PluginCommand.execute(
        at org.bukkit.command.SimpleCommandMap.dispatch(
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
        at net.minecraft.server.NetServerHandler.handleCommand(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.Packet3Chat.a(
        at net.minecraft.server.NetworkManager.b(
        at net.minecraft.server.NetServerHandler.a(
        at org.getspout.spout.SpoutNetServerHandler.a(
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at me.hatstand.hBank.hBank.handleBankAdminCommand(
        at me.hatstand.hBank.hBank.onCommand(
        at org.bukkit.command.PluginCommand.execute(
        ... 13 more
  27. Offline


    Yeah, probably going to disable that for the next release.. Its not safe enough.
  28. Offline


    If you own a bank /hbank seems to give you what /hbanka should.
  29. Offline


    hbanka is quite literally a direct line into the config, thats all it was made for.
  30. Offline


    Huh. I'm experiencing an error where upon server restart or reload, bank accounts are reset. Also, is it possible to make it so that you can't use the iconomy banks while hbank is enabled, but can while it isn't? Great plugin by the way, it's really just what I was looking for. It works great other than the reload-delete error.
  31. Offline


    Once again, I can't reproduce this, I need more information... Check the server log when the server restarts, it should show the accounts being saved, and any that aren't due to invalid banks. If some aren't appearing in there at all, then I may have an idea where things are going wrong.

    EDIT: Pushed a small update to the user stuff, see if that fixes it

Share This Page