HyperConomy
Getting Started|Commands|Permissions|FAQ|How To|Troubleshooting
______________________________________________________________________________
Introduction
HyperConomy is the all in one economy and shop plugin. It can be a simple chest or sign shop plugin, a Vault compatible economy plugin, a region based shop plugin with many configurable options, or even a complex system of economically competing towns and kingdoms. Any vanilla Minecraft item can be traded in HyperConomy and virtually any custom item can be added as well. Prices can be configured to change dynamically or they can be set as desired. To quickly edit prices and settings you can double click on HyperConomy.jar to access the GUI editor. HyperConomy has many features including things such as item price linking and item displays. Read below or check out the wiki for more information.
New Chest Shops:
______________________________________________________________________________
Features
- Supports all standard Minecraft items. (fireworks, lore, books, maps, damaged items, etc.)
- Supports the addition of unlimited custom items.
- Integrated economy plugin.
- Player to player, player to shop, and shop to player trading.
- Dynamic pricing system based on a hyperbolic curve.
- Item price linking (price of recipe item is based on price of component items)
- Player owned shops and chest shops.
- Item frame shops.
- Showcase style item displays.
- Localization.
- GUI Editor for easy manipulation of price settings.
- Price floor, price ceiling, static pricing, initial pricing, sales tax, purchase tax, unlimited stock option and much more.
- Dynamic tax rates. (Rich players can be taxed more than poor ones.)
- Supports MySQL and SQLite.
- Allows the creation of an unlimited number of economies, which allows for economically competing towns, kingdoms, factions, or other groups.
- Supports command-free economies using transaction signs and chest shops.
- Price information, history, and more can be displayed on automatically updating information signs.
- Price update notifications for any or all items.
- Experience and enchantment trading.
- When a player enters and leaves a shop, HyperConomy displays a customizable message.
- Nearly everything can be changed while the server is running.
- Unwanted features can be disabled.
______________________________________________________________________________
Requirements
- None. If you'd like to integrate with an existing economy plugin using Vault, you will need the following: Vault and an economy plugin such as BOSEconomy, iConomy, or Essentials Economy
______________________________________________________________________________
Versions and Development Builds
- Recommended builds are marked with [RB] and are generally thought to be stable and bug free.
- Builds marked as [Beta] are as bug free as possible, but often have large code changes which may result in the appearance of new bugs.
- Builds marked as [Dev] are development builds that I've decided to upload to BukkitDev. I may upload dev builds on occasion to provide easy access because Bukkit staff does not allow linking to development builds.
- Development builds may contain bugs as I work on releasing a new [Beta] build. They may also contain fixes for bugs found in [Beta] builds. Use these builds if you're looking for a bug fix, or would like to try out a new feature I've just added. Also, feel free to search for bugs in the development builds. Any help with testing is greatly appreciated!
- Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
- The latest development builds can be found here.
______________________________________________________________________________
Add-ons
- HyperMerchant
HyperMerchant is a graphical user interface for your players to use to interact with HyperConomy shops.
It is also includes the ability to easily create Citizens npc shopkeepers for your HyperConomy shops. - HyperConomy Web
HyperConomy Web creates a web page for HyperConomy, displaying information about all shops, items, and price history. The web page appearance can be customized to fit your server.
______________________________________________________________________________
New Features, Bugs, Problems, etc.
- If you have a question, or find a bug, first check the FAQ. I will try to include as many helpful questions and answers as possible.
- If the FAQ doesn't help, don't hesitate to post your question or make a ticket.
- If you do find a bug, please include which version of HyperConomy you're using, the full error message or stack trace (if there is one), the version and type of Minecraft server you're running, and an explanation of how to reproduce the bug or what causes the bug.
______________________________________________________________________________
Donate
- If you'd like to send me a donation for the time and effort spent making this plugin, you can do so here: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AMK9AR4CVKEJJ
- To those who have donated: thank you very much for the support. If you'd like to be listed as a donor here just send me a message.
______________________________________________________________________________
Donors
- pr4xt3roy -> CapricaTown
- Baamoink -> Mantle-Craft
- Thanks as well to all of the other donors that haven't requested a listing here.
______________________________________________________________________________
Basic Tutorial
New tutorial videos to come...
Suggestion: I think you should rename the "redstone" category to something like "redstones" problem is that when you want to create a shop that sells redstone, if you use "/ms status redstone trade" then the shop only trades redstone, as opposed to all the items in the redstone category. :)
Just an update, it was Hypermerchant and Citizens2. Both had updates recently that put the issue to bed, I also applied the latest HC update. Working like a charm and I was able to recover my old shops. Funny I only just realized that Hyperconomy Web is bundled, I activated it and I like a lot.. has it always been this way?
@RegalOwl
We're temporarily switching over to Essentials until the issue is fixed, I do hope that Essentials and Vault fix it soon, as do all my players :) Many of them praise the simplicity of the plugin.
An issue has been filed at the EssentialsX GitHub at https://github.com/drtshock/Essentials/issues/555.
@galacticwarrior
From the error message this looks like an EssentialsX problem. Did you get a response from the EssentialsX dev? If you set use-external to false HyperConomy uses its own economy and ignores Essentials, so this is expected. In order for HyperConomy to use Essentials economy you should set use-external to true and hook-internal-economy-into-vault to false. hook-internal-economy-into-vault will be ignored if you set use-external to true, however. The stackoverflow error is caused by EssentialsX code or Vault code, as far as I can tell.
You could switch to a different economy plugin temporarily until the problem is fixed. HyperConomy works with Vault just like Essentials economy. It lacks a few features but it does support banks, payments, Vault integration, and all basic economy commands. You can import all your Essentials account data with /importbalance [name of world] You'll need to be connected to Essentials economy for this to work. (use-external set to true)
@BrooklynStarr
This looks like it may be a HyperMerchant issue. I'll see if I can find it in the code.
@RegalOwl
Hey there, Thanks for the speedy fix on the potions. Everything works fine now on the shop end.
My final problem is a problem where the balances of people somehow get reset/reduced on server restarts. This is an extremely serious issue as people are always losing their money.
My config: http://pastebin.com/1yU8a61Z Database: https://www.dropbox.com/s/6fzeugev2qavg4r/HyperConomy.db?dl=1
EDIT: The issue appears to lie with the Essentials and HyperConomy accounts being separate. Anything sold via HyperConomy goes to the HyperConomy account instead of Essentials (hook-internal-economy-into-vault is true). use-external yields the same bug as before.
Hey,
I'm having an issue on multiple servers where this new version of Hyperconomy is breaking the Hypermerchant trait on my Citizens2 shopkeepers. I'm using the latest dev versions (tried going back a few as well) and the breakage only happens when the new version of hyperconomy is introduced. This is on 1.9.2. Snippet of repeated error in the logs:
[12:59:50] [Server thread/ERROR]: [Citizens] The trait hypermerchant failed to load for NPC ID: 17. [12:59:50] [Server thread/WARN]: java.lang.NullPointerException [12:59:50] [Server thread/WARN]: at grokswell.hypermerchant.HyperMerchantTrait.<init>(HyperMerchantTrait.java:87) [12:59:50] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [12:59:50] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [12:59:50] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [12:59:50] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source) [12:59:50] [Server thread/WARN]: at java.lang.Class.newInstance(Unknown Source) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.api.trait.TraitInfo.tryCreateInstance(TraitInfo.java:49) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.npc.CitizensTraitFactory.create(CitizensTraitFactory.java:122) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.npc.CitizensTraitFactory.getTrait(CitizensTraitFactory.java:135) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.api.npc.AbstractNPC.load(AbstractNPC.java:294) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.npc.CitizensNPC.load(CitizensNPC.java:136) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.api.npc.SimpleNPCDataStore.loadInto(SimpleNPCDataStore.java:59) [12:59:50] [Server thread/WARN]: at net.citizensnpcs.Citizens$2.run(Citizens.java:296) [12:59:50] [Server thread/WARN]: at com.massivecraft.massivelag.inject.task.MassiveLagRunnable.run(MassiveLagRunnable.java:47) [12:59:50] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71) [12:59:50] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [12:59:51] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:729) [12:59:51] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [12:59:51] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [12:59:51] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [12:59:51] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
Thanks, and thanks for updating this as well!
@HammerHedd
I've already done the hardest part of the port. HyperConomy's code has been abstracted away from the Bukkit API. In order to run on Sponge, at least as far as I know, all that needs to be written is a connector. The same .jar of HyperConomy should be able to run on both platforms after the connector is working. In the future, if it ever happens, I could also add support for the Minecraft API. The last time I checked, though, the Sponge inventory API wasn't finished, but I'll check again and see how it has progressed.
@iron_phildo69
It will sync the shop and all its settings and items. I agree that in most situations this probably isn't wanted. Unfortunately the shops will be synced anyway until I update the multi-server mode to support using separate databases since both servers load from the same location. I'll see if I can add this soon. I sort of have a framework that will support it which is used for the remote GUI. One way around this is to have different names for your worlds.
This is probably not the right place to ask this, but have you given any thought to porting this to sponge? I'm just starting to play with sponge, and it seems like it will eventually be a great platform.
As a follow on, I'm willing to help with that porting if you think that would be a good idea...
Just a Question regarding the syncing of shops in the config file, i'm curious if all it does is sync the shop and its location to other servers? If so what is the use case for that? I personally am missing the point of syncing a shop to another world at the exact same point of reference. I assume it syncs more than just the shop?
@iron_phildo69
Thanks! I've updated the links on the README. I'll hopefully merge the dev code back into master soon too. Let me know if you run into any more problems.
@regalowl
Thanks heaps! ill let you know if it works, i tried accessing the latest dev build but it redirects me to this (from your github page)
https://buildhive.cloudbees.com/job/RegalOwl/job/HyperConomy/lastSuccessfulBuild/regalowl.hyperconomy$hyperconomy/
I suspect this isn't meant to happen? If you can link me to the file I would be most appreciative.
Edit: Found it: http://regalowl.net:8081/job/HyperConomy/
Edit2: Fixed :) ty for that. it doesn't show the payment message but the funds transfer. Awesome, i've donated again for your time :D
@iron_phildo69
An event wasn't being triggered properly for /hcpay. Let me know if the latest dev build fixes it for you on your servers. And also let me know if you find any other problems with it.
@regalowl
Thanks for the help! We did infact end up building our own jar and enabling your commented debug messages, while we did gain insight into what the issue may be we learned quickly exactly why you disabled them :P (800mb in 5 mins!)
I can confirm those commands DO work fine (hcset stock and /hcset balance), i tested them multiple times over multiple servers, however, the "/hcpay player amount" command does NOT work over multiple servers. It fails to transfer the amount exchanged and instead takes the sent money but doesn't update the other servers balance. I would like to stress all other commands work except this one over multiple servers but it does work locally, if both are on the same server.
Our server runs in a single VM and all other servers including bungee run in the same vm. There is no firewall issues as its using localhost (127.0.0.1) to connect nor is any firewall enabled. I retract my earlier statement and would say instead of it not syncing its more a issue this one command wont work over multiple servers. I don't know if that is because its not a implemented feature or is it just doesn't work but i have tested multiple times and i can confirm unless they are on the same server it wont transfer the money.
@iron_phildo69
I can add some more printout options for it. It's somewhat problematic to track errors or log information from the multi-server connection because it has the potential to generate an enormous amount of errors if something goes wrong. I removed all logging in the past to prevent multi-gigabyte error spam.
The easiest way to see if it's working is to have both server consoles open and run some simple commands. With the default update interval of 1/2 second it should sync almost immediately. Test changing item stock with /hcset stock [object] [amount] and test changing a player balance with /hcset balance [player] [amount] After setting them, switch to the other console and check the stock and balance of the player to see if they match the server where you made the change. I would recommend testing this on a simple setup first to isolate problems. I just tested it with the latest dev build and it's working for me. (No code changes related to this yet.) I'm running two servers locally on my computer. One server runs on the default port of 25565 and the other on 25566. Here's the config section in config.yml for each:
Server 1:
Server 2:
Yes, your understanding is correct. It just needs to receive the update messages.
Are your servers on the same physical machine or virtual machine? If you're running the servers on different machines/vms you may be running into firewall issues. You may have a firewall blocking port 20066 and 20067. Also, have you gotten the sync to work at all? If it's working intermittently I'd like to try to find a way to consistently reproduce the issue. I don't have a good way to test it in a real environment with lots of players such as a BungeeCord setup so it's possible something isn't working. I can make you a custom build with debug information to help track down and fix the problems once I better understand what's going on.
@RegalOwl
Thanks for the insight, The Documentation as written had me wondering if you meant minecraft port or a separate port, the ip addresses were fine. If you need help writing documentation i'm happy to contribute, but i'll need to get the majority of the functions working to write in depth documents.
I understand what you mean with the SQL updates, I set the sync to immediate to try and debug the issues i've been having and .. well .. it didn't end well. Too many updates.
I spent considerable time with a friend checking the multi server functions themselves in the source code to work out what we were doing wrong. Regarding the Hyperconomy multiserver links the biggest issue is telling IF they are indeed connected, we built a test jar and added comments to understand where the issue was as it doesn't print to the console or logs as far as multi server goes. Once we added the console prints we could see the update function was called, but it simply didn't sync :/ The process as you explained it is simple enough and should work fine on a localhost setup, but for some reason we cannot get these update messages to sync. It turned out that we were using the same ports as minecraft (because i misunderstood the documentation and realised later) so that fixed the initial issue and like you said in your example the amount of money syncs for the individual player, however the issue now is sending money to players not in the same world.
By the sounds of things as you explained in the example it seems that server two wouldn't write the changes back in the database but I assume if they are both sharing the same database this point would be moot, it wouldn't need to write any changes back as the other server has done this for it (our setup they use the same DB), it just needs to receive the update messages and keep the in memory copy synced in near real time which is our problem.
Specifically the usage scenario for this problem is that we have a hub world with linked inventories and such. The shops are in this hub world so that lag and other technical issues are isolated from one another. Players teleport from survival to this Hub world which is a separate bungee server. Hyperconomy shares the DB between servers and is set to send updates on a separate port from minecraft (20066 and 20067). If a player sends money to a player that isn't in the world it simply disappears (the money).
Essentially the TL:DR is this: Is there a way to sync money from server to server to players on separate servers?
Not sure if this helps. there is a spigot pull request for the egg issue. the developer mentioned this "You have to use ItemMeta when submitting for inclusion in the API, so it's a bit more involved"
https://hub.spigotmc.org/jira/browse/SPIGOT-1592 is the exact ticket though.
@iron_phildo69
I'll do some testing and get back to you. I need to update the documentation for multi server mode. I'll work on that in a moment. It doesn't currently do a great job of explaining how it functions.
The issue with using the database for synchronization is that HyperConomy doesn't update the database in real time. Directly reading from the database for each action such as checking the price of an item would massively hurt performance since HC would need to wait on all writes to finish before it could return an up to date value. Instead the database is stored entirely in RAM while HC is running and it gets updated only periodically in large transactions. For the most part HyperConomy only reads from the database when it loads.
Multi server mode currently relies on all servers sharing the same MySQL database. In the future I plan to allow it to work with SQLite or multiple databases, but it requires quite a bit of code for this. How it works now is this: when two linked HyperConomy servers load they are initially in the same state because they load from the same database. When a change occurs on one server, that server sends the change to the other server where it only changes the data in RAM, not the database. The database gets changed by the server that originated the change. The other server's state in RAM is simply updated to match the state of the change originating server. This process works in both directions with the result being that both servers remain in the same state.
Here's a simple example: Player A on Server 1 gets a deposit of $100 into his account. Server 1 writes this change to the database, saving it. Server 1 also sends the change to server 2 over the multi-server network connection. Server 2 updates player A's balance to match server 1, but only in RAM. If player 2 logs out from server 1 and logs into server 2 his balance will still be the same. If server 2 is restarted, it will load the proper balance for player A because it was saved to the database by server 1.
@dpheonix68
Looks like spawn eggs aren't really implemented in the Bukkit/Spigot API yet like shmancelot said. I'll fix them once the API functionality is added. It's probably not worth coding a temporary fix with NMS. Hopefully the API will be updated soon.