[ECON] DynamicMarket V0.6.0 - Versatile Shop Plugin [953]

Discussion in 'Inactive/Unsupported Plugins' started by GoalieGuy6, Jul 3, 2011.

  1. Offline

    GoalieGuy6

    DynamicMarket - Dynamic Global Shop Plugin
    Download V0.6.0 (JAR | Source on GitHub)

    Current version: 0.6.0
    Tested against: CraftBukkit build #953

    JAR Mirror (Version 0.6.0)
    Older Versions


    Note: Upon first run the plugin will attempt to convert your database in order to add decimal support to item prices. I was unable to test the conversion code too extensively so if you run into any errors with this please post your server log so I can take a look.

    Most of this was copied from the original thread found here. This is the first plugin I have ever worked on and also the first Java project I have worked on, so I am sure there is a lot that I could've done better. For now I haven't done much more than add a few small features and fix a couple bugs. If you have any requests or experience any bugs/errors please let me know and I'll see what I can do.

    Some of the information below is outdated, I am working on updating the post.

    Requirements:
    Read this before proceeding

    READ THIS (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 now have decimals in them!
      • Checks if a player has enough space to hold items before purchasing!
      • 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:
      • Set OPs to have all admin permissions in the config!
      • 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.
      • 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.
      • 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.
    <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).
    Permission Nodes (open)
    Permission Nodes:

    '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.reload' : Grants the ability to reload the plugin's config and db.
    'dynamicmarket.admin.reset' : Grants the ability to reset the shop's database.
    'dynamicmarket.admin.db' : Grants the ability to export and import the shop's database using .csv files.
    Installation/Setup (open)
    Installation/Setup:
    Step 1) Make sure you have all the required plugins/dependencies
    Step 2) Copy DynamicMarket.jar into your Plugins/ folder.
    Step 3) Add the permissions if you are using a permission plugin.
    Step 4) (Re)Start your MineCraft server. Errors may be thrown to the console, but the file Plugins/DynamicMarket/DynamicMarket.settings should be created.
    Step 5) Edit DynamicMarket.settings to suit your needs.
    Step 6) Use "shop reload" from the console to load the edited config file.
    Step 7) Use /shop add to fill the market with tasty blocks at scandalous prices.

    Note: 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.
    Configuration (open)
    Configuration
    Code:
    general:
        # Shop tag is what is displayed before most shop output  Default is [Shop].  Improved coloring system coming soon
        shop-tag: '{BKT}[{}Shop{BKT}]{} '
        transactions:
            # Whether or not shop transactions should be logged
            log-transactions: false
            # The file to log transactions in (located in plugins/DynamicMarket)
            log-file: transactions.log
            # If true the file will save after every transaction.  If false the file will save on server shutdown
            log-auto-flush: true
            # Maximum number of items (not bundles) a user is allowed to buy in one transaction
            max-items-buy: 64
            # Maximum number of items (not bundles) a user is allowed to sell in one transaction
            max-items-sell: 64
    database:
        # Database type, either sqlite or mysql
        type: sqlite
        sqlite:
            # The file to store an sqlite database in (lcoated in plugins/DynamicMarket)
            file: shop.db
        mysql:
            # URI for your mysql database
            database: jdbc:mysql://localhost:3306/minecraft
            # MySQL username
            user: root
            # MySQL password
            password: pass
            # MySQL database engine (recommended MyISAM)
            engine: MyISAM
    permissions:
        # If set to true DynamicMarket will ignore the permissions plugin
        # Regular users get 'dynamicmarket.access', 'dynamicmarket.buy', and 'dynamicmarket.sell'
        ignore-permissions: false
        # Whether or not ops should get all permissions
        op-permissions: false


    Changelog (Full Changelog)
    0.6.0
    • Added message.yml file
      • Almost all messages can be configured
      • Colors supported
    • Bug fixes
      • Fixed some settings not being loaded properly
      • No more NullPointerExceptions (hopefully)
    • Improved auto-update script
    0.5.3
    • Converted config file to yml
      • Your DynamicMarket.settings will be converted automatically
    • Fixed inventory space check for items with subtypes
    0.5.2
    • Rewritten API
      • DMWrapper update coming soon
     
    DJ_Idol and Juze like this.
  2. Offline

    GoalieGuy6

    Copy/paste the contents to http://pastebin.com/ and send me a link to it, or post it here in code tags.

    DynamicMarket.settings is no longer used, the plugin now uses a config.yml instead.

    I updated the code to use Minecraft's max stack size for items, I can add an option to disable this though.
     
  3. Offline

    GoSox2525

    here it is:
    Show Spoiler

    Code:
    itemId    subType    count    name    basePrice    stock    canBuy    canSell    volatility    salesTax    stockLowest    stockHighest    stockFloor    stockCeil    priceFloor    priceCeil    jitterPerc    driftOut    driftIn    avgStock    itemClass
    50    0    64    Torch    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    1    0    64    Stone    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    3    0    64    Dirt    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    4    0    64    CobbleStone    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    5    0    64    WoodPlanks    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    12    0    64    Sand    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    13    0    64    Gravel    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    17    0    64    Wood    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    19    0    64    Sponge    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    20    0    64    Glass    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    23    0    1    Dispenser    50    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    24    0    64    Sandstone    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    25    0    1    NoteBlock    50    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    26    0    1    Bed    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    27    0    64    Accelerator    50    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    28    0    64    Detector    50    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    29    0    10    StickyPiston    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    33    0    10        40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    35    0    64    Wool    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    37    0    64    Flower    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    38    0    64    Rose    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    45    0    64    Brick    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    47    0    64    Bookshelf    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    48    0    64    MossyCobbleStone    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    49    0    64    Obsidian    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    53    0    64    WoodenStep    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    54    0    1    Chest    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    61    0    1    Furnace    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    64    0    1    WoodenDoor    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    65    0    64    Ladder    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    66    0    64    Rail    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    67    0    64    StoneStep    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    69    0    1    Switch    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    70    0    1    StonePressurePlate    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    71    0    1    IronDoor    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    72    0    1    WoodenPressurePlate    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    76    0    64    RedstoneTorch    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    77    0    1    Button    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    80    0    64    SnowBlock    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    82    0    64    Clay    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    84    0    1    Jukebox    40    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    85    0    64    Fence    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    86    0    10    Pumpkin    20    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    87    0    64    Netherrack    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    88    0    64    SoulSand    30    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    89    0    64    Glowstone    100    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    96    0    1    Hatch    10    0    Y    Y    0    50    #NAME?    #NAME?    0    0    0    #NAME?    0    0    0    0    0
    


    csv files by default open up in Excel for me, if that makes a difference.
     
  4. Please do :D
     
  5. Offline

    Juze

    Still waiting for DMWrapper. Any idea when will that come?
     
  6. Offline

    Asphodan

  7. Offline

    GoalieGuy6

    It looks like item ID 33 (below StickyPiston) is missing a name. Put a name in there then try importing it again.
     
  8. Offline

    GoSox2525

    thanks, that did work and got it imported successfully, but now everything has either no buy or sell price, or its just zero. and whenever i try to test out buying something, it says there are 0 of that item left. What can i write in the csv to set it to unlimited?

    sorry im complaining alot :/ just want this to work
     
  9. Offline

    unimatrix Bukkit Sponsor

     
  10. Offline

    DJ_Idol

    So glad you've decided to keep this plugin officially up to date!
     
  11. Offline

    des1n5ekt

    hi, everytime i set the taxes to something above 0.0 and import the db the taxes are resetted to 0.
    i am using mc 1.7.2 and dynamicmarket 0.6.0
    i tried taxes like this: 10.0 or 0.1 they both dont work. pls help me :)
    console doesnt say anything.

    its a very nice plugin, but without taxes there is a inflation on my server :D
     
  12. The tax only signifies the ration between buy and sell value of the items. The entire point of this plugins is creating an actual market for goods. It does bring currency into your system, and thus inflation. You fix this by creating currency sinks.

    Regarding your importing...import your DB first, what are you importing anyways? And check the salestax values in the DB after that...
     
  13. Offline

    des1n5ekt

    after exporting my old db and changing the salestax i import it. when i check the prices sell- and buyprices are the same... i thought the taxes would make they buyprice higher.
     
  14. They do indeed.

    Just perform an SQL update on your Market table that sets your salestax to whatever you want it to be.
     
  15. Offline

    Crimsonfox

    Is it possible to restrict what items some users can buy, maybe with an extension of the .buy node? I want to reward users with the ability to buy more things the more achievements they have, so effectively have multiple Trader Tiers.

    So Tier one can buy Stone and Dirt, Tier 2 can buy Tier 1 + Cobble and Coal etc etc
     
  16. Offline

    fatmarley

    On my server anyone who buys any dye item, which I believe are limited to a stack size of 16, over that amount will get a glitched inventory that will cause them to crash.

    Also, you can give any item a subvalue...in my instance mistakenly a cobblestone stair [67] (So 67,1) and when you buy it, it gives you two of that item... Not a real issue, but any bug is a bad bug!
     
  17. Caught an exception:

    Code:
    10:45:08 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'shop' in plugin DynamicMarket v0.6.2
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
            at com.gmail.haloinverse.DynamicMarket.ItemClump.<init>(ItemClump.java:49)
            at com.gmail.haloinverse.DynamicMarket.iListen.shopShowItemInfo(iListen.java:438)
            at com.gmail.haloinverse.DynamicMarket.iListen.parseCommand(iListen.java:886)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.returnCommand(DynamicMarketAPI.java:50)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.returnCommand(DynamicMarketAPI.java:54)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.returnCommand(DynamicMarketAPI.java:58)
            at me.slaps.DMWrapper.DMWrapper.onCommand(DMWrapper.java:109)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.wrapCommand(DynamicMarketAPI.java:42)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onCommand(DynamicMarket.java:183)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    
     
  18. Offline

    des1n5ekt

    I dont know if it is important but i use sqlite. I have resetted all settings and then imported the "DynamicMarketshopDB.csv" with salestax set to 10.0 but for example goldore shows this: GoldOre[8] Buy: [1537.87] Sell: [1537.87]
    the line in the db-file:
    14,0,8,GoldOre,1600.0,2,Y,Y,200,10.0,0,20,0,20,0,+INF,0,0,0,0,0

    after exporting the db it says this:
    14,0,8,GoldOre,1600.0,2,Y,Y,200,0.0,0,20,0,20,0,+INF,0,0,0,0,0
     
  19. Offline

    UFO64

    The documentation seems to imply that you can configure where the csv file is placed on export? Is this possible to configure?
     
  20. Offline

    GoSox2525

    what would i have to type in in the BD to make it infinite. I want the stock to be unlimited
     
  21. Offline

    UFO64

    GoSox2525: checkout the ingame help for StockLowest and StockFloor. You can do this by "/shop help tags stocklowest". Setting these to -INF will mean that an item has infinite stock. If you ALSO want it to be static in price, then you want to make sure that the volatility (Vol) is set to zero. This will keep the price the same as the stock changes around. Dont worry that the stock values still change, they can climb to -Inf without issue =P

    The easiest way to set that all up, is to use the shortcuts that are provided for some types of materials.

    Adding something with the tags Fixed, Flat, Float, or Finite will configure the options for you a bit.

    Fixed has a static price with no changes in stock (so if I buy something, its price AND stock stay the same.) This is probably what you want.

    Flat is just like fixed, except that the stock is still tracked, it just has zero effect. Kind of handy to see what people are buying.

    Float gives you dynamic prices, but the stock can be bellow zero. This will give you infinite stock to your users, but the price will keep going up as they buy more.

    Finite prevents people from buying things that have zero stock, but otherwise acts like Float.

    Hope that helps!
     
  22. Offline

    sinelael

    Hi thanks for your nice work !
    I ve a problem with the export db. I ve got the message that Shopdb.csv is exported but I cant find it anywhere. I cant find the option in the config file to choose a path.
    Thanks for help
     
  23. Offline

    NoPride

    Have a look for DynamicMarketshopDB under your plugins folder not under the dynamicmarket folder
     
  24. Offline

    sinelael

    Thanks !
    The "Commands" paragraph needs an update
     
  25. Offline

    Poeschl

    Does the plugin decrease/increase the stock-level to 0 after a amount of time?
    If no, its a idea for the next version ;)
     
    goldseed likes this.
  26. Offline

    goldseed

    Thank you for good plugin..

    I think it would be better to have more flexiblity.

    When i have 100 stones, If I try to sell 150 stones, It gives error message only.

    How about "[shop]: you tried to sell 150 stones, but you have only 100 stones, so 100 stones sold.. "???
     
  27. Offline

    meh

    Bleh. Been trying to get this working (and stable) for a few hours now... it works fine for a while, then after a few buy/sell actions it barfs out.

    I've tracked down what I think the problem is though - and it's down to internationalization.
    If I sell a bunch of stuff enough that the price begins to get recalculated then the plugin dies with this:

    Code:
    Caused by: java.lang.NumberFormatException: For input string: "10,1"
    at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
    at java.lang.Double.valueOf(Unknown Source)
    
    It looks like the DecimalFormat function is using the default locale decimal separator of ',' (comma)
    The Double.valueOf function does not check the locale, and expects the decimal separator to be '.' (period)
    To parse a string formatted with DecimalFormat you should be using DecimalFormat.parse instead, I think. (After a quick Google anyhow.)

    I hope this is some help, as it otherwise looks like a nifty plugin - if only I could keep it running for more than a few transactions :)
    I'm going to see if I can temporarily change the locale settings as a workaround for now though, hopefully I'm right and that should help.

    OK... after a bit more testing, and after adding:

    Code:
    -Duser.language=en -Duser.region=US
    
    to the java command line I'm using to start the server it now seems to work :)

    I'd still appreciate it (and others probably will too) if you could fix it so this workaround won't be necessary in the long run.
    Thanks! :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  28. Code:
    22:53:57 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'shop' in plugin DynamicMarket v0.6.2
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
            at com.gmail.haloinverse.DynamicMarket.ItemClump.<init>(ItemClump.java:49)
            at com.gmail.haloinverse.DynamicMarket.iListen.shopSellItem(iListen.java:572)
            at com.gmail.haloinverse.DynamicMarket.iListen.parseCommand(iListen.java:928)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.returnCommand(DynamicMarketAPI.java:50)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.returnCommand(DynamicMarketAPI.java:54)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.returnCommand(DynamicMarketAPI.java:58)
            at me.slaps.DMWrapper.DMWrapper.onCommand(DMWrapper.java:109)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarketAPI.wrapCommand(DynamicMarketAPI.java:42)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onCommand(DynamicMarket.java:183)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    
     
  29. Offline

    meiamone

    Wouldn't using an H2 database be better?
     
  30. Offline

    DaddyCool64

    @GoalieGuy6
    If i sell some items to the shop, i get the money, but there are no items to sell.
    For example:
    /shop sell 4:20
    i sell 20 Cobblestone (Pflasterstein) to the shop and get 20,- Coins (Mark)
    Now i do
    /shop buy 4:10
    i get the message "There are only 0 of Plasterstein left", because Stock in MYSQL is 0

    if i change the stock in MYSQL to 10, i can buy 10 items, than Stock is 0 again.

    dynshopfehler.png

    Help please.
     
  31. Offline

    dragos240

    Suggestion:

    Support for items that have specific data values.
     

Share This Page