Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

My economy balance gets reset when I travel to a world and back or switch gamemodes and switch back. #38

Closed
EbonJaeger opened this issue May 6, 2018 · 10 comments
Milestone

Comments

@EbonJaeger
Copy link
Owner

EbonJaeger commented May 6, 2018

Copy from EbonJaeger/PerWorldInventory#319
It's prolly an issue here as well. Best bet is probably to check to see if the end amount is less than 0, and adjust accordingly. Would be so much nicer if Vault had a setBalance(double) method....

@Twingary said:
Hi, I recently started using PerWorldInventory specifically so I could separate the economies between my creative world and survival world. But I've ran into an issue that when I switch gamemodes and switch back, I will get this issue in the console:

[Sat, 5. May 2018 20:27:50 EDT INFO] twingary issued server command: /gmc
[Sat, 5. May 2018 20:27:50 EDT WARN] [PerWorldInventory] [ECON] Unable to withdraw funds from 'twingary': Cannot withdraw negative funds
[Sat, 5. May 2018 20:27:51 EDT INFO] twingary issued server command: /bal
[Sat, 5. May 2018 20:27:53 EDT INFO] twingary issued server command: /gms
[Sat, 5. May 2018 20:27:53 EDT WARN] [PerWorldInventory] [ECON] Unable to withdraw currency from 'twingary': Cannot withdraw negative funds
[Sat, 5. May 2018 20:27:53 EDT WARN] [PerWorldInventory] [ECON] Unable to withdraw currency from bank of 'twingary': Cannot withdraw negative funds

The same issue appears when I go to my creative world and come back to my survival world, my balance goes from $2,000,000 (I gave myself money to test the issue) to -$0 which doesn't make sense.

@Twingary
Copy link

Twingary commented May 6, 2018

Thanks for the help, I think I've found a fix to the issue.

@EbonJaeger
Copy link
Owner Author

What would that be?

@Twingary
Copy link

Twingary commented May 7, 2018

I couldn't really find a fix with perworldinventory, but instead disabled the economy loading feature and replaced that with MultiWorldMoney which works fine for me. Although I still use pwi for keeping inventories and such private.

@x0Z3ro0x
Copy link

x0Z3ro0x commented May 18, 2018

This is REALLY annoying error that doesn't seem to be getting any love. Unfortunately I am not going to follow Twingary and keep both plugins. I will just find and alternative to PWI and use that. Best of luck on fixing your issue. Just wanted to let you know this is STILL happening for the latest spigot version to date: 5/18/2018

@EbonJaeger
Copy link
Owner Author

EbonJaeger commented May 18, 2018

It just occurred to me this issue is on the 1.x series. Is it still present on the 2.0 version (see this page)?

@x0Z3ro0x
Copy link

It just occurred to me this issue is on the 1.x series. Is it still present on the 2.0 version (see this page)?

I have downloaded the .jar from the page you linked. So far the error has not occurred. However it came at random for me last time. Sometimes it occurred when /gm other times it wouldn't. However you have a new issue now. If I join a world, I get the following message:

[16:27:53 WARN]: [PerWorldInventory] Creating a new group on the fly for 'Hub'. Please double check your worlds.yml file configuration!

However nothing is added to the worlds.yml. In addition this message is sent again and again every time myself or another OP joins a world. Even if the world is already been joined before.

@EbonJaeger
Copy link
Owner Author

@x0Z3ro0x Are your worlds in groups in your worlds.yml file? And could you post the answer and the contents of that file to #34 ? Thank you.

EbonJaeger added a commit that referenced this issue May 19, 2018
…ad of setting to 0 and depositing

This should help with issues some people are experiencing where withdrawing all of a player's money results in a negative value, somehow.

Signed-off-by: Evan Maddock <maddock.evan@vivaldi.net>
@EbonJaeger
Copy link
Owner Author

I've modified how player balances are changed. Instead of just blindly withdrawing everything and then depositing the new amount, PWI will calculate the difference between the old and new values, and deposit or withdraw that difference. This should reduce or remove this issue, as well as making the process simpler (one less API call).

@EbonJaeger EbonJaeger added this to the 2.0.0 milestone May 19, 2018
@x0Z3ro0x
Copy link

It's been several hours with extensive balance changes, world changes, and GM changes. Still no sign of the bug. I believe your changes have fixed this and we can mark it solved.

@EbonJaeger
Copy link
Owner Author

Awesome! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants