[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

    Magik

    i'm trying to work with andreas to merge our two codesets, but with all the formatting/indenting differences, it's a diff nightmare....
     
  3. Offline

    Firebabe

    alright, I get that, but what is the error for?
     
  4. Offline

    Magik

    when I patched that error in my version, it was because of how the SQLite connection was being handled. It doesn't seem to affect everyone who uses SQLite, but it affected me when I was updating the plugin to be compatible with the neweset CB builds and other plugin builds. I believe this also may have to do with what settings you pass to java on the CLI when you start it. My gut tells me using more agressive garbage collection alleviates this issue - because Halo also wrote a safety catch in his SQLHandler that when it gets destroyed it calls the close() function.

    Basically SQLite doesn't seem to like it when a connection to the DB is left open after a query. It locks the table, and since the DB connection isn't released quickly enough, when the next DB query comes through, the table is locked, and it fails. This is the source of your error. Since the table is locked, when the query comes that creates the table - it fails - and thus reports it could not create the table with the specified query.

    There were a couple of bugs in Halo's code that caused this - he was forgetting to call his SQLHandler.close() function at some places before creating a new SQLHandler object. Again, this doesn't seem to affect everyone who uses SQLite and this plugin. I need a bit more data to narrow it down, but as I said above, my gut tells me using more agressive garbage collection switches on the command line helps fix the non-clean closes by calling SQLHandler's finalize() method when it gets garbage collected ( finalize is like a destructor - and it calls close() ).

    If anyone wants to give it a try, my latest compile is here: https://github.com/downloads/magik/DynamicMarket/DynamicMarket.jar
     
  5. Offline

    dslip

    not seeing a link after your post Magik

    So far the modified build with a different cmd (/gshop) is working for me

    Could this possible set in config file? so all related help uses the right cmd?
     
  6. Offline

    Magik

    temporary solution for now, since I can't think of a good way to add a new command on the fly or based on configuration ( registering a command after the plugin has started ). There is the PLAYER_COMMAND_PREPROCESS event, but it's looking like you aren't really supposed to use it in this fashion.

    So for now, I've made /gshop an alias of /shop - the only problem is that /shop still is a valid command, and I'm unsure of how that will affect your other plugin that is also hooking /shop....

    if you'd like to give it a try and let me know if it's conflicting with /shop

    you can find a build here: https://github.com/downloads/magik/DynamicMarket/DynamicMarket.0.4.8.magik.5.jar
     
  7. Offline

    oxide7

    I've got everything working, even importdb. but import DB doesnt actually change the shop.db file, so doing a reload, or restarting the server loses all the db changes (including the original import) any ideas why? no errors popup.
     
  8. Offline

    KizuOrama

    I type /shop add <id> and I get unkown or mangled shop command. Try /shop help
     
  9. Offline

    Magik

    you need to provide as much info as possible heh... I don't have time to delve back into this thread to figure out what versions you are using etc....

    after you do an importDB you said it "works" how do you know it works? after doing importDB do you do a /shop list and see it populated in there?

    What is a reload? /shop reload? or just /reload?

    I would advise against both of those - it looks like there is a bug/problem with /shop reload right now that causes

    When you say no errors popup are you looking in the server console? There are no Exceptions printing out in the console?

    I fixed the /shop reload issue I found, new build posted: https://github.com/downloads/magik/DynamicMarket/DynamicMarket.0.4.8.magik.6.jar


    You are using SQLite right? What I find odd is that you say shop.db never changes - but as soon as importDB completes - everything from the csv should be in the .db at that point. And if you can use /shop list - and it shows you items - those items are already in the file.... I don't see how it's deleting the shop.db or emptying it out when the server is "reloaded"....

    I think I need more info as to the specifics of what you are doing to cause issues to arise.
    [MERGETIME="1299728575"][/MERGETIME]
    I will track this bug down later - but right now /shop add <id> does not work - you need to at least supply a buyPrice - i.e. /shop add <id> <baseprice>
     
  10. Offline

    croxis

    Can someone point me to where I can download the mysql driver DynamicMarket needs, and where in craftbukkit tree structure it should go?
     
  11. Offline

    Beaverbeliever

    Hey Magik, do you have Skype? :p
     
  12. Offline

    oxide7

    Sorry.
    Ok well I'm using
    CB 506
    Permissions 2.5.3
    DM 0.4.8.8 (Jeanine)
    iConomy 4.4 (arcadia)

    Before import DB there are no items with (/shop list)
    After import there are many items. The import also says its succesful if that even matters. the shop.db file size doesnt change but it does look like it creates a new file, shop.db-journal.
    I was running /shop reload cus I figured it was important to do, but I havent done that since.
    And i was looking at the server console for errors everything was completely smooth. nothing in there.

    I've been playing for a few hours with it with others on the server. I think the shop.db file got a bit bigger but im worried about restating the server and loosing that info.
    I can do an export to save ti and then restart the server to see what happens...
     
  13. Offline

    dslip

    Author,

    Please support the auto-updating plugin CraftBukkitUpToDate. To do so please provide a permanent direct link to the author of CraftBukkitUpToDate.

    The below is information they provide
    Show Spoiler

    My Plugin didn't supported, how i get it to work with CButD?
    Give me a permanent link to your Plugin, i will add it. That's all no changes at your SourceCode or something else, all I need is a permanent link to the newest version of your Plugin. A good place for this is http://www.dropbox.com/ or for OpenSource https://github.com/.


    I really enjoy using your plugin and would like to see it work well with the above listed 'updater' plugin.
     
  14. Offline

    Andreas Brisner

    My version automaticly downloads it :)
    [MERGETIME="1299743391"][/MERGETIME]
    For me, the plugins versions will continue to come in their own directory. If this plugin you are talking about cant use VERSION files, then idk..
    [MERGETIME="1299743455"][/MERGETIME]
    "After that stop your server and copy/move the new files to your plugin-Folder" that is NOT autoupdate in my mind.. Auto means you dont do a thing.. (Restart I can go with, because that is needed)
    [MERGETIME="1299744185"][/MERGETIME]
    Then keep having your problem. :)
     
  15. Offline

    mike smith

    because hes been spending many hours trying to fix it just for you. least you can do is say thank you considering his version works just fine on his end. Hes being helpful, be happy.
     
  16. Offline

    Bilkokuya

    Just like to say thanks for keeping this going - I've been using it since first release and it's now become the backbone of our server.
    One thing I'd recommend to other server-admins is to make use of the full MySQL functionality. With all the data in a MySQL database - it's extremely easy to connect the data up to a website or other functionality. For example; we've now got a system where posting on our forums increases the market prices for that 15minutes.
     
    Magik likes this.
  17. Offline

    Trikor

    My DynamicMarket doesn't seem to be able to interact with it's database at all anymore. Here's what I am running:
    Bukkit 522
    iConomy 4.4
    DynamicMarket 0.4.8.magik.4

    1. I tried to use /shop importdb
    2. It would spew out a line for every item it tried to import that reads like this:
    Code:
    [SEVERE]  [DynamicMarket]: Error executing query statement  [org.sqlite.PrepStmt@4776b] with sqlite: java.sql.SQLException: SQL  Logic error or missing database
    3. I then opened the shop.db using a graphical SQL interface. This is what that looked like.

    show screenshot (open)
    [​IMG]

    so obviously the item database is populated.
    4. When I use /shop list it says "No items have been set up in the shop yet..."

    Here is my DynamicMarket.settings:
    trying to save scroll bar space (open)
    #Minecraft Properties File
    #Tue Mar 08 22:27:03 PST 2011
    default-shop-account-free=true
    text-colour-bracket=d
    text-colour-param=b
    default-shop-account=
    mysql-db=jdbc\:mysql\://localhost\:3306/minecraft
    mysql-dbengine=MyISAM
    economy-plugin=iconomy4
    wrapper-mode=false
    text-colour-command=f
    csv-file-path=plugins/DynamicMarket/
    simple-permissions=false
    text-colour-error=c
    shop-tag={BKT}[{}Shop{BKT}]{}
    csv-file=shopDB.csv
    text-colour-normal=e
    transaction-log-autoflush=true
    items-db-path=plugins/DynamicMarket/
    wrapper-permissions=false
    database-type=sqlite
    transaction-log-file=transactions.log
    max-items-per-sale=2304
    mysql-user=root
    max-items-per-purchase=2304
    mysql-pass=pass


    SQLite files are in the root Minecraft directory and in Minecraft/lib (running linux) and iConomy works with it's database fine. I know that the database files are in the right places, the database is populated (with the .csv file from above), and the config file, as far as I can tell, is set correctly. I feel like there is something simple that I am missing somewhere.
     
  18. Offline

    dslip

    @Andreas Brisner All the plugins requires is that you use a static location for you download. Eg there is a single location to download the most current version (you may already be doing this)

    Please consider, its fantastic for a server admin like myself with 65+ plugins to keep track of.
     
  19. Offline

    Andreas Brisner

    The plugin you are referring to is NOT an automatic updater.. Manually having to move files is not autoupdate.
    And no, I dont have a static location as of today. New folder for every release
    [MERGETIME="1299759190"][/MERGETIME]
    @Trikor: try 0.4.8.8 :) http://brisner.no/DynamicMarket/0.4.8.8/DynamicMarket.jar
     
  20. Offline

    sauevaem

    You guys should just rename plugin and start own topic with full info&support. ;3
     
    M1sT3rM4n and imaxorz like this.
  21. Offline

    Oscarius

    Hey, I just noticed the DEFAULT row is missing in my database.
    Any way I can add it, or could someone post theirs so I know how its supposed to look?
     
  22. Offline

    Hoddie54

    Warning Long Code.
    Code:
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
    ... 23 more
    
    ** END NESTED EXCEPTION **
    
    2011-03-10 09:33:11 [SEVERE] [DynamicMarket]: Error preparing query statement [SELECT * FROM Market WHERE name LIKE ?] for mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:
    
    ** BEGIN NESTED EXCEPTION **
    
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
    MESSAGE: The last packet successfully received from the server was39855 seconds ago.The last packet sent successfully to the server was 39855 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    
    STACKTRACE:
    
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was39855 seconds ago.The last packet sent successfully to the server was 39855 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
    at com.gmail.haloinverse.DynamicMarket.SQLHandler.executeQuery(SQLHandler.java:68)
    at com.gmail.haloinverse.DynamicMarket.DatabaseMarket.inShop(DatabaseMarket.java:299)
    at com.gmail.haloinverse.DynamicMarket.iListen.shopSellItem(iListen.java:649)
    at com.gmail.haloinverse.DynamicMarket.iListen.parseCommand(iListen.java:1003)
    at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onCommand(DynamicMarket.java:148)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:31)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:183)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:619)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:582)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:576)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
    ... 23 more
    
    ** END NESTED EXCEPTION **
    
    2011-03-10 09:33:57 [SEVERE] [DynamicMarket]: Error preparing query statement [SELECT * FROM Market WHERE (item = ? AND subtype = ? AND shoplabel = ?) LIMIT 1] for mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:
    
    ** BEGIN NESTED EXCEPTION **
    
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
    MESSAGE: The last packet successfully received from the server was39855 seconds ago.The last packet sent successfully to the server was 39855 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    
    STACKTRACE:
    
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was39855 seconds ago.The last packet sent successfully to the server was 39855 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
    at com.gmail.haloinverse.DynamicMarket.SQLHandler.executeQuery(SQLHandler.java:68)
    at com.gmail.haloinverse.DynamicMarket.DatabaseMarket.inShop(DatabaseMarket.java:299)
    at com.gmail.haloinverse.DynamicMarket.iListen.shopSellItem(iListen.java:649)
    at com.gmail.haloinverse.DynamicMarket.iListen.parseCommand(iListen.java:1003)
    at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onCommand(DynamicMarket.java:148)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:31)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:183)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:619)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:582)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:576)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
    ... 23 more
    
    ** END NESTED EXCEPTION **
    
    2011-03-10 09:33:57 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'shop' in plugin DynamicMarket v0.4.8.7
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:33)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:183)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:619)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:582)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:576)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NullPointerException
    at com.gmail.haloinverse.DynamicMarket.DatabaseMarket.data(DatabaseMarket.java:329)
    at com.gmail.haloinverse.DynamicMarket.iListen.shopShowItemInfo(iListen.java:525)
    at com.gmail.haloinverse.DynamicMarket.iListen.parseCommand(iListen.java:963)
    at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onCommand(DynamicMarket.java:148)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:31)
    ... 12 more
    CB: 493. iConomy: 4.4.5


    Edit: Works with 4.4.6
     
  23. Offline

    Andreas Brisner

    INSERT INTO `Market` (`item`, `subtype`, `name`, `count`, `baseprice`, `stock`, `canbuy`, `cansell`, `volatility`, `salestax`, `stocklowest`, `stockhighest`, `stockfloor`, `stockceil`, `pricefloor`, `priceceil`, `jitterperc`, `driftout`, `driftin`, `avgstock`, `class`, `shoplabel`) VALUES
    (-1, -1, 'Default', 1, 0, 0, 1, 1, 1, 0, -2147483648, 2147483647, 0, 0, 0, 2147483647, 0, 0, 0, 0, 0, '');
     
  24. Offline

    SirGriffin

    when i type in anything ingame it says an internal error ocured how do i fix this??
     
  25. Offline

    Andreas Brisner

    Yes! We are all psychic here! No, not really.
    Craftbukkit version?
    DM Version?
    iConomy version?
    Permissions version?
    What OS?
    If linux, what distro?
    Any errors in console?
     
  26. Offline

    SirGriffin

    dw i got it lol srry XD im new too this stuff
     
  27. Offline

    Eckhart

    So, bug report for you guys;

    I'm witnessing some strange behavior with batch sales which leads me to believe that price floors are not considered when selling multiple items at the same time. On my server Sugarcane (ID 338) has a price floor of 75 Rubles (Yes, my currency is Rubles. Such is life in the zone.).

    [​IMG]

    In the above example, I've already tanked sugarcane to the price floor of 75 rubles. I then sell 24 bundles of sugarcane which, at 75 each, should come to exaclty 1,800 Rubles, but instead it credits 1624 indicating an average sell price of 67.67. Following, a price check shows sugarcane still at 75 rubles, and a sale of a single unit results in a credit of 75 as intended.

    I'm using 0.4.8.8 Jeanine, on iConomy 4.4.6.
     
  28. Offline

    Andreas Brisner

    :)
    [MERGETIME="1299787137"][/MERGETIME]
    @eckhart: That sure is weird.. huh :-/ *test locally*
    [MERGETIME="1299787335"][/MERGETIME]
    It sold for 1800 here :-/
    [MERGETIME="1299787720"][/MERGETIME]
    Could you please provide the output of /shop info 338 ?
     
  29. Offline

    Eckhart

    I ran some further tests, it seems to only be the first large sale after the plugin loads that has this issue.

    Here's two transactions from right after the server starts up; as you can see, the first one's wrong, and the second, exact-same transaction comes out right. Also, I put the info on 338 in there for you - it reads the same before the first, buggy sale as well (Except the stock, duh)

    [​IMG]

    Edit: Actually, it's not just the first transaction, but the first one's always wrong. The third transaction right after I took that screenshot sold for 1673 as well.
     
  30. Offline

    Magik

    I believe it is working correctly - the price floor and price ceiling are the floor/ceiling of the BASEPRICE - and the base price for me is hitting the floor at 150. Since your sales tax is 50 that means the floor of the sell price is 75

    It may be a bug Halo fixed after brisner branched his code? Everything seems to work fine in my version - I sold many many bundles of sugarcane and it always sold for 75 a bundle even when doing batch sells of 16x24 like you were ( always 1800 for me ). But it sounds like it works in his version too?

    Try using my latest compile here: https://github.com/downloads/magik/DynamicMarket/DynamicMarket.0.4.8.magik.7.jar
    ( last change: fixed /shop add <id> without any more arguments - uses default base price )

    Can we get a exportDB file?
     
  31. Offline

    Eckhart

    @Magik

    When I try to use yours I start getting SQL errors when reading the DB;
    [DynamicMarket]: Error executing query statement [org.sqlite.PrepStmt@c7057c] with sqlite: java.sql.SQLException: SQL logic error or missing database

    Even when starting with a freshly-imported DB created with yours. This is why I was using the 0.4.8.8, it works for me in all cases other than this random, slightly-less-money-than-it-should-be, buggy sale.

    Attached is the export from .8 as requested.

    Edit: Huh, it seems to be porportional to the current sale price, as well. Here's it doing a sale at exactly 1673 starting with a sell price of 78/bundle, in comparison to the 1624 it puts out when sold at 75/bundle.
    [​IMG]
     

    Attached Files:

Share This Page