[INACTIVE][ECON] DynamicMarket v.0.4.8.1 - Versatile Shop Plugin [440-480+?]

Discussion in 'Inactive/Unsupported Plugins' started by HaloInverse, Feb 2, 2011.

  1. Offline

    HaloInverse

    DynamicMarket - Dynamic Global Shop Plugin

    Version: 0.4.8
    Built against: Bukkit 0.0.1 build #412
    Works with: CraftBukkit 0.0.1 builds #440-480 or thereabouts.

    Requires:
    • Permissions 2.5
      • Very recommended, but now optional! See "DynamicMarket.settings" below.
    • iConomy 4.1
    • Either of:
      • SQLite (easiest to set up, reccomended)
      • MySQL (more troublesome, more powerful)
    Buy items, sell items, admins set prices, et cetera. However, there's a lot going on under the hood...

    READ THIS BEFORE PROCEEDING.
    Seriously. (open)

    This plugin has a great deal of flexibility, but the price of more flexibility is more command options to control that flexibility. Computers just aren't very psychic.

    While in-game help exists for commands, the output from /shop help (<topic>) is intended to be a quick reference, not exhaustive documentation. Full instructions simply won't fit on the MineCraft client's tiny text display.

    You should read and understand the following sections before installing this plugin and setting up your shop. If not, you should at least read and understand the following sections while you are setting up your shop items.


    The big feature: Dynamic pricing. Items can be set to increase in price as they are purchased from the shop, and decrease in price as they are sold back, simulating open market conditions. The initial prices of items are just considered a starting point - user transactions will eventually adjust an item's price to a near-ideal level, based on actual value vs. rarity.

    However, as of 0.4.5, the configuration fields are now flexible enough to allow a range of behaviours, from fixed pricing with no stock limits, to fully-dynamic pricing with finite stock levels.

    This is by no means "complete" in the sense of "finished adding features", but it is complete enough to be functional and usable.

    Current Features (open)

    New & Current Features:
    • Buying and selling of items:
      • Item prices can be set to dynamically adjust according to supply and demand. This is highly adjustable, including the rate of price increase/decrease per transaction, optional hard overstock/understock limits, price ceilings/floors, etc. Leaving all the extra features turned off makes an item's price fixed and always-in-stock, like a basic "flat rate" shop.
      • Subtypes of items are fully supported.
      • List of items in the shop is broken into pages, accessible by number.
        • Partial-name searching! "/shop list wood" shows everything with "wood" in the name.
      • Item names for buy/sell/info also use partial substring matches.
      • A dynamically-priced item might cost more for 10 items than the cost of 1 item multiplied by 10, due to stock depletion. So, the "/shop <id>" command now takes an optional ":<count>" parameter, so you can get a quote for the actual buy/sell price of larger numbers of items.
    • Administration:
      • Shop items are edited via a "tag" system, so you don't have to re-enter every field for each small change. Plus there's a few utility tags which do other things to an item's record...
      • Item names are now editable, and will persist (independent of items.db) until the item's record is deleted.
        • This also makes items.db a convenience instead of a necessity, since items can be added by ID and then immediately renamed.
      • A "Default" item exists in the shop, which cannot be bought or sold, but serves as the base data for any new items you add to the shop. Any tags not supplied when you add an item will be copied from whatever you put into "Default".
      • Basic sanity-checking on input data has been added. Also, adjusting an item's bundle-size will rescale its price automatically.
      • Items can be set to be purchasable but not sellable, or vice versa. (Set either price to -1 to disable that transaction type for that item.)
        • Tags like "canbuy:n" and "nosell" can now be used.
      • An extended in-game help system. "/shop help" lists available commands and help topics. "/shop help <topic>" gives help on a shop command or other shop-related topic listed in the main help.
      • The list of commands displayed is filtered by the user's current permission level.
      • Shortcuts for all commands (except for database reset).
      • All commands except for "/shop buy" and "/shop sell" can be accessed through the Bukkit console. No need to log in to add or update items!
      • Access to the entire shop is now restrictable by permission.
      • Highly informative error messages, to help reveal why your database exploded. (Which really shouldn't happen, but you never know...)
      • The shop DB can now be exported to a .csv file, edited in your favorite spreadsheet, and re-imported back into the database, making large-scale changes easier.
      • NEW: The revenue/cost of transactions can now be transferred to another account. With the basic plugin, this can be an admin's iConomy account, or a dummy "GovernmentBank" account. (Don't use that name, or some bright spark will register that username and exploit you.) With a wrapper plugin, this can be set to link a shop's funds directly to an owning player's iConomy balance.
      • NEW: Transaction logging to a comma-delimited file, ready to import into a spreadsheet for nefarious financial analysis!

    Market Mechanics (open)

    Quick Market Mechanics Description:
    • Instead of a "buy price" and a "sell price", items now have a "base price" and a "sales tax". The "buy price" is based on the base price (adjusted by stock, if set to do so), and the "sell price" is based on (<buy price> - <sales tax%>). So if the sales tax is set to 25, then an item's selling price will be 75% of its purchase price. (The sales tax is entered as a number from 0 to 100, representing 0% to 100% tax.)
      • Using the old "/shop add <id> <buyprice> <sellprice>" format still works - the plugin just calculates the base price and sales tax, so that the buying and selling prices come out right.
    • Shop items have a "stock level", which is not necessarily a literal count of items in stock. By default, the stock level is considered an offset from baseline, rather than an absolute count.
      • Items with stock near zero are considered to be in "average" supply, and will be priced at their base price.
      • Items with a positive stock are considered "in surplus", and will be priced below their base price.
      • Items with a negative stock are considered "understocked", and will be priced above their base price.
      • This interpretation of stock levels can be made to behave like literal counted stock, by setting an item's StockFloor to zero, which prohibits negative stock.
    • Items have a "volatility", which indicates how quickly the price changes based on changes in stock level. It represents the percent increase in an item's price per item purchased, multiplied by 10000. V=1 (the lowest level) means that 100 items would have to be purchased to raise the price by 1%. V=10000 (the highest level) means that 1 item purchased would raise the price by 100% (doubling the price). (More examples in tags.txt)
      • There is also "inverse volatility", which represents the number of items needed to be bought in order to double the buying price (or halve it, if selling). This is more convenient for some people's mindsets, and is converted into volatility when entered.
    • The "sell price" is actually calculated from the buy price at the current stock level + 1, rather than the current stock level. This is to prevent gaining endless money by buying an item (driving the price up) then immediately selling it back (dropping the price) - if <sales tax> = 0, then buying-then-selling like this produces zero net gain/loss (as it should).
    • The tag presets "fixed", "float", "finite", and "flat" allow you to quickly set up common options. If used with the "Default" item before adding items to your shop, this will allow you to set the overall behaviour of the shop easily. See Tag Reference for further details.

    Commands (open)

    Commands:

    <Angle Brackets> denote parameters.
    (Round Brackets) denote optional sections.
    The brackets themselves are not part of the command; they are just used to describe syntax. Brackets should not be typed.
    If executing shop commands through the Bukkit console, leave off the initial slash.

    /shop - Shows the main help page. Lists commands and shortcuts.
    /shop help - Ditto.
    /shop help <topic> - Shows help on the given command or subject.
    /shop help tag <tagName> - Shows help on the given item tag.
    /shop <id>( :<count>) - Shows current buy/sell information on the given item.
    <id> can be an item name or a type number with an optional subtype:
    <id> = <itemName> | <itemID> | <itemID>,<subtypeID> | Default
    If <count> is used, shows the total price for the given number of items/bundles.
    /shop list (<partname>) (<pageNum>) - Lists a page of items in the shop. Default page = 1.
    If <partname> is used, lists only items with <partname> as part of their name.
    /shop buy <id>( :<quantity>) - Purchases an item. Default quantity is 1 bundle.
    /shop sell <id>( :<quantity>) - Sells an item. Default quantity is 1 bundle.
    /shop add <id>( :<bundleSize>) (<buyPrice> (<sellPrice>)) <tagList> - Adds an item to the shop list.
    <buyPrice> and <sellPrice> are accepted for convenience, and are internally converted to BasePrice and SalesTax.
    Unused tags will have their data copied from the Default item.
    Transactions will be in multiples of <bundleSize>. Default quantity is 1 item per bundle (unless overriden with the Default record)
    /shop info <id> - Shows much more detailed information about an item in the shop, such as stock level, volatility, etc.
    /shop update <id>( :<bundleSize>) (<buyPrice> (<sellPrice>)) <tagList> - Edits an item's shop data record.
    Data is first copied from the old record, then tags are applied in order of entry.
    NEW! <id> can be "all", applying changes to all items in the shop list.
    /shop remove <id>- Removes an item from the shop list.
    /shop reload - Reboots the plugin, reloading the configuration file and items.db.
    /shop reset - Deletes and recreates the shop database from scratch. Asks for an extra confirmation before doing so.
    /shop exportdb - Exports the shop database to a .csv file. The name and location are configured in SimpleMarket.settings. (Default: Plugins/DynamicMarket/shopDB.csv)
    /shop importdb - Imports a .csv file into the shop database. Same file location as used by the exportdb command. Note that the previous contents of the database are NOT cleared out before importing, so you may want to do a "/shop reset" before importing. The file's format MUST match the format of the exported file (except for quote marks, which are stripped out on import).

    Tag Reference
    Tag Usage Examples
    Permissions (open)

    Permissions:

    'dynamicmarket.access' : Grants basic access to the root /shop command.
    'dynamicmarket.buy' : Grants purchase rights.
    'dynamicmarket.sell' : Grants selling rights.
    'dynamicmarket.items.add' : Grants the ability to add new items to the shop.
    'dynamicmarket.items.update' : Grants the ability to edit items in the shop.
    'dynamicmarket.items.remove' : Grants the ability to remove items from the shop.
    'dynamicmarket.admin' : Grants the ability to delete-and-rebuild the shop database, and to reboot the plugin.

    Installation/Setup (open)

    Installation/Setup:
    • If you haven't already done so, install Permissions and iConomy, and ensure they work.
    • Copy DynamicMarket.jar into your Plugins/ folder.
    • NEW: Copy items.db into Plugins/DynamicMarket/ (or whichever directory you specify in DynamicMarket.settings) (DynamicMarket will work with other plugins' items.db files, but not all plugins will handle the extra subtype data in the items.db linked below.)
    • NEW: Copy either the SQLite connector or the MySQL connector into your main MineServer/Bukkit folder.
      • Or, if you have a MySQL server running, edit DynamicMarket.settings to specify the MySQL server, login, and password.
    • Edit plugins/Permissions/config.yml, and give everybody the appropriate permissions.
      • Most users would get 'dynamicmarket.access', 'dynamicmarket.buy', and 'dynamicmarket.sell', unless you want to restrict such commands to registered/VIP users.
      • Mods would probably get 'dynamicmarket.items.*'
      • Admins should get 'dynamicmarket.admin', if they don't already have '*'.
    • (Re)Start your MineCraft server. Errors may be thrown to the console, but the file Plugins/DynamicMarket/DynamicMarket.settings should be created.
    • Edit DynamicMarket.settings. Particularly, the setting "database-type".
      • "database-type=sqlite" : Use the SQLite connector. This is the simpler option. No further database access configuration should be needed.
      • "database-type=mysql" : Use the MySQL connector. You will need to set the options "mysql-user", "mysql-pass", and "mysql-db", as well as having a working MySQL server installation set up already.
    • NEW: Log in to MineCraft as someone with 'simpleMarket.admin' permission, or use the Bukkit console. Use "/shop reload" to load the edited config file.
    • Use /shop add to fill the market with tasty blocks at scandalous prices.
      • You WILL want to use "/shop update default" to set up some sensible default values for the items you will be adding, so you don't have to do so much typing for every item. (Or at least inspect the Default entry, to be sure you agree with it.)
      • If you want to make all of the items in the shop use dynamic pricing, set up the parameters in the Default item FIRST, so you don't have to go back and modify 100+ items to support variable pricing.

    DynamicMarket.settings Reference

    Downloads:
    • DynamicMarket 0.4.8.1 (.jar) (.7z) (iConomy 4.1, Permissions 2.5)
    • DynamicMarket 0.4.8 (.jar) (.7z) (iConomy 3.0, Permissions 2.1)
    • DynamicMarket 0.4.6.1 (.jar) (.7z) (iConomy 2.1 / Cookies+iConomy Wrapper)
    • DynamicMarket Source on GitHub
    • items.db <-- Contains subtypes. Put this in /Plugins/DynamicMarket/.
    • SQLite Connector (reccomended) Put this in your MineCraft server/Bukkit root.
    • MySQL Installation Guide (not so easy, probably not recommended for SQL server beginners)
    • Sample shopDB.csv Many (but not all) items, set up for floating-stock+floating-prices. Edit it if you like, then put this in your Plugins/DynamicMarket folder and use /shop importdb to load the items into your shop.
    DynamicMarket Wrapper Plugins:
    • DMWrapper: Restricts shop access to specific regions. Outdated.
    Want to integrate DynamicMarket's shop functions into your own plugin? Read this!
    To Do List(s) (open)


    To Do for v.0.5:
    • Logging of transactions. Done.
      • Global messages to alert to price changes.
    • Item classes: Use Permissions to control access to certain types of items, i.e. make safe items (gravel, stone, iron) available to anyone, but limit traffic in dangerous items (TNT, lava buckets, monster spawners) to VIPs. (For example.)
    • Customizable interface/highlight colours. Done.
    • Clean up the d*** out-of-date comments in the code. (Working on it.)
    To Do before 1.0:
    • Optional auto-transactions triggered by price disparities in raw/processed materials.
    • Possible migration of the new help system to a separate plugin, unless the expanded features needed become available in MCDocs or Bukkit.
    • Migrate config file handler to Yaml.
    • Random fluctuations of stock levels (would make the market more lively on a low-population server)
    • Stock levels drift back to rolling averages (smoothes out short-term price spikes, allows for long-term price drifting)

    Recent Changes:

    0.4.8.1:
    • Migrated to Permissions 2.5, iConomy 4.1.
    0.4.8:
    • shopLabel moved from a table name suffix to a table field.
    • Using "all" as the item name now applies the given tags to all items with the current shopLabel.
    • Altering an item's bundleSize now changes its stock level, as well as its basePrice.
      • New stock level is rounded down, to stave off future item duplication issues.
    • Sanity-check behaviour changed to make database queries more efficient and fend off future exploits:
      • stockHighest/stockLowest set to stock if lower/higher than stock.
      • stockCeil/stockFloor is set to stockFloor if lower/higher than stock.
      • priceCeil is raised to priceFloor if priceCeil<priceFloor.
        • Previous behaviours: Swap if order wrong, range-crop stock if outside highest/lowest/floor/ceil.
    • Fixed bug: Adding items without specifying count did not import count from default record.
    0.4.7:
    • Upgraded to iConomy 3.0.
    0.4.6.1:
    • Rolled back iConomy calls to 2.x style, to be compatible with Cookies' iConomy wrapper.
    0.4.6:
    • Support for transaction funds to be backed by an iConomy account.
      • Account link parameters added to wrapper-call messages.
    • Wrapper calls streamlined.
    • Added basic transaction logging.
    0.4.5:
    • Volatility can now go as low as 0.
      • In this way, stock can still be counted without affecting price.
    • CSV import/export now uses +INF / -INF as shorthand for min/max values in applicable fields.
    • Message colours now customizable in DynamicMarket.settings.
    • Expanded help on tags/presets.
    • Changed "fixed" tag, splitting its function with "flat".
    • Added tag presets "flat" and "finite".
    • Updated tag "renorm" to accept an optional new stock level other than 0.
    Full Changelog

    Credits:
    • Nijikokun: SimpleShop v.1.1, on which this was based. (And for Permissions and iConomy, on which this relies.)
    • AtomicAcidBath: Assistance with tracking down a hard-to-see MySQL syntax error.
     
    SoapFlakes and Mahngiel like this.
  2. Offline

    AtomicAcidbath

  3. Offline

    Nathan C

    EDIT: Got SQlite working. But all items are "UNKNOWN", when added to the shop.
     
  4. Offline

    HaloInverse


    Copy items.db to your Plugins/SimpleMarket/ directory, or change Plugins/SimpleMarket/SimpleMarket.settings:items-db-path= to point to your items.db file.

    Alternatively, use the "name:<newname>" tag to rename your already-entered items, or add names to items as you enter them.
     
  5. Offline

    aMannus

    Funny. I proposed this exact model of a dynamic economy to Niji a really long time ago, on the hMod forums. He said they tried all kinds of dynamic pricings possible, and that none worked, leading to him not implementing this. So, I was pretty much convinced my model wouldn't work, and here you are, making a plugin doing exactly the same.

    In other words, you're my absolute hero, and I'm going to try this as soon as possible.
     
  6. Offline

    fugue2005

    i just tried /shop -u 264 stock:100 but my stock stays at 0
    and nobody can buy
     
  7. Offline

    HaloInverse

    Figuring out the raw math behind a generalized proportionally-adjusting dynamic-price market was the second hardest part of building this. :) I spent about two solid days on that alone.

    Could you tell me what "/shop -i 264" produces?
     
  8. Offline

    Nate204

    I get this with Sqlite

    I simply CAN NOT get the plugin to work correctly =(
    --- merged: Feb 16, 2011 7:27 AM ---
    I just updated to the most recent build, and I feel like I have MySQL working.....
    /shop update default doesn't seem to do anything.
    I added stone to the shop with /add, and it simply added Unknown to the list
    --- merged: Feb 16, 2011 7:48 AM ---
    Ok nvm, I get this now every time I try and buy.

    --- merged: Feb 16, 2011 7:48 AM ---
    That's all with Mysql
     
  9. Offline

    HaloInverse

    Nate204: Your SQLite error log contains many instances of "SQL error or missing database (no such table: Market)". If you go back to SQLite, try "/shop reset" to rebuild the table.

    Your MySQL log has revealed another issue... Apparently, SQLite supports max(<a>,<b>) as a means of selecting the larger of two values, but MySQL doesn't - it expects GREATEST(<a>,<b>) to do the same thing, and only uses max(<field>) to select the highest value of a field in a query. Fixing this now. Fixed in 0.4a rev.3.
     
  10. Offline

    Nathan C

    Omg. I got it to work!

    Finally a working shop plugin...........that has stock!

    I think I love you.
     
  11. Offline

    Blackstorm72

    Updated to 326, now still getting the database failed for sqlite, which is in the Minecraft Server Root folder under /lib.
    Am I forgetting something? Its the only thing stopping me right now, lol. All the commands work in-game, just no database. (Persistence is spitting out the same error for it too; yet its in the correct section[sqlite], so I have no idea why sqlite is being terrible lately.)
     
  12. Offline

    Nate204

    What did you type?
    We can't get ours to go with MySQL.
     
  13. Offline

    Nathan C

    Ah bro, I had that prob too.

    Type
    Code:
    /shop reset
    That seems to make the database tables, and everything is working great now with mysql. Also I have got sqlite to work, but prefer Mysql.

    He also released a new version in the last hour, make sure your get that.
    --- merged: Feb 16, 2011 9:44 AM ---
    Make sure to add
    Code:
    Class-Path: ./sqlitejdbc-v056.jar
    
    to the
    
    META-INF/MANIFEST.MF right under the 'Specification-Version: unknown' line:
    
    to the Craftbukkit.jar and make sure you have the latest version.

    I had SQlite working fine on build 407
     
  14. Offline

    Juze

    Thanks for the fixes, downloading rev 3 now. :)
    --- merged: Feb 16, 2011 10:31 AM ---
    I've always also wanted to point out how you name your download link as SimpleShop instead of SimpleMarket. However, the file you get is SimpleMarket.jar. :)
     
  15. Offline

    Nate204

    We appreciate the help Nate!

    My only problem is when I type:
    /shop add 5:32 64 64 v:20 sl:0 sh:+inf

    It adds the item, and says we have zero in stock. I'll then sell that item to the store.... but it wont change. It will say I cant buy any of that item because it's not in stock. The Items buy will have a [-] next to it. I've even tried (canbuy:t) and I get nothing.

    We enjoy the Idea of the plugin, but can't seem to get it to fire up the way we need it too.

    Thanks again everyone!
     
  16. Offline

    Juze

    I'm still getting these errors.

    Code:
    2011-02-16 09:28:25 [SEVERE] [SimpleMarket]: Error executing statement [DROP TABLE 'Market';] with 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 ''Market'' at line 1
    2011-02-16 09:28:25 [SEVERE] [SimpleMarket] Database table could not be deleted.
    
    I tried /shop reset -> /shop reset confirm, and it errors. Using MySQL.
     
  17. Offline

    Fluff

    The Quick Market Mechanics description was helpful, but I'd really like to see the math. It's very important to me that no one be able to "game" the shop system. We worked up a formula for a fluctuating economy on our server, so we were able to mathematically prove that you couldn't gain money just by some creative buying and selling. I'd like to use your plugin, but I want to make sure it has this same attribute.
     
  18. Offline

    Luis

    im still getting this error im on b326

    2011-02-16 08:22:42 [INFO] [SimpleMarket] Creating database.
    2011-02-16 08:22:42 [SEVERE] [SimpleMarket]: Error executing statement [CREATE T
    ABLE Market ( id INT( 255 ) NOT NULL AUTO_INCREMENT, item INT NOT NULL, subtype
    INT NOT NULL, name CHAR(20) NOT NULL, count INT NOT NULL, baseprice INT NOT NULL
    , stock INT NOT NULL, canbuy INT NOT NULL, cansell INT NOT NULL, volatility INT
    NOT NULL, salestax INT NOT NULL, stocklowest INT NOT NULL, stockhighest INT NOT
    NULL, stockfloor INT NOT NULL, stockceil INT NOT NULL, pricefloor INT NOT NULL,
    priceceil INT NOT NULL, jitterperc INT NOT NULL, driftout INT NOT NULL, driftin
    INT NOT NULL, avgstock INT NOT NULL, class INT NOT NULL PRIMARY KEY ( id ), INDE
    X ( item, subtype, name )) ENGINE = MYISAM;] with mysql: com.mysql.jdbc.exceptio
    ns.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 '( id ), INDEX ( item, subtype, name )) ENGINE = MYISAM' at line 1
    2011-02-16 08:22:42 [SEVERE] [SimpleMarket] Database creation *failed*.
     
  19. Offline

    Will-ko

    Is there a way of viewing the db and adding items without doing ingame?

    Also, everytime I add an item ingame I get booted out with "internal server error".

    Code:
    2011-02-16 13:32:53 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
        at com.bukkit.haloinverse.SimpleMarket.MarketItem.<init>(MarketItem.java:203)
        at com.bukkit.haloinverse.SimpleMarket.iListen.shopAddItem(iListen.java:428)
        at com.bukkit.haloinverse.SimpleMarket.iListen.onCommand(iListen.java:715)
        at com.bukkit.haloinverse.SimpleMarket.SimpleMarket.onCommand(SimpleMarket.java:92)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:171)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:575)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:232)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:310)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:225)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
     
  20. Offline

    Heinz Harald

    Same here after /shop add gold 1 20 20
    i get bootet out with "internal server error" too.

    Newsest Craftbukkit, SimpleMarket 0.4a r3

    Code:
    2011-02-16 15:32:18 [WARNING] Failed to handle packet: java.lang.NullPointerException java.lang.NullPointerException
        at com.bukkit.haloinverse.SimpleMarket.MarketItem.<init>(MarketItem.java:203)     at com.bukkit.haloinverse.SimpleMarket.iListen.shopAddItem(iListen.java:428)
        at com.bukkit.haloinverse.SimpleMarket.iListen.onCommand(iListen.java:715)
        at com.bukkit.haloinverse.SimpleMarket.SimpleMarket.onCommand(SimpleMarket.java:92)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:171)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:610)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:589)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:232)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:317)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    after Server restart


    Code:
    2011-02-16 15:42:37 [SEVERE] [SimpleMarket]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-02-16 15:42:37 [INFO] [SimpleMarket] Creating database.
    2011-02-16 15:42:37 [SEVERE] [SimpleMarket]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-02-16 15:42:37 [SEVERE] [SimpleMarket] Database creation *failed*.
    
     
  21. Offline

    Will-ko

    Well I worked out how to do it:
    "/shop add gold:1 20 20"

    But still, the tags are abit derp. Trying to get them all to work right.
     
  22. Offline

    Nachocuban

    Any way to import the the shop.db from Nij's Simpleshop? Or will this be a feature of the upcoming spreadsheet editing?
     
  23. Offline

    SuperAlekZ

    Wonderful plugin. Codewise probably a lil' mess :p
    Also it would be wonderful if we could simply at the shop-items in some config file
    --- merged: Feb 16, 2011 3:42 PM ---
    Oh, when entering /shop add 1 64 100 75
    Code:
    2011-02-16 16:37:20 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
        at com.bukkit.haloinverse.SimpleMarket.MarketItem.<init>(MarketItem.java:203)
        at com.bukkit.haloinverse.SimpleMarket.iListen.shopAddItem(iListen.java:428)
        at com.bukkit.haloinverse.SimpleMarket.iListen.onCommand(iListen.java:715)
        at com.bukkit.haloinverse.SimpleMarket.SimpleMarket.onCommand(SimpleMarket.java:92)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:171)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:610)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:589)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:232)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:317)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    2011-02-16 16:37:21 [INFO] Freed 46.732521057128906 MB.
    So well it crashes my minecraft.. not neccessary :/
     
  24. Offline

    Will-ko

    When adding stuff you have to do it as such:
    "/shop add <item#/name>:<quantity> <buy> <sell>"

    I do agree though, that alot of the commands are confusing/abit messy.
    The tags arn't that easy to remember either.

    Also, when I was messing around without any tags I sold an item and it gave me a massive amount of money rather than the sell price I set.
    ---------------------------
    I really like the idea, but it's abit... "messed up" atm.
    We'd love to use it, but we'll wait until a more stable version.
     
  25. Offline

    Qtinifier

    when i try /shop add cobblestone:64 10 10
    it say it does not recognize the item or command
    --- merged: Feb 16, 2011 5:41 PM ---
    i have CB328 and the 0.4 r3 of this plugin
     
  26. Offline

    Nate204

    Ok, Yeah.

    This is still broken. I don't know how~ or maybe it is simply user error...
    but I can't get the shop to update it's stock.

    I'll type /shop update 1:64 64 64 sl:0 sh:+inf stock:100
    and it will go through with no errors.

    I'll then sell a bunch to the shop and check it after just to still find it at Buy:[-]
    Item not in stock.

    And suggestions?
    --- merged: Feb 16, 2011 7:25 PM ---
    btw: I've been using MySQL and Sqlite. I just tried /shop update 1 sl:0, and then /shop update 1 stock:100 andf then I crash. I love the idea of a dynamic shop with prices, but all I really want is a stock system ;_;

    Thanks for any help!
     
  27. Offline

    Blackstorm72

    As soon I was about to do that I got the stats and achievement plugin, and stats automatically fixed my sqlite issue. Thanks for the workaround though!
    If you have a sqlite issue of not showing up/errors - use the above or use stats, it appears to fix sqlite.
     
  28. Offline

    SuperAlekZ

    Oh my god, tested and Volatility and Stock don't even work...
     
  29. Offline

    Nate204

    Just found out that stock low and stock high aren't what effect "Stock levels" It's stock floor and stock ceiling..... Adjust those, and stock:## will work. btw, stock:## is in bundles, not in individual items.

    a day and a headache later....
    lol
     
  30. Offline

    HaloInverse

    The file sqlitejdbc-v056.jar should not be in the /lib directory... it should be one level up, in the same directory as craftbukkit-0.0.1-SNAPSHOT.jar and minecraft_server.jar. (The universal-binary sqlite jar should extract the appropriate platform-specific binaries into /lib when run.)

    Regarding adding the classpath to META-INF/MANIFEST.MF: From what I've been reading, whatever the current directory is when a .jar file is run is considered part of the class-path, and should be searched for .jars/classes by the JVM, if nothing is in the $CLASSPATH environment variable. Perhaps the reason why SQLite is working out-of-the-box for me, without editing MANIFEST.MF, is that I'm executing minecraft_server.jar from within the directory where it's located, and my $CLASSPATH is empty, which makes the class-path default to the "current directory"...which is where sqlitejdbc-v056.jar is, so it gets found and used.

    The Java classpath could be overridden by using the -cp switch in the command line being used to execute minecraft-server.jar. Maybe try adding "-cp $CLASSPATH:<path_containing_sqlitejdbc-v056.jar>" to your java command line, if you're having trouble getting SimpleMarket/Bukkit to see sqlitejdbc-v056.jar?

    Looks like your StockCeiling for that item might still be 0. Try "/shop update 5 sc:+inf".
    StockLowest and StockHighest are hard limits for stock levels. If you try to buy past StockLowest or sell past StockHighest, the transaction will fail outright.
    StockFloor and StockCeiling are soft limits for stock levels. You can buy/sell past StockFloor and StockCeiling, but the resulting stock level will remain capped at the StockFloor/StockCeiling.

    You're using an out-of-date version of the plugin. The most recent version (r.3) doesn't have those quote marks around the table/field names, which were part of an earlier problem. Re-download SimpleMarket.jar.
    That was very important to me, as well. I'll put in an expanded section regarding market calculations in a bit.
    You're running 0.4a rev.2 or earlier. Upgrade to 0.4a rev.3, this problem has been fixed.
    Spreadsheet export/import is coming in 0.5.
    The correct format for bundle size is "<id>:<bundleSize>". The command should be "/shop add gold:1 20 20". (EDIT: Will-ko figured it out.)
    The crash is due to numbers-without-tags only being processed for the first two tags - the third tag (the second 20) is not a valid tag. I'll make I've made the input routine more robust.
    Not at present, due to a completely different pricing paradigm - SimpleShop uses flat numbers for buy/sell prices, and SimpleMarket starts with a BasePrice, and calculates buy/sell prices using SalesTax/Stock/Volatility. I might add a converter later.
    Note that "/shop help tags" lists the tags for you with short descriptions, and "/shop info <id>" lists all the tags on an item, by name, and their current values.
    Fully named tags are supported, such as "/shop update stone baseprice:100 salestax:50 volatility:100", which is synonymous with "/shop -u 1 bp:100 st:50 v:100".
    The abbreviated forms of the tags are the same as the initial letters in the full name of the tag. BasePrice = bp,SalesTax = st, Name = n, Volatility=v, StockFloor = sf, etc.
    Do you have any suggestions on how to make the tags easier to remember?
    If you post the output from "/shop info <itemnameOrID>" for your messed-up item, I can probably tell you which field is mis-set.
    NICE! At last, progress on this mysterious issue! (I'm using Stats/Achievements as well.) I'll have a look at the Stats/Achievements source, and see if I can migrate the fix to SimpleMarket.
    I'm not certain I can pick out the source of the problem from this massive information dump. Could you be a littlemore vague? :)
    Sarcasm aside, a little more information on exactly how they "don't even work" would be helpful. Particularly the output from "/shop info <itemID>" for the item in question, what you're doing, what you're expecting to happen, and what actually happens.
    You might not have items.db in the right place. Either copy items.db to /Plugins/SimpleMarket/, or edit Plugins/SimpleMarket/Settings and change items-db-path= to the directory where you've put items.db, or use the item ID instead of the name when adding the item, and use the "name:" tag to add a proper name to the item.
     
  31. Offline

    Magik

    I can't get the connector drivers to work for MySQL or SQLite.
    I get an error like this for both drivers:
    Code:
    2011-02-16 15:58:02 [SEVERE] [SimpleMarket]: Database connector not found for sqlite: java.lang.ClassNotFoundException: org.sqlite.JDBC
    2011-02-16 15:58:02 [INFO] [SimpleMarket] Creating database.
    2011-02-16 15:58:02 [SEVERE] [SimpleMarket]: Database connector not found for sqlite: java.lang.ClassNotFoundException: org.sqlite.JDBC
    
    I was using craftbukkit#319, and as bamboo is currently down right now, I just pulled the github source and compiled ( I think it's ~ build 326, but not sure ). Both of these produce the same error.

    I tried first setting up MySQL, and I have the iconomy connector in my lib dir, so I copied that to the same dir as craftbukkit.jar ( it was mysql-connector-java-5.1.14-bin.jar ). And I could not get the driver loaded. I downloaded and installed my centOS's native mysql-conenctor ( it's 5.1.12 ) and copied that jar to the lib and craftbukkit.jar directory. Still the same error. I had one more mysql conenctor from another plugin in my lib dir ( don't know which this is, it's just mysql.jar ), and yet again same error.... So after all of that, I tried using sqlite, and I already had the sqlitejdbc-v056.jar in my craftbukkit.jar directory. Same error as above....

    Anyone have any idea why this plugin can't grab the connector drivers!?
     

Share This Page