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

Support encounter views #14

Merged
merged 2 commits into from
Jun 2, 2024
Merged

Conversation

SzymonKaminski
Copy link
Contributor

@SzymonKaminski SzymonKaminski commented May 15, 2024

Messages EncounterUIScopeIn and EncounterUIUpdate contain data in format similar to the one seen in view update messages (msg id 1), described in the wiki.
I grouped and added comments to bytes of few types of ScopeIn messages found in replay files in this gist file.

At the beginning, there's encounter id.
Length of header in bytes and string telling encounter type is next.
Then, ScopeIn message contains header with info about fields: index, type (similar to SincardFieldDataType), element count, name for each field.
Afterwards there's schema version that has to be equal to 2 in last version of client.
At the end there are values of previously mentioned fields, in both ScopeIn and Update messages.
Values of array fields are prefixed with indexes of both the field and the element within the array, so they take two bytes and not just one.

PR reuses methods created to work with views, and add bits specific to encounters, to simplify creating new types of encounters and working with their instances, so that they could be treated as views nested in EncounterUI messages.
Static class AeroEncounters is also added to be used by PacketPeep.

@Xsear Xsear merged commit ee17404 into themeldingwars:main Jun 2, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants