EcoLink does the same thing as Vault. EcoLink helps developers to improve compatibility for economy plugins. It’s aim is to unify access to economy plugins.
I forged the following interface because i like to follow every single cent that get’s transfered.
This interface is based on the idea that there are multiple deposits and everytime you want to add/remove/transfer money, a transaction will be inserted into the database with timestamps and descriptions.
The idea behind the layout with the deposits is that you could have a deposit for cash and the bank. Maybe the adminshop needs a deposit too, so you can only hand out 5000€ per day for example.
Im feared to open a seperate topic for this, since its not finished yet.
Maybe some people could get together and unify at least an interface, so all plugins can operate with just one economy interface instead of dozens of them.
I’m a bit confused, maybe because im actually german. But I don’t know if EcoLink is useful or not. Otherwise there would be a lot of interfaces for economy plugins. (or not?)
In my opinion your interface isn’t flexible enough and the plugin itself doesn’t use the integrated ServiceProvider mechanism. You somehow used your own.
You got:
public static void registerEconomy(Economy eco) {
if (eco != null) {
economy = eco;
logger.info("Registered Economy Interface: " + eco.getEconomyName());
} else {
economy = eco;
logger.info("Registered Economy Interface: " + eco.getEconomyName());
logger.warn("Economy interface overwritten! You can register only ONE interface!");
}
}
I registered my EconomyService with this:
game.getServiceManager().setProvider(this, EconomyService.class, new StandardEconomyService());
You basically worked against the API and not with it. That is no offense, just advice. In case you need some help or don’t understand what i say, just pm me, im german as well.
We will need some economy mod. Vault was used to register Services like Economy, Permissions and more. Sponge has a built in way to register/retrieve services. But Vault also unified the interface for Economy and Permissions which (afaik) isn’t the case for sponge.
The only difference I can see in your solution, is that you’re doing some logging stuff. Sure, I could write a transaction object, but I tried to do this more like Vault.
would like to see if this can possibly be implemented into ServiceCommons
as a library, i’m attempting to do basically what you say you’re wanting to do; which is unification of an economy.
if we can drag it into a library that soon might be a really useful set of services, then the goal can be achieved .3.
Wouldn’t easily be able to put this into ServiceCommons. Mostly because the idea behind ServiceCommons is that it won’t be a plugin, but an included toolset. An Economy Service, API, or whatever, would require interfacing with the SpongeAPI.
i think i have an idea as to how i want to handle that type of service, but its gonna take a bit of thinking; the way things are set up i might not be able to do it the way i need to
but yeah, probably need to stay away from it for now
It would be great if you host it on GitHub or provide the source otherwise, it sucks to decompile it everytime and the javadocs don’t help us since its compiled.