[INACTIVE][ECON] SimpleShop [1.41] - An iConomy Shop [493-531]

Discussion in 'Inactive/Unsupported Plugins' started by Nijikokun, Jan 23, 2011.

  1. Offline

    Nijikokun

    SimpleShop (1.41) (iConomy 4.4+ & Permissions or Op(s).txt)(Donate)
    Download the latest release. (Jar)

    What is SimpleShop?
    Simple shop is... well a simple global shop that allows you to add, update, and reload in game.
    Natively supporting MySQL & SQLite.

    Install:
    1. You need iConomy & Permissions to use this plugin.
    2. Download the archive, extract the files to your base craftbukkit directory.
      1. SQL Dependencies Required:
        1. SQLite Dependency
        2. MySQL Dependency
      2. The dependency must be located in the craftbukkit plugin directory!
    3. Go to plugins/SimpleShop/ and modify the .settings file to your likings.
    4. Restart server and enjoy!
    Stock
    Show Spoiler
    To activate stock open up the .settings file and locate use-stock=false set it to true.
    Commands:
    Show Spoiler
    /shop check [id] - Show item information
    /shop list (page)
    /shop buy [id]([:amount])
    /shop sell [id]([:amount])
    /shop add [id]:[amount per bundle] [buy] [sell] (stock)
    /shop update [id]:[amount per bundle] [buy] [sell] (stock)
    /shop remove [id]
    /shop reload
    Examples:
    • Getting Started.. We are going to add stone, in bundles of 64 to purchase for 10, and sell for 2.
      • /shop add 1:64 10 2
      • For Stock:
        • /shop add 1:64 10 2 64
    • Lets test it:
      • /shop buy 1
    • Now lets update it.. it was bit expensive and nobody was really gaining money.
      • /shop update 1:64 8 5
      • For Stock:
        • /shop update 1:64 8 5 64
    • Now lets test again:
      • /shop sell 1
    • The end.
    Permission Nodes:
    Show Spoiler
    simpleshop.buy
    simpleshop.buy.gift
    simpleshop.sell
    simpleshop.items.remove
    simpleshop.items.reload
    simpleshop.items.add
    simpleshop.items.update
    Changelog:
    • Version 1.41
      • Rewrote chunks of the coding.
      • Added support for "gifting"
        • /buy [item]( : amount) [who]
    • Version 1.4
      • Fixed connection issues.
      • Fixed plugin hook issues.
      • Added Dependency download support.
      • Default file loading support like in iConomy.
      • Fixed up some CLI issues.
    • Version 1.3
      • Added support for stock
        • Modifies database! Backup before restarting!
      • Fixed some bugs revolving around listing pages.
      • Fixed issues with not being able to set non-sellable / buyable items.
        • Now use -1 for either buy / sell to disable that feature:
        • /shop add 1:64 -1 15
          • Stone is sellable but not purchasable!
    • Version 1.2
      • Commands are now CLI parsed.
        • Causes /shop [id] to become /shop check [id]
      • Shop list is now paginated (Untested)
    • Version 1.1
      • Fully working with selling items.
     
    dojopunk and TonyMcDanza like this.
  2. Offline

    Stmeter

    Code:
    Jan 23, 2011 10:10:19 PM org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event PLAYER_COMMAND to SimpleShop
    java.lang.ArrayIndexOutOfBoundsException: 1
            at com.nijikokun.bukkit.SimpleShop.iListen.onPlayerCommand(iListen.java:88)
            at org.bukkit.plugin.java.JavaPluginLoader.callEvent(JavaPluginLoader.java:135)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:201)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:547)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:523)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:65)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:261)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:197)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    
    I'm not sure if this is because I'm using Build 126. That's the error I get when I run /shop in-game.
     
  3. Offline

    walton88

    Selling is a bit buggy: users sell an item but it isn't removed from their inventory, meaning they can make infinite amounts of money!
     
  4. Offline

    moonmike

    Im using #66 and when I use
    /shop add 1:64 10 2
    it say its accepted then i try /shop buy 1 or /shop list i get this
    [shop] no items available.
     
  5. Offline

    Drakonas

    Woah, 66?

    I would try updating to 132. Most plugins now support it, let alone require build 127.
     
  6. Offline

    Nijikokun

    Check console to make sure it has even created the database.
    --- merged: Jan 24, 2011 4:04 AM ---
    MySQL or Sqlite, post the error so I can fix it.
     
  7. Offline

    silentdojo

    Here's some of the errors while using mysql. Trust me i set everything up how ya need it cuz it works in sqllite just by switching the mode.

    Code:
    2011-01-23 17:46:56 [INFO] [SimpleShop] Creating database.
    2011-01-23 17:46:56 [SEVERE] [SimpleShop]: Could not create table for mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'per` )) ENGINE = MYISAM' at line 1
    2011-01-23 17:46:56 [INFO] [SimpleShop] Database Created.
    Then while the server was on it threw a bunch of these...

    Code:
    2011-01-23 17:51:56 [SEVERE] [SimpleShop]: Could not grab item data for mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.SimpleShop' doesn't exist
    Also... I am using all updated versions of CB and all other plugins I use. Everything else works great.
    PS I love all of the work you do... just tryin to help.
    --- merged: Jan 24, 2011 4:41 AM ---
    Do you have the sqlite jar in the root folder of your server.... if not thats your problem.
     
  8. Offline

    Nijikokun

    No errors thrown when creating it?

    Code:
    CREATE TABLE `SimpleShop` ( `id` INT( 255 ) NOT NULL AUTO_INCREMENT, `item` INT( 255 ) NOT NULL, `type` INT( 255 ) NOT NULL, `buy` INT( 255 ) NOT NULL, `sell` INT( 255 ) NOT NULL, `per` INT( 255 ) NOT NULL ,PRIMARY KEY ( `id` ), INDEX ( `item`, `type`, `buy`, `sell, `per` )) ENGINE = MYISAM;
    For making the table.

    Version 1.1 Released.

    Fixes removal issues.
     
  9. Offline

    moonmike

    Ok I missed read the instructions on the sqlite jar thanks for the help
    It works Great now Thanks
     
  10. Offline

    silentdojo

    Not that I saw but thanks testing now.
    --- merged: Jan 24, 2011 4:53 AM ---
    Niji the SQL script is missing a quotation... after the second "sell...
    I got it to work adding myself obviously... just for anyone who tries to use it in the future there won't be any confusion.
     
  11. Offline

    Wolfy9247

    In the future will you add the support (like in hMod) to have the location of a shop, such as having a shop named [Shop] at [Location] on the map and having multiple shops?

    If this is already added, I didn't notice. Right now it just seems like everywhere on the map you can use the /shop command instead of in the actual shop radius.
     
  12. Offline

    silentdojo

    I get the following in the server when i type /shop in-game...

    Code:
    Jan 24, 2011 7:46:49 AM org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event PLAYER_COMMAND to SimpleShop
    java.lang.ArrayIndexOutOfBoundsException: 1
            at com.nijikokun.bukkit.SimpleShop.iListen.onPlayerCommand(iListen.java:88)
            at org.bukkit.plugin.java.JavaPluginLoader.callEvent(JavaPluginLoader.java:135)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:201)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:554)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:528)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:65)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:261)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:197)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
     
  13. Offline

    Wolfy9247

    I get the same error with my server, but all of the other shop commands still work.
     
  14. Offline

    DJ411

    This would be cool if u can have areas set so they can't buy while mining. almost make it like an actual shop!
     
  15. Offline

    nidefawl

    I still had problems with creating the table.

    see new post
     
  16. Offline

    Dspirit

    [BUGS]
    1) Example buying/selling 1 diamond for 10, if you type /shop buy diamond:2 - you will get 2 diamond but just 10 points is taken
    2) Whenever the setting the item's Buy/Sell price is above 100, when buying the item it will give you an error ingame "[Shop] Amount over max per purchase"
     
  17. Offline

    HaloInverse

    With v.1.1:

    - The amount of money added/deducted for selling/buying multiple items is not multiplied properly by the number of items.

    Examples:
    /shop add 4:1 1 1
    /shop buy 4 <- adds 1 cobble, deducts 1 coin
    /shop sell 4 <- deducts 1 cobble, adds 1 coin
    /shop buy 4:3 <- adds 3 cobble, deducts 1 coin
    /shop sell 4:3 <- deducts 3 cobble, adds 1 coin

    /shop update 4:5 3 3
    /shop buy 4 <- adds 5 cobble, deducts 3 coins
    /shop buy 4:2 <- adds 10 cobble, deducts 3 coins

    Also, the max-items-per-purchase setting appears to be being compared against the (not actually used) total transaction value, instead of the count of items.

    Setting: max-items-per-purchase=64
    Setting: max-items-per-sale=64
    /shop update 4:64 1 1
    /shop buy 4 <- adds 64 cobble, deducts 1 coin
    /shop sell 4 <- deducts 64 cobble, adds 1 coin
    /shop update 4:64 150 75
    /shop sell 4 <- deducts 64 cobble, adds 75 coins
    /shop buy 4 <- "[Shop] Amount over max per purchase."

    Setting: max-items-per-purchase=10
    Setting: max-items-per-sale=10
    /shop update 4:1 2 2
    /shop buy 4:5 <- adds 5 cobble, deducts 2 coins (instead of 5x2=10, as above)
    /shop buy 4:6 <- "[Shop] Amount over max per purchase." (6x2=12)
    /shop sell 4:10 <- deducts 10 cobble, adds 2 coind
    /shop sell 4:11 <- "[Shop] Amount over max sell amount." (max-items-per-sale comparison is correct)

    Also:

    /shop reload <- "[Shop] Invalid item." (Running as user with * permissions)
    /shop <- Same console error as quoted previously in this thread.

    Hopefully, this is enough information for you to pinpoint the code errors.

    I apologize (and applaud) if this is already fixed in an unreleased 1.2.
     
  18. Offline

    shadrxninga

    Code:
    2011-01-24 02:58:21 [INFO] [SimpleShop] Creating database.
    2011-01-24 02:58:21 [SEVERE] [SimpleShop]: Could not create table for mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'per` )) ENGINE = MYISAM' at line 1
    2011-01-24 02:58:21 [INFO] [SimpleShop] Database Created.
    Not exactly sure what this means...
     
  19. Offline

    Nijikokun

    Updated jar with working SQL

    Edit: Updated jar fixing the issues as explained two posts up by @HaloInverse.

    TL;DR Re-Download SimpleShop. Replace JAR file.
     
  20. Offline

    Chumber

    I can't get it to work, i've added the sqlite and mysql JAR into the CB folder so no error there, it even created the sqlite DB inside plugins/SimpleShop but won't add any items.

    Switched to mySQL because i got a minecraft table anyway, got an error ^^
    Code:
    2011-01-24 13:21:00 [SEVERE] [SimpleShop]: Could not create table for mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'per` )) ENGINE = MYISAM' at line 1
    
    created table by hand, no error on server start but /shop add 1:64 5 2 isn't working

    CB #135
    mysql Ver 14.12 Distrib 5.0.51a

    Ah and if i use shop list / add it always says "unknown command" in console although i get a "[Shop] No items available." ingame.

    Any ideas? :D
     
  21. Offline

    Nijikokun

    Re-Download the file. As stated above your post.
     
  22. Offline

    Chumber

    Redownloaded...
    Code:
    2011-01-24 13:32:23 [SEVERE] [SimpleShop]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-01-24 13:32:23 [INFO] [SimpleShop] Creating database.
    2011-01-24 13:32:23 [SEVERE] [SimpleShop]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-01-24 13:32:23 [INFO] [SimpleShop] Database Created.
    
    mysql-connector-java-bin.jar is present...
     
  23. When I launch the server, I get this.
    [INFO] [SimpleShop] Permission system not enabled. Disabling plugin.

    I have the settings on SQLite.
    database-type=SQLite

    What am I doing wrong?
     
  24. Offline

    Chumber

  25. I do have permission plugin installed, but it still doesn't work.
     
  26. Offline

    Qtinifier

    I got the same problem :(

    mysql-connector and sqlite-connector are both in the main folder where craftbukkit-0.0.1-SNAPSHOT.jar is located
     
  27. Okay, it seemed to be that the Permission plugin was not loading correcly, now it is though.
    Now theres a new problem. When I type /shop, I get this.
     
  28. Offline

    HaloInverse

    Installed the .jar from the .zip for the updated 1.1.

    Transaction value multiplication and count limits are fixed for me now.

    /shop correctly gives me the help page for the shop, without any console dump as mentioned above.
    (Tiny error: last line reads "/shop remove [id] - information about item", and /shop remove [id] actually removes the item from the shop, as it ought to.)

    /shop list and /shop add function as expected. Receiving no errors regarding MySQL table creation/access...

    I'm not sure why this is (now) completely working for my server, and still not for others.

    Running CB#135, Permissions 1.8, iConomy 2.2.
    mysql-connector-java-bin.jar, mysql.properties, and sqlitejdbc-v056.jar are present in the CB root folder.

    I'd be bouncing with glee, except I haven't had my second coffee this morning yet. Maybe later.

    Edit: Is there a syntax for /shop add or /shop update which allows an item to be set as sellable, but not buyable?
     
  29. Offline

    nidefawl

    still had problems with your sql-table-creation, and what I have posted before wasn't working too :p

    this one should really work
    Code:
    CREATE TABLE `SimpleShop` ( `id` INT ( 255 ) PRIMARY KEY , `item` INT ( 255 ) NOT NULL, `type` INT ( 255 ) NOT NULL, `buy` INT ( 255 ) NOT NULL, `sell` INT ( 255 ) NOT NULL, `per` INT ( 255 ) NOT NULL);
    CREATE INDEX itemIndex on SimpleShop (item);
    CREATE INDEX typeIndex on SimpleShop(type);
    CREATE INDEX buyIndex on SimpleShop (buy);
    CREATE INDEX sellIndex on SimpleShop (sell);
    CREATE INDEX perIndex on SimpleShop (per);
     
  30. Offline

    bogboom

    Love this plugin thanks. One minor issue, when using /shop list it does not get divided into pages, so when listing a lot of items you can't see them all.
     
  31. Offline

    Nijikokun

    Re-download. I have fixed this issue. I forgot to replace the MANIFEST.MF; Sorry..
     

Share This Page