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

    hatstand

    hBank - Banks, now with 100% more register.

    Version: 1.53 (Permissionerer)

    Foreword:
    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.

    Dependencies:
    • Any one of iConomy 4, 5, & 6+, BOSEconomy 6 & 7, Essentials Economy 2.2.17+ or MultiCurrency
    Optional:
    • 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.
    Features:
    • 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
    Installation:
    • 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.
    Commands:
    • /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.
    Support:

    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.​

    Downloads:

    .zip w/ Example Config file
    Direct .jar link

    Credit where its due:
    • Nijikokun - That genius Register API
    • Forecaster - Guineapig/Tester
    Changelog:
    • 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

    topsub

    Will this support mysql?
     
  3. Offline

    hatstand

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

    TTlabambaTT

    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

    hatstand

    See the custom interval setting
     
  6. Offline

    topsub

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

    hatstand

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

    topsub

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

    hatstand

    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

    tom

  11. Offline

    topsub

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

    hatstand

    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

    MadcowD

    Badass
     
  14. Offline

    thomaswrocks

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

    drt

    /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

    hatstand

    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

    drt

    ok. :)

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

    TheShadow777

    make you maybe support for npc ?
     
  19. Offline

    staxx6

    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

    TheShadow777

    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

    hatstand

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

    Techwiz101

  23. Offline

    hatstand

    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

    CoyleTrydan

    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
    admins:
    - CoyleTrydan
    colours:
    - RED
    - YELLOW
    - GOLD
    - WHITE
    banks:
    BankofBulwark:
    interest: 0.25
    name: BankofBulwark
    owner: ThePengu
    regions:
    - bank
    fees:
    transaction: 10
    startup: 50
    private: false
    users:
    ThePengu:
    bank: BankofBulwark
    kenwhite:
    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

    hatstand

    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

    Techwiz101

    Works perfectly, but /hbanka gives me an internal error or something.
    Here's my server log.
    Code:
    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(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:352)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:737)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:701)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:694)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:478)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:453)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at me.hatstand.hBank.hBank.handleBankAdminCommand(hBank.java:632)
        at me.hatstand.hBank.hBank.onCommand(hBank.java:617)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 13 more
     
  27. Offline

    hatstand

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

    Techwiz101

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

    hatstand

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

    jackham8

    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

    hatstand

    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