Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

[BUG]: Item currency gets deleted if server not shut down properly #522

Open
roxandtol opened this issue Jun 13, 2023 · 7 comments
Open
Assignees

Comments

@roxandtol
Copy link

TNE Version

0.1.1.17-PRE3

Spigot Version

1.19.3

Your config.yml

https://paste.ee/p/iy8Ie

Your latest server log

https://mclo.gs/ksM7kkY

What modules are you using?

No response

What part of TNE is the bug affecting?

Other Plugin Support

Is your server using online mode?

Yes

Bug description

If the server doesn't shut down properly (for example, if it crashes), all items that are used as currency in the users who were online in the crash get deleted

How to reproduce

  1. Have people online in a server with an item currency
  2. Server crash
  3. When it restarts, those people don't have the currency in their inventory
@creatorfromhell
Copy link
Member

Do they get deleted, or does it not save their balances? This could be an issue resolved by having your server occasionally run /tne save.

@roxandtol
Copy link
Author

latest server log doesn't have a crash

@roxandtol
Copy link
Author

Do they get deleted, or does it not save their balances? This could be an issue resolved by having your server occasionally run /tne save.

The items were gone from their inventories, and if they did /bal, they couldn't check it. I usually did /tne save but since you never know when a crash is going to happen, I can't do it. I'll try to do the /tne save every minute or so using a pterodactyl task

@creatorfromhell
Copy link
Member

creatorfromhell commented Jun 13, 2023

Do they get deleted, or does it not save their balances? This could be an issue resolved by having your server occasionally run /tne save.

The items were gone from their inventories, and if they did /bal, they couldn't check it. I usually did /tne save but since you never know when a crash is going to happen, I can't do it. I'll try to do the /tne save every minute or so using a pterodactyl task

Yeah, crashes would stop any fix from being implemented. I can't include code to save balances any time an item is picked up or dropped as that would cause insufferable TPS drops. The true fix would be to find the root cause of the crashes.

@roxandtol
Copy link
Author

roxandtol commented Jun 13, 2023

Maybe for items, it could just read the amount of X item set as currency in the inventory, and do the calculations from there? Since I noticed that when you log off and log on again, if you had an item that had a smaller unit and a bigger unit (for example, diamonds and diamond block), if you had >9 diamond, it compacted them

@creatorfromhell
Copy link
Member

creatorfromhell commented Jun 13, 2023

Maybe for items, it could just read the amount of X item set as currency in the inventory, and do the calculations from there?

The issue with that is any offline transactions would cause a dupe race-condition that wouldn't be worth it just because a crash that should be resolved isn't. I.e. it'd make offline transactions impossible.

@roxandtol
Copy link
Author

roxandtol commented Jun 13, 2023

The issue with that is any offline transactions would cause a dupe race-condition that wouldn't be worth it just because a crash that should be resolved isn't.

True

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

No branches or pull requests

2 participants