Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item reward abusable by leaving space in inventory #220

Open
P0nk opened this issue Feb 10, 2024 · 1 comment
Open

Item reward abusable by leaving space in inventory #220

P0nk opened this issue Feb 10, 2024 · 1 comment

Comments

@P0nk
Copy link
Owner

P0nk commented Feb 10, 2024

Silwhoon:

In ItemRewardHandler.java, players can exploit usable items by filling their inventories and only leaving space for the item they want. As it only checks if the player has space for the selected random reward, rather than checking if the player has space for any potential reward

Ponk:

I don't really see it being the way you explain. It is abusable, but only for the 1st potential reward in the list.
Another issue I spotted is that there's a chance that no item is rewarded since a new random int is generated for each potential reward instead of once at the beginning.

Relevant lines: https://github.com/P0nk/Cosmic/blob/master/src/main/java/net/server/channel/handlers/ItemRewardHandler.java#L57-L82

@P0nk
Copy link
Owner Author

P0nk commented Feb 10, 2024

Solution: check for an empty space in all inventory tabs that are possible among all the item rewards.

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

No branches or pull requests

1 participant