diff --git a/README.md b/README.md index 1e4aee82..afca6b77 100644 --- a/README.md +++ b/README.md @@ -1,97 +1,90 @@ -# GlobalMarketChest -GUI Plugin of shop for spigot +![banner](https://user-images.githubusercontent.com/29657498/52167675-07369d80-271f-11e9-86ff-362db527f854.png) -## Dependecy -To work you will need the plugin **Vault** to handle the economy. - -## Commands - -**Help** - -Show help - -`/globalmarketchest [help]` - - -**List** - -List all globalshop +GlobalMarketChest is a spigot plugin that allows to easily create global shops to sell and buy auctions. You interact with shops through graphical interfaces. It can be easily configured and customized. -`/globalmarketchest list` +![dependencies](https://user-images.githubusercontent.com/29657498/52743417-45af4080-2fda-11e9-8be7-4b645e77e898.png) +To work you will need the plugin **Vault** to handle the economy. -**Detail** - -List all physical globalshop à distance - -`/globalmarketchest list detail ` - - -**Open** - -Allow to open a globalshop - -`/globalmarketchest open ` +While there is no other storage system you will also need **MySQL**. +![features](https://user-images.githubusercontent.com/29657498/52743424-4ba52180-2fda-11e9-8fe1-dded69d0dd85.png) -**TP** + - User friendly shop graphical interfaces + - Fluid graphical interfaces + - Simple and instinctive shop creation process + - A unique place to sell/buy items and improve interaction between players + - Smart sorting system to see first cheapest auctions and than oldest + - Paginator to see auctions 27 by 27 + - Easy process to create / buy auction + - Easy price selector + - Advanced feature to repeat the auction that you are creating as many as possible + - Advanced feature to put all similar items of your inventory in the auction that you are creating (you can go higher than 64 items) + - Advanced categories system by default inspired by creative tabs but can be totally customized + - Detailed permissions system + - Complete commands to list, teleport to and open shops (with autocompletion) + - High configurability + - All items composing interfaces can be changed (item used, title and lore) + - Language can easily be configured + - Categories totally configurable (display item, title, position, items contains, GroupLevels) + - Many features can be configured/disabled -Allow to teleport the player a specific shop position +**Technical features :** -`/globalmarketchest list tp ` +- Highly configurable interfaces through config file +- Interface loader that auto adapt to available interfaces +**In coming features** -#TODO +- Multi database support (yml, postgresql, SQLite, mongodb) +- AuctionShop (maybe another name) - Here roles are reversed, the player ask for an item and a quantity he need and players come to sell to him the wanted item +- AdminShop - Here players can find all item they want infinitely. +- LocalShop - With this shop only the owner can sell auctions in it. +- Maybe the split of this plugin in multiple little plugins (core, globalshop,adminshop,...) to improve scalability of this plugin -**Reload the plugin** +![installation](https://user-images.githubusercontent.com/29657498/52743428-4ea01200-2fda-11e9-94eb-3f9bba72e926.png) -`/globalmarketchest reload` +1. Download the file **GlobalMarketChest.jar** +2. Add the file in the folder **plugins** of your server. +3. Launch your server, it will generate all necessary configuration files in **plugins/GlobalMarketChest**. The plugin will disable from itself because your database is not configured. +4. In file **plugins/GlobalMarketChest/config.yml** change the database informations in variable **Database**. See [wiki](https://github.com/EpiCanard/GlobalMarketChest/wiki/resources-:-config.yml#database). +5. Reload the plugin or server +6. If your database informations are correct, the plugin should now work :) If it's not the case don't hesitate to come on Discord ([https://discord.gg/UuGAcCa](https://discord.gg/UuGAcCa)) to ask for help. -## Permissions +![documentation](https://user-images.githubusercontent.com/29657498/52743420-48119a80-2fda-11e9-8076-582a7617be7c.png) -```YAML -# Can use all commands and shops -globalmarketchest.* +You can find all information that you need to use and configure this plugin in the [wiki](https://github.com/EpiCanard/GlobalMarketChest/wiki). -# ==== Global Shop ==== +![support](https://user-images.githubusercontent.com/29657498/52744544-439ab100-2fdd-11e9-8ec8-b18edd602689.png) -# Can create or use a globalshop -globalmarketchest.globalshop.* +If you find a bug or want to make a suggestion to improve the plugin please open an [issue](https://github.com/EpiCanard/GlobalMarketChest/issues) on GitHub. -# Can create a globalshop -globalmarketchest.globalshop.createshop +If you want to participate to development of this plugin, fork the GitHub, make your modifications and open a Pull Request. -# Can open shop -globalmarketchest.globalshop.openshop +If you have questions, you can contact me on discord. +Discord: [https://discord.gg/UuGAcCa](https://discord.gg/UuGAcCa) -# Can create an auction -globalmarketchest.globalshop.createauction +Source GitHub: [https://github.com/EpiCanard/GlobalMarketChest](https://github.com/EpiCanard/GlobalMarketChest) -# Can create buy an auction -globalmarketchest.globalshop.buyauction +![screenshots](https://user-images.githubusercontent.com/29657498/52745804-4ea31080-2fe0-11e9-8604-8e5081c75605.png) -# ==== COMMANDS === +![buy_auction](https://user-images.githubusercontent.com/29657498/52537867-c1578600-2d6b-11e9-8657-7f4efb43ac27.gif) -# Can use all commands and shops -globalmarketchest.commands.* +![create_auction](https://user-images.githubusercontent.com/29657498/52538701-fcf74d80-2d75-11e9-972b-de74812f337b.gif) -# Can reload the plugin -globalmarketchest.commands.reload +![edit_auction_overview](https://user-images.githubusercontent.com/29657498/52537956-e993b480-2d6c-11e9-9c5c-1316c9908de7.gif) -# Can open a shop with command -globalmarketchest.commands.open +![using](https://user-images.githubusercontent.com/29657498/52744655-970cff00-2fdd-11e9-9dbe-697f46eafd12.png) -# Can list all shops with command -globalmarketchest.commands.list.* +- Freebuild.fr - play.freebuild.fr [website](https://freebuild.fr) -# Can see all shop position for a group of shop -globalmarketchest.commands.detail.* +![thanks](https://user-images.githubusercontent.com/29657498/52743433-5069d580-2fda-11e9-8d34-ae14557c1311.png) -# Can be teleport to a specific shop -globalmarketchest.commands.detail.tp +I would like to thanks the server Freebuild.fr that helps me during development of this plugin. -``` +I would like to thanks the player Icodak that make the logo of this plugin. -## Discord +### Donation +If you want to donate for work done, it will be a pleasure. Thank you. -GlobalMarketChest discord : https://discord.gg/UuGAcCa \ No newline at end of file +[![paypal](https://www.paypalobjects.com/en_US/FR/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ALYLAVBZCPC7C&source=url) diff --git a/pom.xml b/pom.xml index 05fe80f1..419f4b80 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 fr.epicanard globalmarketchest - 0.0.1-SNAPSHOT + 1.0.0 GlobalMarketChest GUI Plugin of shop for spigot diff --git a/src/main/java/fr/epicanard/globalmarketchest/database/connections/DatabaseConnection.java b/src/main/java/fr/epicanard/globalmarketchest/database/connections/DatabaseConnection.java index 1de957f6..c42ed3ac 100644 --- a/src/main/java/fr/epicanard/globalmarketchest/database/connections/DatabaseConnection.java +++ b/src/main/java/fr/epicanard/globalmarketchest/database/connections/DatabaseConnection.java @@ -34,7 +34,7 @@ protected String buildUrl() { return this.host + ":" + this.port + "/" + this.database; } - protected abstract Connection connect(); + protected abstract Connection connect() throws ConfigException; protected abstract void disconnect(Connection connection); @@ -44,7 +44,7 @@ protected String buildUrl() { public abstract void getBackConnection(Connection connection); - public abstract void fillPool(); + public abstract void fillPool() throws ConfigException; public abstract void cleanPool(); diff --git a/src/main/java/fr/epicanard/globalmarketchest/database/connections/MySQLConnection.java b/src/main/java/fr/epicanard/globalmarketchest/database/connections/MySQLConnection.java index d7c3048e..1b14f2c7 100644 --- a/src/main/java/fr/epicanard/globalmarketchest/database/connections/MySQLConnection.java +++ b/src/main/java/fr/epicanard/globalmarketchest/database/connections/MySQLConnection.java @@ -92,13 +92,15 @@ public void configFromConfigFile() throws ConfigException { * @return Connection */ @Override - protected Connection connect() { + protected Connection connect() throws ConfigException { try { Class.forName("com.mysql.jdbc.Driver"); return DriverManager.getConnection("jdbc:mysql://" + this.buildUrl(), this.user, this.password); - } catch (SQLException | ClassNotFoundException e) { + } catch (ClassNotFoundException e) { e.printStackTrace(); + } catch (SQLException e) { + throw new ConfigException("Can't connect to your database, please check your configuration file or the access to your database"); } return null; } @@ -127,9 +129,10 @@ public Connection getConnection() { if (co == null || !co.isValid(0) || co.isClosed()) return this.connect(); return co; - } catch (SQLException | InterruptedException e) { - return this.connect(); + } catch (SQLException | ConfigException | InterruptedException e) { + e.printStackTrace(); } + return null; } /** @@ -151,7 +154,7 @@ public void getBackConnection(Connection connection) { * Fill pool with connection from the size specified in config file */ @Override - public void fillPool() { + public void fillPool() throws ConfigException { for (int i = 0; i < this.simultaneousConnections; i++) { Connection co = this.connect(); this.getBackConnection(co); diff --git a/src/main/java/fr/epicanard/globalmarketchest/exceptions/ConfigException.java b/src/main/java/fr/epicanard/globalmarketchest/exceptions/ConfigException.java index 2fa78f32..dd2720e2 100644 --- a/src/main/java/fr/epicanard/globalmarketchest/exceptions/ConfigException.java +++ b/src/main/java/fr/epicanard/globalmarketchest/exceptions/ConfigException.java @@ -5,6 +5,6 @@ public class ConfigException extends Exception { static final long serialVersionUID = -7914157672976633808L; public ConfigException(String message) { - super("[Configuration]" + message); + super("[Configuration] " + message); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f93670fd..13c70b99 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: GlobalMarketChest -version: 0.0.1 +version: 1.0.0 author: EpiCanard api-version: 1.13 depend: [Vault]