[INACTIVE][ECON] DMWrapper v0.14 - a DynamicMarket wrapper adding locations [617]

Discussion in 'Inactive/Unsupported Plugins' started by Magik, Feb 18, 2011.

  1. Offline

    Magik

    DMWrapper v0.14

    Links
    DMWrapper.jar (GitHub Source)
    DynamicMarket.jar ( 0.4.8.magik.28 ) (GitHub Source)
    DynamicMarket Thread ( slightly outdated, I forked it and have been maintaining my own version )

    Plugin Requirements
    • DMWrapper 0.14 was tested against Craftbukkit build #677
    • DynamicMarket ( 0.4.8.magik.28 - Shaniqua )
    • Permissions 2.7
    • iConomy 4.6.3 ( this is what DynamicMarket was compiled against )
    Intro
    I wanted DynamicMarket to be able to be locked down so that it wasn't a "global" shop command. This plugin enables that functionality by adding some /shop location commands. Basically you get to set up some locations in the world as shops, and you can restrict usage of the /shop to only those places. The plugin utilizes DynamicMarket's wrapper mode allowing me to pass commands as necessary to DynamicMarket. This plugin is just restricting location manager addon for DynamicMarket.

    HaloInverse's plugin thread can be found here: http://forums.bukkit.org/threads/econ-dynamicmarket-v-0-4-3-dynamic-price-shop-plugin-343.3266/


    Note: this has been barely tested, use at your own risk. And please for god's sake back things up before you try this! Any suggestions/comments are welcome, please post in this thread ( or an issue on github's issue tracker ).

    And thanks a ton HaloInverse for the great plugin that is DynamicMarket!

    Commands and Usage (open)
    Commands and Usage
    • /shop location - prints out the Usage for the location commands
    • /shop location enable - enables location-restricted shops
    • /shop location disable - disables location-restricted shops - DynamicMarket will work like normal here with a global /shop command
    • /shop location set - begins the shop location selection process - this will ask you to right click 2 corners to set the boundary box
    • /shop location cancel - cancels the shop setting process
    • /shop location remove <ID> - removes the shop location with id ID
    • /shop location check - tells you the shop location ID that you are currently in ( for deleting )
    • /shop location list - lists all the IDs of the shop locations
    • /shop location tp <ID> - teleports to the shop ID location
    Permissions (open)
    Permission Nodes:


    dmwrapper.location - allows usage of the /shop location command
    dmwrapper.admin - locations will not apply to a group with this node
    Installation Instructions (open)
    Installation Instructions:
    • Ensure you have DynamicMarket already installed and working ( with my latest compiled version here )
    • Add the permissions node to whomever you would like to be able to access the "/shop location" commands
    • Download the .jar - put it in the plugins directory
    • Once in-game ( with the location permission node ):
      • /shop location enable
      • /shop location set
    Changelog (open)
    Changelog:
    • 0.13
      • recompiled against CB#617 for Minecraft 1.4
    • 0.12
      • CB #602 update, as well as permissions/iConomy for that RB
    • 0.10
    • 0.09
      • added better integration into /shop help
    • 0.08
      • fixed command collisions with DynamicMarket ( also fixed in DynamicMarket 0.4.8.magik.18 )
    • 0.07
      • added debug-mode to config
    • 0.06
      • better player tracking for entering/leaving messages
    • 0.05
      • better world tracking
    • 0.04
      • fixed embarrassing stupid command error
      • fixed /shop location being ignored when locations disabled in shop.yml
    • 0.03
      • Updated to support newer DynamicMarket ( 0.4.8.magik.15 )
      • Craftbukkit Build #522
    • 0.02
      • minor command related bug fixes
      • tweaked intercept command code
    • 0.01
      • Initial Release
      • Added basic location based functionality to DynamicMarket
    To-do (open)
    To-do
    • Add custom/configurable messages for everything
    • Color up the current messages
    • Find a way to show the location command when passing /shop help to DynamicMarket
    • Add ability to pass administrative commands ( list/add/remove/etc... ) and ignore locations for those
    • Add ability to pass all commands if admin permissions?
    • Better handling of worlds ( currently I am assuming one world, and thus, this will probably break if you someone tries some sneaky things like setting one corner of a shop in one world, and another corner in another world ).
    • Fix getCenterOfShop() function to return calculated center instead of returning one of the set corners
    • Remove hard-coded plugin name/version/paths
     
  2. Offline

    Magik

    I'm going to have to ask you guys to try to run this plugin with only:
    iConomy
    Permissions
    DMWrapper
    DynamicMarket

    because as far as I can tell everything works perfectly. I just removed myself from ops and the Admins group on my server. Changed the default group's permission nodes to remove all dynamicmarket/dmwrapper references. And this worked perfectly. Outside of the shop location I got a "Not in shop location" message, and inside the shop location, I got the error: "You do not have permission to access the shop."

    So as I said before.... until I can replicate this problem, I can't fix it....

    Show me how I can make this problem happen, and I will fix it, probably in minutes.

    when you guys type /shop help
    what is listed under Commands? and what is listed under Commands: when you are in the default/Guest user group?

    as I said before, you guys can always zip up your minecraft folder ( without the world files of course ) and I can try it on my end....

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 9, 2016
  3. Offline

    Magik

    SplenectomY likes this.
  4. Offline

    kingmob

    Running only iConomy, Permissions, DMWrapper and DynamicMarket... same results.

    Now, when I deleted Permissions got this when loading the server:

    "2011-03-24 06:14:30 [INFO] [DynamicMarket] iConomy connected.
    2011-03-24 06:14:30 [SEVERE] null loading DynamicMarket v0.4.8.magik.20 (Is it up to date?)
    java.lang.NullPointerException
    at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onEnable(DynamicMarket.java:112)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-03-24 06:14:30 [INFO] [DynamicMarket] wrapper mode enabled by DMWrapper
    2011-03-24 06:14:30 [INFO] [DMWrapper] Successfully linked with DynamicMarket
    2011-03-24 06:14:30 [SEVERE] null loading DMWrapper v0.1 (Is it up to date?)
    java.lang.NullPointerException
    at me.slaps.DMWrapper.DMWrapperPluginListener.tryEnablePlugins(DMWrapperPluginListener.java:54)
    at me.slaps.DMWrapper.DMWrapper.onEnable(DMWrapper.java:82)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)"

    This when I tried /shop help without Permissions:

    "2011-03-24 06:14:42 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'shop' in plugin DynamicMarket v0.4.8.magik.20
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:229)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    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.NoClassDefFoundError: com/nijikokun/bukkit/Permissions/Permissions
    at me.slaps.DMWrapper.DMWrapper.hasPermission(DMWrapper.java:112)
    at me.slaps.DMWrapper.DMWrapperPlayerListener.showHelp(DMWrapperPlayerListener.java:207)
    at me.slaps.DMWrapper.DMWrapperPlayerListener.onCommand(DMWrapperPlayerListener.java:89)
    at me.slaps.DMWrapper.DMWrapper.onCommand(DMWrapper.java:118)
    at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onCommand(DynamicMarket.java:185)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more
    Caused by: java.lang.ClassNotFoundException: com.nijikokun.bukkit.Permissions.Permissions
    at java.net.URLClassLoader$1.run(URLClassLoader.java:221)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:209)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
    ... 18 more"

    In "simple-permissions=" false and true seems to output the same results.
     
  5. Offline

    SplenectomY

    Thanks for all of your help, man. You should really set up a donation button ;)

    Have a good one.
     
  6. Offline

    Magik

    these plugins require permissions....

    but I'm guessing it's something wrong with your permissions configuration then. I've even talked to the guy who took over Permissions ( TheYeti ), and he sees nothing wrong with how DynamicMarket does Permissions?

    Please just send me your permissions config, and I can take a look at it?

    Or even better, just zip up your minecraft dir with just those 4 plugins ( and remove the world folder too ).

    I'd love to help, but I don't see this issue on my side, nor a lot of other people's sides who have tried as well....

    and no problem man, just happy to fix the problems so others can use it as well. Thank you for staying with me and helping me debug the problem!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 9, 2016
  7. Offline

    LordCrazyKing

    Could you possibly change the dynamicmarket (as you're kinda updating it now?) to use decimals for the baseprice/buyprice/sellprice/etc. (Like real money has, 2dp).
    (iConomy supports it but everyone else is still sticking to integers :()
    Loving the plugin and the locations addition is so perfect!
     
  8. Offline

    Magik

    the only problem I have with decimals is how to display them in a good way, already right now we are getting linewrapping in the /shop list stuff

    so I could either round them off and display them as integers for the /shop list? And maybe have more detailed decimal information when you do /shop info?

    On another note, do you use these plugins? Everything working for you?
     
  9. Offline

    LordCrazyKing

    Yea, i've set up a location and the alerts tell me i'm in the shop only when i'm in the area i wanted :)

    I'm currently still setting up my items but everything i've tested works fine :D

    (The stock based prices seem to use rounded decimals already so i don't think a conversion should be too hard).
    Rounding them off and having more detail in the info is fine for me, just want to be able to charge more specific amounts for items (and also have more accurate prices for lower items, e.g. lots of items are worth 1 currently which causes a sell price of 0 with my 40% sales tax).

    Edit: Just tested buying and selling as a regular user, i have to be in the right area (including the correct level of the building :D) and prices fluctuate as they should, money goes in and out of the linked admin account as expected.
     
  10. Offline

    kingmob

    Hi Magik, this is my permissions file http://pastebin.com/F0REigEc (just deleted the long user list after me). Do you see anything wrong with it?
     
  11. Offline

    Magik

    maybe something else is having problems? Because I just copied that world.yml onto my server, and I was denied access to the shop - and it had my prefix as Visitante in herochat, so I'm pretty sure I was in the default group.

    Then I changed it so kingmob_hm was replaced with my in-game username, then i typed in the console "permissions -reload all" and I tried the shop again, I had access and everything.

    Basically, everything looks like it's working fine...

    Can you give me detailed steps/instructions on how I make the problem happen?
     
  12. Offline

    Mopquill

    Hey, might you know if this works with 602? That is currently the latest recommended craftbukkit version, and I've had to update for some other plugins. I am, however, very eager to try out DynamicMarket and DMWrapper- I definitely think these sound together like the best shop solution I've seen on these forums, assuming everything works. =]
     
  13. Offline

    imaxorz

    Not sure when, but I started to get this error during start up.


    2011-03-30 15:11:46 [INFO] [DynamicMarket] Successfully linked with Permissions.
    2011-03-30 15:11:46 [SEVERE] [DynamicMarket]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-03-30 15:11:46 [INFO] [DynamicMarket] Creating database.
    2011-03-30 15:11:46 [SEVERE] [DynamicMarket]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-03-30 15:11:46 [SEVERE] [DynamicMarket]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-03-30 15:11:46 [SEVERE] [DynamicMarket] Database creation *failed*.
    2011-03-30 15:11:46 [SEVERE] [DynamicMarket]: Database connector not found for mysql: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    2011-03-30 15:11:46 [INFO] [DynamicMarket] version [0.4.8.magik.20] (Shaniqua) enabled


    I have no idea when it started to do this as everything is and has been working properly. Players use shop every day with no problems at all. I've only noticed that by accident today while looking at something else in the log.

    I'm using MySql and I've checked and the database gets updated as it should when I sell/buy items.
     
  14. Offline

    Tenebrion

    I found what was the problem with these 2 plugins on my server I don't know if I'm just slow or what but just in case I'll just post it here.

    For some reason DMWrapper loaded BEFORE DynamicMarket which made the wrapper not work at all. The soulutian was very easy: I just put a "z" in the start of the DMWrapper name and now it works :)

    Got another problem tho it seems as the locations disappear when you restart the server like it isn't saved or something, any soulution?
     
  15. Offline

    Magik

    both plugins updated to CB#602 RB - links in the OP

    maybe re-check to see if you have the mysql-connector jar in the plugins/DynamicMarket directory? It looks like it can't find the drivers?

    Also, you say you've checked the DB and it is getting updated and the plugin seems to be working!?

    There should be no problem with DynamicMarket or DMWrapper loading first or last, shouldn't matter at all.

    Do you get any errors at all in the console? The locations don't disappear on my end? Even when you hard stop the server ( kill the process ), the plugin should save the locations as soon as you set the location....

    While you are in-game, after doing a /shop location set - and clicking the 2 points to make the location, can you check the DMWrapper/shops.yml and see if there is anything in there? Is there anything else I should know about your setup? Do you have a world not named "world"?

    Please try to detail the steps I can do to re-create this problem. You should give me steps that make this break with only these plugins loaded: iConomy, DMWrapper, DynamicMarket

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 9, 2016
    Mopquill likes this.
  16. Offline

    Mopquill

    Thanks, I'll be installing and testing this with 602 soon- I'll let you know how it goes. Thanks for being so speedy with your reply, and your work. =]

    I got several errors upon starting my server up with this mod enabled. I noticed it had to do with stuff that it was downloading, so I entered the stop command, and then restarted, and now I'm getting one error:

    Code:
    17:03:47 [SEVERE] tried to access field com.gmail.haloinverse.DynamicMarket.DynamicMarket.debug from class com.gmail.haloinverse.DynamicMarket.SQLHandler loa
    ding DynamicMarket vv0.4.8.magik.25 (Is it up to date?)
    java.lang.IllegalAccessError: tried to access field com.gmail.haloinverse.DynamicMarket.DynamicMarket.debug from class com.gmail.haloinverse.DynamicMarket.SQ
    LHandler
            at com.gmail.haloinverse.DynamicMarket.SQLHandler.<init>(SQLHandler.java:30)
            at com.gmail.haloinverse.DynamicMarket.DatabaseCore.checkTable(DatabaseCore.java:131)
            at com.gmail.haloinverse.DynamicMarket.DatabaseCore.initialize(DatabaseCore.java:31)
            at com.gmail.haloinverse.DynamicMarket.DatabaseCore.initialize(DatabaseCore.java:27)
            at com.gmail.haloinverse.DynamicMarket.DatabaseCore.<init>(DatabaseCore.java:23)
            at com.gmail.haloinverse.DynamicMarket.DatabaseMarket.<init>(DatabaseMarket.java:17)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarket.setup(DynamicMarket.java:238)
            at com.gmail.haloinverse.DynamicMarket.DynamicMarket.onEnable(DynamicMarket.java:123)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:511)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:93)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:71)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    17:03:47 [INFO] [DynamicMarket] wrapper mode enabled by DMWrapper
    17:03:47 [INFO] [DMWrapper] Successfully linked with DynamicMarket
    17:03:47 [INFO] [DMWrapper] Version [v0.12] (Botswana) enabled
    I'm not sure how this affects the actual -functioning- of the plugin, but, these are my preliminary findings.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 9, 2016
  17. Offline

    Magik

    Can you show me a java -version?'

    here's a new version of DynamicMarket: https://github.com/downloads/magik/DMWrapper/DynamicMarket.jar

    you can try that as well
     
  18. Offline

    Sleaker

    Can you please post an actual Thread/Plugin for your Fork of DynamicMarket w/ appropriate github source?
     
  19. Offline

    imaxorz

    Yup, the connector is there it's "mysql-connector-java-5.1.15-bin.jar"

    And yes, it works as it should, when I buy/sell stuff the stock in the table gets updated as it should.

    My server restarts every night and saves the log from that day. I just went trhough the logs from 3-22 to 3-29 and every single time it started up that error came up, but shop has been working perfectly fine and no one has complained about it not working.

    Weird, huh.
     
  20. Offline

    Magik

    I'm too lazy to start a thread, hopefully HaloInverse comes back to support it eventually

    but the github is on my github, and it has been posted in Halo's thread already - it's http://github.com/magik/DynamicMarket
    and yeah that is really weird... I may take a look at it, but I'm kind of focusing the little spare time I have on iConomyLand, dealing with other people's code is sometimes a pain in the butt.

    possible fix for your mysql issue: https://github.com/downloads/magik/DynamicMarket/DynamicMarket.jar

    let me know if that gets rid of your errors
     
  21. Offline

    imaxorz

    Don't worry about it :)

    It works fine so I don't mind. I'm going to move to CB602 this weekend, I will see what happens then.

    IConomyLand is looking awesome btw.
     
  22. Offline

    Magik

    ok, yeah, all stuff going forward of mine is only supporting CB602

    let me know how it goes when you get around to updating
     
  23. Offline

    Sleaker

    Can you add this link to your Original post? The DYnamicMarket thread is pretty much not-in-use and doesn't show up in the plugin list..
     
  24. Offline

    Mopquill

    Code:
    java version "1.6.0_18"
    OpenJDK Runtime Environment (IcedTea6 1.8.3) (6b18-1.8.3-2~lenny1)
    OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)
    According to apt-get, that is the newest version for Debian-lenny.
    Thanks, I'll let you know when I get a chance to try it. Everyone on my server wants me to update so they can do all the wolf stuff, and so that is my first priority right now.
    He has a link to the JAR in the first post of this thread.
     
  25. Offline

    crazydog

    2011-03-31 15:27:01 [SEVERE] Nag author: 'HaloInverse' of 'DynamicMarket' about the following: onPluginEnable has been replaced with a new signature, (PluginEnableEvent)

    (Yes I'm running your version and it still says HaloInverse :p)
     
  26. Offline

    Magik

    are you sure you've upgraded to the latest DynamicMarket and DMWrapper? because that should have been fixed?

    or what CB# are you running?

    can you tell me what versions of DynamicMarket and DMWrapper the console says you have?
     
  27. Offline

    Sleaker

    I would like a link to the github repo.. not a link to the jar. So we can easily find the source. I didn't actually find it until it was linked to. There's a bit of a difference there.
     
  28. Offline

    Magik

    you COULD just check my github, but yes I'll ad the link at the top
     
  29. Offline

    crazydog

    Hey there:
    Running DynamicMarket 0.4.8.magik.24

    simple-permissions=false

    Group "Guest" doesn't have permissions for any shop command via GroupManager, yet they can still use the shop
     
  30. Offline

    Magik

    I don't support group manager, I support permissions? and Permissions 2.5.5 to be exact
     
  31. Offline

    jonathan edel

    will you be updating this anytime soon..? i prefer this so much to permissions!
     
  32. Offline

    Magik

    what is this?
     

Share This Page