SQLEconomy
SQLEconomy
SQLEconomy is a plugin that combines MySQL and SQLite and puts them into an economy plugin. The great thing about SQL is it's extremely organized. Each table is like a spreadsheet, keeping everything organized. If yo don't have and experience with SQL, SQLEconomy doesn't care! It will create a table for you, all on its own.
Developing with SQLEconomy
SQLEconomy is open source! You can contribute to, or develop with, SQLEconomy at: https://gitlab.com/andrewward2001/SQLEconomy
Installing SQLEconomy
When first running SQLEconomy, you should see an SQLException. This is normal, as the database hasn't been set up. Make sure to create your database, but NOT the corresponding table.
Set up the database with phpMyAdmin:
I'll only be covering database set up in phpMyAdmin with MySQL.
Firstly, you'll need to create a user. It needs to have a password, as well as data permissions and the CREATE permission.
Also, make you that you don't leave the hostname as "%"; it needs to match what's in your config.yml file. This will break it. Next, create a new database. Any name will work.
Once you've done all that, open your db.yml file.
HostIP - match this with what you entered in phpMyAdmin
Port - You'll probably want to leave this alone.
Name - The name of the database you create above
Table - Pick any name. SQLEconomy will make the table for you
Username / Password - Whatever you set when you made the MySQL account before.
Caching - Caches database in a local variable. This tends to be buggy.
CacheRate - How often in milliseconds (ms) the cache will update ALL records, clear, then recreate the cache. This can be inefficient and should be stretched.
You should now be good to go. Reload your plugins and you should see something like this:
You'll also need Vault to hook into other economy-based plugins (like ChestShops, for example). The Vault hook is included, just make sure you have Vault 1.5 or newer. Use /vault-info to check if SQLEconomy is in use.
Found a bug or have a suggestion?
All issues and suggestions live on SQLEconomy's GitLab Issues page. If for whatever reason you can't open an issue, please leave a comment or email me at andrew.ward (at) virtualua.org.
Need some configuration help?
You can find the original config.yml here and the original db.yml here with helpful comments.
Notable Contributors
- _Husky_ & tips48 - Made the SQL API
- _Husky_ - helped work out some kinks
Included APIs
- An SQL API is included. API by tips48 and _Husky_ http://forums.bukkit.org/threads/tutorial-using-mysql-in-your-plugins.132309/. You can choose to use it through my plugin, or add it to your project.
Benefits
There are many benefits of an economy plugin that uses SQL. First of all, all of the information is in a centralized location, versus a flat file. Also, SQLEconomy helps cut down RAM usage versus, say, iConomy, because it has ONE purpose whereas iConomy can store with flat files and other forms of storage which brings up RAM usage and storage on your server. Plus, flat files need to be saved/loaded whenever they're used. This doesn't. It has minimal data uploads.
Great plugin! It's working good!
Why you cannot see the balances of the players that aren't connected?
Also, can you add /money charge 1% offline: substract 1% from balances of the players that are not connected?
Thanks!
your plugin works well on my server, but could you add a option that could use double value for money,like 100.00, thx
I have a problem with SQLEconomy, players can't use the /money command.
Here's the log:
[SQLEconomy] Enabling SQLEconomy v0.3-BETA
[23:38:30 WARN]: Sun May 07 23:38:30 CEST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
[23:38:30 INFO]: [SQLEconomy] Created/checked the database table
[23:38:30 INFO]: [SQLEconomy] Unable to hook plugin Vault
[23:38:30 INFO]: [SQLEconomy] [SQLEconomy] Vault not found. Other plugins may not be able to access SQLEconomy accounts.
In reply to Forge_User_09107244:
Please finish this.
Your Plugin Banner is Done!
@gamingnl
Yes, probably :) You can just link the two to the same database and table and it should get the same information on both, since it's in a centralized location.
@1Achmed1
Like you have 20 dollars on server A, is it possible to link them? like when server A has 20 you have 20 on server B
@gamingnl
I don't know what that is.
Is it possible to link a bungee network with it?
@hamzaxx
Thanks! :)
Looks promising!