Conversation
Collaborator
|
(verified the first 3 fixes, waiting for some other devs to chime in with their knowledge on the last 3 fixes) Great job with finding these bugs, the code to fix them, and the PR notes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a few inventory, trade and vendor issues where client input could duplicate items, lose items, or create an unbounded number of objects.
HandleActionGiveObjectRequestvalidates the item and stack size when the request comes in, then gives the item in the MoveTo callback using the original item and container references. Give doesn't setIsBusy, andHandleActionStackableMergewithin the player's own inventory runs immediately, so the stack can be fully merged into another stack (and destroyed) before the callback runs. When giving part of a stack,RemoveItemForGivethen subtracts from the destroyed stack, whoseStackSizewas never cleared, and creates a new stack, duplicating the amount. Same for NPC gives.StartPickupChaindoesn't setIsBusy.HandleActionStackableSplitToContainerdoes after its move and pickup. This also refreshes the container references (and for Give, the equipped state) in case the item was moved in the meantime.FinalizeTraderemoves items from both players, then adds them to the other player after a short delay, ignoring the result. It setsIsBusy, but in-inventory actions such asHandleActionStackableSplitToContainerdon't check it, so the recipient can use up free slots during the delay and the item ends up with no container. Items that can't be added are now returned to their original owner (or logged as lost if that also fails), the same fallbackGiveObjectToPlayeruses.ItemsToReceive, andItemProfileToWorldObjectscreates one object per unit for non-stackable items before the busy, unique and price checks, so a large amount for a service would create that many objects on the world thread. A service can now only be bought with an amount of 1. Repeated item guids in the same request now reject the whole purchase (sell already drops duplicates); previously a unique item listed twice was charged twice, and if the main pack was full it could be added to two side packs.MYSQL_ROOT_HOST=%) and the default root password committed indocker.env. It's now bound to localhost; the server container connects over the compose network and is unaffected. Remote DB tools would need an SSH tunnel or a compose override.