[ECON] GoldStandard v1.0.1 - Item based dynamic currency system for iConomy [953]

Discussion in 'Inactive/Unsupported Plugins' started by Ballistic Buddha, Apr 26, 2011.

  1. GoldStandard: A Driving force for free market economies
    Version: v1.0.1

    Note: A third party library "GNU Trove" is required in order for the plugin to run, it is included in the .zip version and can be downloaded independently here.

    A Note to those upgrading to v1.0. You will have to either update or drop your SQL tables:
    1. MySQL users, use this script.
      1. Edit the file with your favorite text editor and replace both instances of <schema> with your schema's name.
      2. If you are running your mysql server on linux execute the following command from a terminal as root: "mysql -h [hostname-or-IP-address] -u [username] -p [database-name] < update.sql" and replace everything within the [] to the variables relavant to your instance, it will then ask you for your password from the tty and you would be done.
      3. If you are not running linux or are unfamiliar with the shell, just copy everything in the update.sql file after replacing the <schema> variable then just run those 2 commands any way you choose. I would also like to recommend the MySQL Workbench, which is a pretty solid GUI utility to administrate your database, which also includes some utilities from running SQL scripts or if you prefer you may just run commands directly from the GUI to update your database.
    2. H2SQL users, hang tight as I brew up a solution for those of you who don't want to reset your price values, if you are okay with resetting your prices, just delete the .db files in your plugins/GoldStandard/ folder
    In brief, this is a dynamic currency system for iConomy that lets you set parameters that will let the value of currency fluctuate (if specified). As of Version 1.0 it can now be used as a full-fledged dynamic economy, complete with any mixture of relative and independent price scaling! There are also options to use static pricing mixed in with dynamic pricing.​

    More About GoldStandard (open)

    So, I mainly started making this plugin a little while ago to get my feet wet with the bukkit API. It started out as just a way to sell a single item only, but I have since updated it to be more modular. The primary purpose of this plugin is to accompany an economic system similar to iConomyChestShop that is more trade and barter based, rather than based on selling and buying items directly to and from the server. However I noticed that the problem I had once I first set up iCS was that although people could buy items sold by other players, people had no means of actually generating money, as I didn’t quite fancy the idea of letting everyone sell items to chests. Hence, GoldStandard was born!

    GoldStandard is a selling system based on the idea of scaling prices based on supply and demand. Currently, the plugin only allows you to sell one specific type of item such as Gold Ingots, useful due to their rarity and lack of practical use, thus basing the driving force of the entire server’s economy on who has the most gold, and indirectly relating the value of all items in-game to the price of gold (or similar item).

    When used in conjunction with an adequate trading and buying system to act as a type of auction house, admins may indirectly control the price of all items on the server by directly adjusting the price of one item. There will be no longer be a need for admins to set specific values for any items or minerals except for the chosen item; rendering the need for setting prices for new items redundant. The prices of all items will eventually reach equilibrium as they adjust based upon how the players decide to buy and sell items to other players. With this plugin running alongside a “finite” buying system, admins might find it easier to stabilize an economy by adjusting the price of gold to the right range that suits their needs.

    Features
    Price Scaling
    Note: I'm currently working on getting better examples and explanations of how this works, but for now you can download the .zip version and examine the sample config included within it.
    The price of items works by either using static or dynamic pricing, using the following formulas:
    Code:
    For Dynamic Pricing (never goes outside the bounds specified):
    <current price> = <base price> - (<ratio>*<# of transactions>)
    For Static Pricing:
    <current price> = <base price>
    The number of transactions is found by querying the database for the number of items sold in the past X days (where X is a number specified in the config file)
    Relative items scale in relation to the base item. Making them effectively a sub or super unit of the base item. Transactions of relative items are effectively weighted based on their "relation" variable. Meaning that selling one relative item with a relation of .1 is effectively one 10th of a sale of the base item. Alternatively, if the ratio is 10, it will effectively count as a sale of 10 base items.

    Selling In-game
    Selling and Buying with GoldStandard can either be done commandless or via commands. For the non-command option, you must first create a "sell list", which is a list of all items that you want to sell. To modify this list use the commands /gsadd and /gsremove, you can add and remove multiple items with one command by comma separating their names/ids. After you have created your sell list, put a stack of all of the items you wish to sell into a furnace, chest, or dispenser in any slot, then left-click the container with the sell tool (Gold Sword by default), and viola! Minecash! Any items not in your sell list will remain untouched. If you’re really impatient you can just keep hitting the furnace while you are smelting gold ore, given that your action cooldowns aren't too long. You can also use commands in addition if specified in the config.
    Buyback
    You may also buyback items if allowed, to buy w/o commands you must first specify a buy item and quantity with /gsset. For instance, if I wanted to buy redstone in stacks of 8 the command would be /gsset redstone 1. After you specify a buy item, simply hit an empty valid container with the sell tool to buy the item stack. Alternatively, if the command option is enabled, you may use /gsbuy to buy multiple items at once. Buying an item will increase the value of the item relative to the ratio.
    Commands (open)

    Note: ItemIDs are synonymous with their nickname
    • /gsworth || /gsprice <itemIDs>- displays the current sale price for the selected items, comma seperate item names for multiple checks
    • /gssell || /gsell <items> <quantities>[Block Option] - sell x of item taken directly from your inventory
      • Comma sperate items and quantities, qtys match items in their respective order
      • The block options are ~ and *
      • Append the special character to the end of the amount like so:
      • /gssell 20~ - this sells 20 of the item in your inventory and counts blocks as 9x where applicable
      • /gssell 20* - same as ~ but will return your "change" in blocks if applicable
      • These characters do nothing if not applicable or not allowed
    • /gsbuy || /gbuy <items> <quantities> - buy items and insert them directly into your inventory
      • Comma sperate items and quantities, qtys match items in their respective order
    • /gsreset || /gsclear - Admin command that resets all prices back to their initial prices.
    • /gsadd || /gsa <items>[Block Option]
    • Comma separate items to be added
      • Append ~ to the end of the name/id to include blocks
    • /gsremove || /gsr <items> - remove items from your sell list
    • /gsset || /gss <item> <quantity> - set your item and stack size to buy
    • /gslist || gsl <but|sell> - display the items you are currently buying or selling
    • /gshistory || /ghistory <ItemID|Nickname|*> [sales(+)|purchases(-)|net(blank)]- Command that queries the database for the number of transactions
      • * is a wildcard that gets the history of all items
      • the type argument is optional, if blank it will get the net transactions
      • + and - are shorthand for sales and purchases respectively


    Requirements
    • GNU Trove (Packaged with the .zip file)
    • iConomy (iC Version 5.0+ as of GS version 0.7)
    • Permissions (If enabled)
    • MySQL (optional, requires mysql-connector-java-bin.jar in lib folder)
      • if you have already setup iConomy, you should already have this
    • H2SQL libraries (optional, requires h2.jar in lib folder)
      • if you have already setup iConomy, you should already have this
    • LWC (If using container protection)
    Configuration

    There are now 2 .yml config files. config.yml is for general plugin settings such as the duration, reload interval, and data source. items.yml is where all item-related configurations are set; INCLUDING price scaling options such as base, min, max, and ratio. Some settings are in both such as Buyback. In this case the setting in config.yml is the default and can be overridden for a specific item in items.yml.
    Example using Dynamic Pricing

    config.yml
    Code:
    #ItemID of the selling tool for commandless selling
    SellTool: 283
    #how long to keep records (in days)
    Duration: 7
    #How often (in minutes) to clean the database of old records (if needed)
    Reload Interval: 60
    #This option applies only to Gold Ingot, Iron Ingot, Diamond Gem, or Lapis Lazuli Dye
    #it enables selling one block of the equivilent material as 9x of the item
    #if an item cannot be represented as a block, this is ignored
    #this can be overridden for a specific item in items.yml
    Allow Block: true
    #enable buying (enforces the ratio in an inverse fashion)
    #this can also be overridden for a specific item in items.yml
    Buyback: false
    #Options: Chest, Furnace, Dispenser, Command
    SellMethods:
        - Furnace
        - Chest
        - Command
    #Protection system to use (LWC or none)
    Protection: LWC
    #MySQL, H2SQL or none
    Data: MySQL
    MySQL:
        database: minecraft
        hostname: localhost
        port: 3306
        username: mc
        password: pass
    
    items.yml
    Code:
    #Items are listed on level 1 by a specified nickname
    #the nickname can be anything as long as they are unique, but be aware that it will be shown in game
    #Currently, only one item is allowed and it must be a "base" item
    Items:
        Gold:
            #Decimal itemID of this item
            Id: 266
            #This is an optional override of the setting in config.yml for only this particular item
            #To use the default, delete this line
            Allow Block: true
            #This is an optional override of the setting in config.yml for only this particular item
            #To use the default, delete this line
            Buyback: true
            #There can only be one base item, it is a special item that is considered the basic unit of a multi-tiered economy
            #The price of the base item is always calculated from the base price
            #can only be base in version 0.8
            Type: base
            #base sale price of the base item
            Price: 100
            #minimum sale price of the base item
            Minimum: 50
            #maximum sale price of the base item
            Maximum: 200
            #decrease in price per item sold, increase per item bought
            #Sorry, but this must be in decimal format now :(
            Ratio: .1
    
    In this example, the item to sell is a Gold Ingot and the selling tool is a Gold Sword. The price of gold starts at 100 and decreases by 0.1 for each gold ingot sold until the price reaches 50, at that point it will stay at 50 until either transactions older than 7 days get cleaned out (assuming that a lot of the transactions didn’t just now take place) or the price gets reset by an admin. In other words, If the price is currently at the ceiling, and I sell enough gold to bring it down to the floor price right now, the price will stay at the minimum for 7 days unless reset by an admin. However, if I were to sell about half of my gold now and bring the price down to 75, and than 4 days later sell the rest of my gold to bring it down to 50 (assuming the rest of the players on the server haven’t sold any gold in the past 4 days) after 3 more days from this point (7 days from the first sale), the price will adjust as if I had only sold the second half of my gold.

    Example config.yml file using Static Pricing
    config.yml (open)

    SellTool: 283
    Reload Interval: 60
    Allow Block: true
    Buyback: false
    SellMethods:
    - Command
    Protection: none
    Data: none


    That’s really all you need. You can keep the above items.yml exactly as it is in the dynamic example above, and all of the scaling options will be ignored. Just be sure to set data to “none”, because it will cut down on the resources this plugin uses by A LOT. The same goes for block protection, if you don't want to enforce block protection (which is recommended if you are only using the command option), set the option to "none".

    Permission Nodes
    Code:
    goldstandard.sell - enables selling and use of the commands /gsa, /gsr, and /gsl sell
    goldstandard.buy - enables buyback and use of the commands /gss, and /gsl buy
    goldstandard.worth - enables the command to check the price
    goldstandard.reset - enables force resetting back to the base price (recommended as an admin-only command)
    goldstandard.history - allows the player to run history queries
    
    Planned Features for the Future
    • Ability to use SQL to store item information
    • Formula declarations for relative items (e.g. '<Gold>/10') to declare relative items more intuitively, or at least a yaml node to set what an item is relative to, instead of having the relation necessarily relating to the base item.
    • Add option to /gshistory to select based on the user who did the transaction, and head/tail options
    • "odd-item" support (like dyes and cloths)
    Wishlist (things I’d like to do if I have the time)
    • Exponential price scaling (dynamic relations)
    • Create an option to retain logged transactions even after they have expired
    • A web-api to query transactions (even past their expiration) to show trending of item prices.
    Known Issues:
    • Double chests act strange, selling from a double chest will only sell half of the items, thus requiring users to hit both sides of a double chest to sell all items within it.
    • Fractions in the .yml file no longer work, you have to put them in decimal format
    • There is no support for "odd items" such as dyes and cloth, and there is currently no way of using such items as currency.
    Changelog

    • Version 1.0.1
      • Fixed table creation with MySQL, and improved default player values for both H2 and MySQL database tables.
    • Version 1.0
      • Added support for multiple items. (see the example configs for how to implement)
      • Fixed an exploit with buyback by making the buy price have a pre-increment price adjustment
      • Added option to not use permissions.
      • Further implementation of trove to help reduce the memory footprint
      • Added action cooldown for buying and selling (independently)
      • Options for "buyback" and "allow block" can now be overridden on a per-item basis
      • A bunch of other tweaks and bugfixes, too many to list.
    Older versions (open)

    • Version 0.8
      • Switched to a new configuration format, containing 2 files: config.yml and items.yml, see the configuration above for more info.
      • Added command /gshistory for admins to run a basic query of past transactions from in game
      • Added an option to sell Iron,Gold, and Diamond blocks as 9x ingots/gems.
      • Redesigned the internals for buy and sell procedures in preparation for v1.0
      • A few other minor bugfixes
    • Version 0.7.2
      • Resolved some database connection issues that caused issues when reloading the plugin rapidly (like by doing a /reload from in-game)
    • Version 0.7.1
      • Fixed a bug causing errors when selling the last of your item via command
    • Version 0.7
      • Added H2SQL support :D
      • Updated to iConomy5
      • Added "Reload Interval" parameter in the config
      • Added "item" database column to prepare for multi-tiered currencies
        • If you were using a previous version you will either have to alter the table to include the "item" column or just delete the table (which will obviously reset your price)
        • If you switched to using H2SQL, no worries, your DB is already properly formatted
    • Version 0.6
      • Added Option to enforce LWC block protection while selling from containers
    • Version 0.5
      • Added Buyback option (has an increase in price per transaction)
      • You can now use any of: Chest, Furnace, Dispenser to buy/sell gold
      • Added option to buy/sell via command
    • Version 0.4
      • Initial release to the public
     
    Llamageddon, smickles and kahlilnc like this.
  2. Offline

    mike0fmikes


    Loading it at this very moment. We so excited!!!
     
  3. Offline

    Sparky222B

    @Ballicstic Buddha Looks good!
     
  4. Offline

    mike0fmikes

    Well, I tweaked the config to taste and loaded it yesterday. Buying and selling of items was working, but I noticed that the price wasn't fluctuating. I ad wiped all data from the last install, so I hadnt ran the script yet and thought that maybe that was the issue. When I ran the script I'm noticing two errors.

    2011-07-03 13:05:35 [SEVERE] [GoldStandard] Error when creating gslog.
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Invalid default value for 'lastBought'


    And then this error:

    ERROR 1067 (42000): Invalid default value for 'lastBought'


    Any thoughts?
     
  5. Offline

    obscurehero

    how do i run the script to update my database?
     

  6. It looks like the script never actually created the new table, did you replace <schema> with your database name?

    I updated the notification part at the top of the OP with some quick instructions on how to run the script.
     
  7. Offline

    mike0fmikes

    We're getting the same errors on our end

    --------------------------
    root@782mm:~# mysql -h localhost -u root -p minecraft < update.sql
    Enter password:
    ERROR 1067 (42000) at line 1: Invalid default value for 'lastBought'
    --------------------------

    When <schema> isn't replaced with the database name,it returns with

    --------------------------------
    root@782mm:~# mysql -h localhost -u root -p minecraft < update.sql
    Enter password:
    ERROR 1064 (42000) at line 1: 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 '<schema>.`gsu sers` (
    `pkgsusers` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
    `usernam' at line 1
    --------------------------------


    Any thoughts?
     
  8. @mike0fmikes

    Okay, it looks like MySQL is incredibly picky when it comes to default timestamp values. At the time of writing I originally remembered that MySQL will not let you have 2 timestamp values in the same table that use the "CURRENT_TIMESTAMP" value, so instead I set it to '1970-01-01 00:00:00' (this converts to 0 when invoking the getTime() method of Timestamp in java). However what I now realize is that in certian versions of MySQL with certian options on, your first timestamp value must default to CURRENT_TIMESTAMP if using not null, and all columns added thereafter must not default to CURRENT_TIMESTAMP if using not null. So, to make MySQL happy I have devised a fix in both the codebase and the sql script that will make the first default to current and the second column default to January 1st 1970. However, neither column should ever hit the default now, as I inserted something on the java side that will always insert new players with both of their timestamp columns set to the time of thier initial login. Therefore making it so new players must first wait the cooldown period after logging in for the first time before they may buy or sell. I hope this will work well for everyone.

    The fix in incoming into 1.0.1 which I will push and package either later tonight or tomorrow.
     
  9. Offline

    mike0fmikes




    Excellent news! I'm counting down until then. We're all really excited about having this mod up and running on our server.
     
  10. Offline

    mike0fmikes

    the last bought error is gone but now we're getting another.

    In game.
    ------------
    2011-07-07 12:48:36 [INFO] [GoldStandard] 5 Items loaded.
    2011-07-07 12:48:37 [SEVERE] [GoldStandard] Error when creating gslog.
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Invalid default value for 'lastSold'
    2011-07-07 12:48:37 [SEVERE] [GoldStandard] Error retrieving transactions from gslog
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.gslog' doesn't exist
    2011-07-07 12:48:37 [SEVERE] [GoldStandard] Error retrieving transactions from gslog
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.gslog' doesn't exist
    2011-07-07 12:48:37 [SEVERE] [GoldStandard] Error retrieving transactions from gslog
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.gslog' doesn't exist
    2011-07-07 12:48:37 [SEVERE] [GoldStandard] Error retrieving transactions from gslog
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.gslog' doesn't exist
    2011-07-07 12:48:37 [SEVERE] [GoldStandard] Error retrieving transactions from gslog
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.gslog' doesn't exist
    2011-07-07 12:48:37 [INFO] [GoldStandard] MySQL driver loaded.
    ----------

    Running the update.sql script.
    ---------------------
    root@782mm:~# mysql -h localhost -u root -p minecraft < update.sql
    ERROR 1067 (42000) at line 1: Invalid default value for 'lastSold'
    ---------------------

     
  11. Okay, I think I just found the MySQL doc page I've been looking for all long (this, to be exact).

    According to this, their epoch clock starts at '1970-01-01 00:00:01', whereas I thought it started at '1969-12-31 23:59:59'.

    Timestamp seems to vary in behavior depending on your MySQL version which is probably why I could not reproduce this error on any of my dev machines, nor on my own server. So, I'm curious, could you try changing that value in the script to one second later (i.e. '1970-01-01 00:00:01')? Maybe it's different on different MySQL versions, but to try and expand compatibility, I think that the highest value should suffice, for if it isn't exactly zero on all machines it won't really hurt anybody because the default value should never be hit in the first place, I mainly just want it in there as a failsafe.
     
  12. Offline

    mike0fmikes

    increased the date one second ahead, same issue.
    The server's running MySQL version 5.1.49-1ubuntu8.1
     


  13. Okay, one more thing before I decide to just wack the default values altogether, Could you Try setting the default value to something that should definitely be in range, like '2010-01-01 00:00:00' or something, perhaps there might be a time-zone conversion problem, as it might be taking the host's timezone and converting to UTC or something.

    If this doesn't work I think I'm ready to just allow null values, but I'll need to make some quick code changes to handle the null values it they were to come up.
     
  14. Offline

    mike0fmikes


    Yup that fixed it! gg

    I have a few suggestions though:

    Do you think you could add a way to make multiple base items. For isntance, I would want the buy/sell price of glass to fluctuate based on the price of sand; but I wouldnt want either of those things to cause the price or ore to change.

    On my server we have MagicSpells installed and I've tweaked the config to use RedStone, Glowstone dust, gunpowder, and books as reagents (in varrying quantities) for all the spells while sticks and bones are used as the implements. It'd be nice if I could group all of those things into a category and have them work independantely of other items.

    Maybe something like base, base1, base2, base3, base4
    And then in relation something like 'dependancy: base2' followed by ratio

    Something else that I think would be interesting, but complicated as far as the math goes is a %ofChange field. For instance selling iron would change the price of gold X amount, while selling say...dirt, would only change it slightly.

    Very nice mode though. We're currently running it along SignShops. People can check the global price of an item, and then sell underneath that. Work very well actually. Thanks for all your time!

    Oh and by the way, I noticed something that's not right in the OP. You don't have a donate link!!! :D
     
  15. Offline

    zaklampje

    Can I run this plugin with BOSEconomy also? And is there a way to make the commands even simpeler? (/sell,/buy)
     
  16. VERY glad to hear this, I was about to beat my head against the wall because of MySQL.
    I've definitely been thinking about this, and I do plan on adding this as a feature, however I haven't yet decided on how to format it in terms of configuration. As far as I see, there are two options:
    1. Make "Ratio" work like a formula set in the config. e.g. "Relation: <Glowstone>*.25"
      1. The advantage to this method is that it is all in all, more intuitive for the user as they can easily set up formulas for each relative item.
      2. Additionally, this allows for more elegant pricing and a crapload of new possibilities, as it would ultimately enable players to have items that are intricately laced into multiple items.
        1. Imagine if you could create an item with a price scheme like "<Gold>*2 - <Diamond>/4"
        2. Or a more practical approach. Have TNT = "Relation: <Sand>*4 + <Gunpowder>*5"
      3. The downside, ill go ahead and tell you, is that this would be a coding nightmare! It seems like a simple idea but it would seriously require me re-writing pretty much everything I have so far. Not to mention that I would have to really think hard about how this would actually scale the parent items.
    2. Implement it just like you said.
      1. Two options per item in config. "Parent Item" and "Relation", where instead of always relating to only one base item, they can relate to any item, so an example of how this would work would be like this for Redstone. Parent Item: 'Glowstone' and Ratio: .25
      2. If I decide to go this route I might consider removing the "Independent" type, and instead have you just make a new base item with no relative items tied to it.
      3. The advantage of going this route is they it will integrate very nicely into what I plan to do with SQL item data storage.
    I'm not completely sure what you're asking. The way it currently works is that relative items adjust the price of the base item based on their "weight" (AKA relation) multiplied by the ratio of the base item. If I'm understanding you correctly, there already is a way to do this. Have your base item as "Gold" with a relation of X. Have an independent item "Iron" with a relation of Y, and another independent item "Dirt" with a relation of Z.
    Code:
    Impact on gold price per Iron sold (A) = XY
    Impact on gold price per Dirt sold (B) = XZ
    
    if
        Y > Z
    then
         A > B
    therefore
        Iron has more "weight" in respect to the effect on Gold's price. Meaning Dirt changes the price of gold slower than Iron does.
    
    I don't see why not, I originally just included iConomy because it's what I thought it's what the majority of the community used and because it has a pretty badass API. However the amount of times the plug-in actually interacts with iConomy is very few, and I wouldn't imagine it would be painful to include BOSE in a near future release, however I'll have to look into the plugin first and see what kind of API the plug-in offers.
    The reason I chose /gssell and /gsbuy is to prevent collision with any other plugins, as just /buy and /sell are very generic command names, however intuitive.

    However, I will be up for making shorter aliases for those commands "/gss" and "/gsb". I know they still aren't that intuitive, but they are at least short.
     
  17. Offline

    mike0fmikes

    Been a few weeks and everything is running great.

    As far as the multiple-dependancies, I vote option 2. It just sounds cleaner to me, and in my own humble opinion, a a lot easier to set up.

    And I was talking about something like this: Lets say you have two related items, Gold and Diamond. If someone sells Gold, then the sell price goes down; and that brings the price of Diamonds down. The same holds true for Diamonds, and both item's dependencies equally impact each other's price. In my request I was thinking along these lines: When a person sells Gold it drives the price of Gold down while only effecting the price of diamonds so much. However, if the person where to sell Diamonds instead, it would effect the price of Gold more so. I havent really thought through the logic behind this request, so don't fault me if this sounds crazy :p

    Thanks man, and I love the mod.
    Still no donate link...
     
  18. Offline

    obscurehero

    So. I can't seem to buy/sell with the goldsword (or any item for that matter). For obvious reasons, it has no idea what I want to buyback and says: 'You must first set an item and quantity to buy with /gsset'

    I also can't sell anything with the goldsword wheras the command works. Except, when it doesn't. Randomly goldstandard will lock me out of doing anything and spam the console with "a null player is trying to sell something"

    I'm using H2SQL in the config.
     
  19. Are you using permissions? Also, players have to first add items to their sell and buy list before selling anything. you can add them with /gsadd, remove them with /gsremove, and list them with /gslist. Once a player does this they do not have to ever again, unless they want to modify their list. both add and remove support multiple items at a time as well so you can just do one command to add them all.

    Edit: remove with /gsremove of course
     
  20. Offline

    obscurehero

    Very Helpful! Thanks!

    I am using permissions, but I've already granted the nodes.
     
  21. Offline

    Zathras

    I tried this and was getting NullPointerExceptions. But I'll give this another try when you make the next update. I'd like to see exponential pricing based on supply and demand.
     
  22. Would you be so kind as to give me some stack traces? I'm always trying to iron out bugs, but it's hard to track them all down by myself.

    Thanks
     
  23. Offline

    Zathras

    Code:
    2011-07-19 00:03:57 [SEVERE] Could not pass event PLAYER_JOIN to GoldStandard
    java.lang.NullPointerException
        at com.bukkit.BallisticBuddha.GoldStandard.GSCalc.loadPlayer(GSCalc.java:181)
        at com.bukkit.BallisticBuddha.GoldStandard.GSPlayerListener.onPlayerJoin(GSPlayerListener.java:19)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:244)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
        at net.minecraft.server.ServerConfigurationManager.c(ServerConfigurationManager.java:124)
        at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:97)
        at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:33)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:91)
        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)
    
    Code:
    2011-07-19 00:09:43 [SEVERE] Could not pass event PLAYER_QUIT to GoldStandard
    java.lang.NullPointerException
        at com.bukkit.BallisticBuddha.GoldStandard.GSCalc.storePlayer(GSCalc.java:187)
        at com.bukkit.BallisticBuddha.GoldStandard.GSPlayerListener.onPlayerQuit(GSPlayerListener.java:26)
        at org.bukkit.plugin.java.JavaPluginLoader$2.execute(JavaPluginLoader.java:251)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
        at net.minecraft.server.ServerConfigurationManager.disconnect(ServerConfigurationManager.java:146)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:607)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:231)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
        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)
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  24. What were you using as your data source? was it none? If so I just found out that an entire class I wrote is completely gone! I'll have a look through the commit history to find it, or worst case I'll have to re-write it.
     
  25. Offline

    Zathras

    Yes, it was set for none.
     
  26. Code:
    2011-07-28 19:01:35 [SEVERE] [GoldStandard] A null player is trying to sell something
    2011-07-28 19:01:35 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'gsell' in plugin GoldStandard v1.0
        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.NullPointerException
        at com.bukkit.BallisticBuddha.GoldStandard.Data.GSDataMySQL.addEntryNI(GSDataMySQL.java:126)
        at com.bukkit.BallisticBuddha.GoldStandard.GSCalc.addEntryNI(GSCalc.java:128)
        at com.bukkit.BallisticBuddha.GoldStandard.Transactions.SellProcedure.execute(SellProcedure.java:98)
        at com.bukkit.BallisticBuddha.GoldStandard.GoldStandard.onCommand(GoldStandard.java:260)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    
     
  27. Offline

    mike0fmikes

    I've got a minor bug that I'd like to run past you.

    I'm not sure if the inverse of this holds true but:
    When you sell enough items to drive the economy to the floor, then sell past that floor it's like the 'sell' counter keeps going down. I know that's a terrible example, so here's a little better one. Say the price floor for wood is $4. Some sells down to that $4, then continues to sell wood (we'll say 100 units). The price sticks at $4. Then lets say they decide to buy wood. If they buy 50 units of wood, the price still sticks @ $4. They have to continue to buy wood until they reach that floor again, then buy more to get the price to move.

    Is this a bug? Or is this a feature? Shade of grey?

    Also, any word on multi-relationship selling? Like having gold as one base item, and for instance, wool as another base item? We've been running this mod on our server since my last post, and using it to death. We'll be starting a new world when 1.8 comes out, and having this in place will give my long time players a leg up since they'll have a small fortune to spend when we start. Thanks!!!
     
  28. Any news on an update to 1000, not sure if that is the issue, but this mod seem to be totally non functioning for me, I have had to uninstall it.
     
  29. @Zathras
    A fix for none data is incoming and should fix your issue, in fact, come the next update none data will now be using flatfiles, so you can do price scaling w/o a database. The only thing flatfiles will not support, however, will be the clearing out of old data.

    That my friend, is a feature. (For now at least).

    If this is really a nuisance for users, I'll consider making it an option.
    So, I've come to realize that the implementation is going to take a little longer that I originally intended. I started some work on it, but had to comment most of it out for now and will defer it to 1.2.0


    The problem isn't a needed update to 1000, but rather a very bad error on my part. I started seeing the NPE you're getting back when I re-started development on this last week and am still trying to nail down the issue. It's my current task as everything else for 1.1.0 is in place.
     
    smickles likes this.
  30. Offline

    mike0fmikes


    Good to hear from you again! I, personally, don't think an option is necessary. I believe the only reason that we're running into this on our server so much is because players are trying to sell everything they have before we start a new world. ...meh... I digress.

    I can see why coding it to be a multi-relational mod would be painstaking. Basically you'd be recoding everything, right?

    At any rate, I'm looking forward to the next update. See ya!
     

Share This Page