ksafin / DynamicEconomy

A Virtual Economy for your Minecraft Server
http://dev.bukkit.org/server-mods/dynamiceconomy-v-01/
12 stars 7 forks source link

/sell wood infinite exploit #98

Open EmpathDemon opened 12 years ago

EmpathDemon commented 12 years ago

With birch/pine/jungle logs in my inventory, I can "/sell wood" forever without losing the logs. If I only have regular logs, it works normally.

Basically it seems to be detecting any type of wood for deciding if you can sell regular wood. Also after doing this I start getting an error when I try to sell birch/pine/jungle wood that I actually have:

"An internal error occurred while attempting to perform this command" and here's the log

2012-06-08 21:40:31 [SEVERE] org.bukkit.command.CommandException: Unhandled exception executing command 'sell' in plugin DynamicEconomy v.8.5 2012-06-08 21:40:31 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 2012-06-08 21:40:31 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166) 2012-06-08 21:40:31 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:479) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:821) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:567) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459) 2012-06-08 21:40:31 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) 2012-06-08 21:40:31 [SEVERE] Caused by: java.lang.NoSuchMethodError: couk.Adamki11s.Extras.Inventory.ExtrasInventory.getAmountOfDataValue(Lorg/bukkit/entity/Player;Lorg/bukkit/inventory/ItemStack;)I 2012-06-08 21:40:31 [SEVERE] at me.ksafin.DynamicEconomy.Transaction.sell(Transaction.java:738) 2012-06-08 21:40:31 [SEVERE] at me.ksafin.DynamicEconomy.DynamicEconomyCommandExecutor.onCommand(DynamicEconomyCommandExecutor.java:270) 2012-06-08 21:40:31 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 2012-06-08 21:40:31 [SEVERE] at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:303) 2012-06-08 21:40:31 [SEVERE] at com.earth2me.essentials.Essentials.onCommand(Essentials.java:288) 2012-06-08 21:40:31 [SEVERE] ... 13 more

ksafin commented 12 years ago

I'm testing right now and all logs sell correctly for me, and /sell wood with jungle/birch/pine in your inventory tells you that you have no wood to sell (This is all using a clean DE installation).

Try backing up your items.yml, and having DE regenerate a new one.

Let me know if this fixes the problem or not. If so, it was something with the entries of the logs in Items.yml (I'd believe)

EmpathDemon commented 12 years ago

I backed up items.yml and forced a new one to generate. Then I did /gamemode to get into creative, grabbed some birch logs and did "/sell wood" with the same results. "Wood" is sold to the market and the birch logs remain in my inventory. Let me know if I can provide more info.

ksafin commented 12 years ago

Did you get back out of creative before doing /sell wood? Because otherwise it would just sell the wood in your creative inventory.

EmpathDemon commented 12 years ago

I'm not sure if I did, but I just tested it returning to survival first, and it happened again.

EDIT: but I didn't reset the prices again first. I'll have to check after people go to bed.

EmpathDemon commented 12 years ago

Okay, deleted items.yml, logged in with a regular player account (no creative mode), picked up some birchwood with no regular wood in my inventory, and did "/sell wood". The market bought imaginary wood and left my birchwood in its place.

EDIT: As a side-note, I think you said selling items from creative mode would sell from the unlimited creative inventory, but it doesn't. I'm guessing it checks your actual inventory (viewable in creative mode by opening a chest) and won't let you sell anything you don't actually have. Not sure if that's what you meant, but thought it was worth mentioning. In other words, "working as intended, afaict" =)

ksafin commented 12 years ago

Wait, are you still getting this internal error with the latest update?

EmpathDemon commented 12 years ago

Just installed the new version, deleted items.yml, restarted server, logged in regular survival character. Has birchwood in inventory, no regular wood. did "/sell wood", and got money without giving up birchwood. then I did "/sell birchwood" and got the errors listed above.

So no change with the new version.

ksafin commented 12 years ago

Insanely bizarre that I can't replicate it. I did the exact same thing (brand new survival server, log in, punch a birch tree, /sell wood), and I get a "You have no 1 WOOD" message..

EmpathDemon commented 12 years ago

Is there a set of files I can email you? just the items, or the config? I'm not using signs or regions at all yet, so those are out-of-the-box still.

EDIT: I see adamki11s in the errors I put up yonder. That's the Regios plugin I believe. I don't know why they'd be interacting, but it must be some kind of plugin fight? Here's what I'm running:

EconomyPunga, WorldEdit, VoxelSniper, Vault, VariableTriggers, PermissionsEx, Modifyworld, LWC-Economy, MonsterBox, LWC, mcMMO, WorldGuard, Regios, MCDocs, dynmap, Essentials, CommandSigns, DynamicEconomy, EssentialsSpawn, BOSEconomy, EssentialsChat, HomeSpawnPlus, ShowCaseStandalone

ksafin commented 12 years ago

I use a library Adamki11 released for developers in DE. It has a bunch of methods I didn't want to waste time re-writing.

Do you still get the error you posted in the original issue?

And no, I can't think of anything you can send me as of now. It's almost 3 AM so I'm kind of brain fried working on DE all day (just released v .8.52). I'll let you know tomorrow if something comes to mind

EmpathDemon commented 12 years ago

I can't upgrade to 8.52 or delete the items.yml file while I have users on (I'm still running off my own computer as I hunt for a host), but I can report that the same behavior is showing up for planks (vs "birchplanks", et al) and saplings. The following errors appear after selling imaginary saplings, then trying to sell an actual junglesapling (is there a way to force the log to show the "13 more"?):

2012-06-10 11:51:25 [SEVERE] org.bukkit.command.CommandException: Unhandled exception executing command 'sell' in plugin DynamicEconomy v.8.51 2012-06-10 11:51:25 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 2012-06-10 11:51:25 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166) 2012-06-10 11:51:25 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:479) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:821) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:567) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459) 2012-06-10 11:51:25 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) 2012-06-10 11:51:25 [SEVERE] Caused by: java.lang.NoSuchMethodError: couk.Adamki11s.Extras.Inventory.ExtrasInventory.getAmountOfDataValue(Lorg/bukkit/entity/Player;Lorg/bukkit/inventory/ItemStack;)I 2012-06-10 11:51:25 [SEVERE] at me.ksafin.DynamicEconomy.Transaction.sell(Transaction.java:765) 2012-06-10 11:51:25 [SEVERE] at me.ksafin.DynamicEconomy.DynamicEconomyCommandExecutor.onCommand(DynamicEconomyCommandExecutor.java:270) 2012-06-10 11:51:25 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 2012-06-10 11:51:25 [SEVERE] at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:303) 2012-06-10 11:51:25 [SEVERE] at com.earth2me.essentials.Essentials.onCommand(Essentials.java:288) 2012-06-10 11:51:25 [SEVERE] ... 13 more