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.
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
More drive-by cleanup #122
More drive-by cleanup #122
Changes from 4 commits
f63b9cb
0ded1aa
46c9ec0
6f32d21
c7b4aff
5d7b514
f01f9c4
f7e5a0c
098c12f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given:
This field is a bit more interesting, as sometimes it reads just the top bit, sometimes, the 15 upper bits minus the top one, sometimes the whole thing, however I think making struct/union/bitstruct for this might be annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may want to have a union or at least helper functions in this case. After a quick look I think those 4 bytes pack the following information:
enum
should be in D2Common, as it must be used inITEMS_CalculateTransactionCost
)Something related to max cost for item transaction ? Seems to mostly be used with value of 0.ItemMode, but should always be 0? bits 16-30There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transaction types are:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that is correct, as its a buy packet, so sell doesn't make sense. I also assumed there is a separate repair packet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, to be fair, values 1 and 3 are unused, but the field is converted and used as transaction type, which may hold any of the 4 values mentioned above.
I suppose we could have a specific enum for the packet, then cast to the real transaction type enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the issue of the packing, I just checked and it's packed because they use the same function for all packets of size 0x11 (
D2Client.0x6FAADAA0
) which takes 4 DWORD params.For reference here is how it is computed: