Dasfaust / GlobalMarket

Buy and sell items in a global market
Other
28 stars 58 forks source link

Money taken, although transaction not completed #102

Closed Slind14 closed 5 months ago

Slind14 commented 8 years ago

Hey, on some listings a NPE is being thrown causing the buyer to loose the money, not getting the bought item and the seller not getting any money. This is cause by global market trying to deposit money to a null player.

I added debug to net.milkbowl.vault.economy.plugins.Economy_Craftconomy3.depositPlayer(Economy_Craftconomy3.java:132) ~[?:?] to check if it is global market.

Important this is a multi server setup with redis. Sellers in question did not rename their accounts in years. We have 3 nodes, buying on node 1 and 2 works while it doesn't on node 3. The player files of node 1 and 2 are synced, node 3 is stand alone (besides market and economy). It could be that this issue is caused by the missing player file. Regarding the configuration, only one node is configure to save the data on a 1200 tick interval as told.

I would appreciate any help and a solution :)

[15:15:33] [Server thread/INFO]: [Vault] deposition: null   42.75
[15:15:33] [Server thread/ERROR]: Could not pass event InventoryClickEvent to GlobalMarket v2.0.0.32
org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:338) ~[JavaPluginLoader$1.class:1.7.10-1614.MyM.4]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[RegisteredListener.class:1.7.10-1614.MyM.4]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507) [SimplePluginManager.class:1.7.10-1614.MyM.4]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492) [SimplePluginManager.class:1.7.10-1614.MyM.4]
    at net.minecraft.network.NetHandlerPlayServer.func_147351_a(NetHandlerPlayServer.java:2015) [nh.class:?]
    at net.minecraft.network.play.client.C0EPacketClickWindow.func_148833_a(SourceFile:32) [ix.class:?]
    at net.minecraft.network.play.client.C0EPacketClickWindow.func_148833_a(SourceFile:10) [ix.class:?]
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:244) [ej.class:?]
    at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:173) [nc.class:?]
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:991) [MinecraftServer.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431) [lt.class:?]
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
Caused by: java.lang.NullPointerException
    at com.greatmancode.craftconomy3.account.AccountManager.getAccount(AccountManager.java:66) ~[?:?]
    at net.milkbowl.vault.economy.plugins.Economy_Craftconomy3.depositPlayer(Economy_Craftconomy3.java:316) ~[?:?]
    at net.milkbowl.vault.economy.plugins.Economy_Craftconomy3.depositPlayer(Economy_Craftconomy3.java:132) ~[?:?]
    at net.milkbowl.vault.economy.AbstractEconomy.depositPlayer(AbstractEconomy.java:50) ~[?:?]
    at me.dasfaust.gm.trade.ListingsHelper.buy(ListingsHelper.java:73) ~[?:?]
    at me.dasfaust.gm.trade.MarketListing.onClick(MarketListing.java:113) ~[?:?]
    at me.dasfaust.gm.MenuHandler.onClick(MenuHandler.java:166) ~[?:?]
    at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:334) ~[JavaPluginLoader$1.class:1.7.10-1614.MyM.4]
    ... 13 more
Dasfaust commented 8 years ago

Hmm, my first thought would be one of the two players haven't logged into the other server and getOfflinePlayer() is returning null, as you suggested. Needs further investigation, will try to get to it soon. If it's the case I'll have to make a fake OfflinePlayer, I think.

Slind14 commented 8 years ago

just verified, its caused by missing player files. Using a fake offline player would work but requires the UUID and Name.