-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rewrite and TypeScript migration #26
base: master
Are you sure you want to change the base?
Conversation
used in YKW2 and others
private groups = new List(new UInt8()); | ||
private param = new UInt64(); | ||
private commonData = new RVBuffer(); | ||
|
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.
Here we are missing the updateTime
field, which was added in NEX 3.6.0: https://nintendo-wiki.pretendo.network/docs/nex/protocols/ranking/#rankingrankdata-structure
We may also want to look at the original code (pre-rewrite) to ensure we don't lose documentation that may not have been ported over to the wiki
I have the strangest feeling that I made this exact commit to nex-protocols-go months ago
Thank you for the update on |
Draft for now as
PR rewrites all the packet parsing and session handling essentially from scratch, and migrates the app to TypeScript.
The current version of the viewer is extremely hacked together and buggy. This is due to the fact that I originally wanted to just make a CLI tool here, and hacked the UI on top. Additionally at the time we did not have Hokaku so raw RMC messages were handled completely separately from other packets, despite having nearly identical logic
This rewrite builds on what we have learned since then, focussing on a UI-first application (rather than CLI with a hacked UI on top of it), and takes notes from our Go libraries on how to handle certain patterns
Data serialization now makes much more sense and has been standardized, as opposed to the current viewer which handles some serialization differently resulting in a hacky front end
Some key changes:
nex-keys.txt
has been deprecated. Since some games use use different key derivation methods it's not reliable to just use the pre-hashed keys anymore. Now all game server accounts are stored in the applicationssettings.json
file as an array of objects. The objects fields areplatform
- The platform the account is for. Unused currently, will be used in the future to support non-NEX platformsusername
- The username. On NEX this is the string representation of thepid
valuepid
- Account PIDpassword
- Plain-text password. Used to derive the other password, including any non-NEX standard ones in the futurepassword_hash_old
- Pre-hashed NEX password using old key derivationpassword_hash_new
- Pre-hashed NEX password using new key derivationtitles.json
has been restructured and now contains asettings
object for stream settingsstring_length_size
is not currently used. It is not possible to use this information at this time, as we need to know which title the packet is for BEFORE parsing it. This is not possible to do as the title is not determined until AFTER the firstSYN
packet arrives. This means Rendez-Vous connections which use non-NEX settings will fail heretitles.json
entirely in favor of making each title it's own JavaScript class. This way a title may define more complex settings, like a custom compression algorithm, or custom checksum algorithm (such as the custom checksums seen in WATCH_DOGS)toJSON
function MUST return an object__displayTypeName
and__typeName
fields__displayTypeName
is to be used when displaying the types data in the UI. Some types, such asList
,Map
, etc. may reference other information about themselves in this value, making it inadequate for type referencing__typeName
is the types original name, and is to be used when the program needs to check what the type of the object isString
,Bool
, etc. will set their value in the__value
field. This can be either a primitive value (such as the value of aBool
) OR another data type (such as the value of aAnyDataHolder
)RVConnectionData
, etc.) will set these is a__fields
object. The keys of the__fields
object are the field names, and the values are the field valuesStructure
types store the structure version number in a__version
field__version
__displayTypeName
__typeName
__value
or__fields
__parent
field ABOVE the__version
field__typeName
isMap
, this must be handled in a special way. In this case the__value
field is used, and is set to an array (much likeList
) where each element is an object. The objects have two fields,key
andvalue
each being a data type (not a primitive). This is the only case of special handling, as ANY type may be both a key or a value which doesn't play well with JavaScript (or most languages)Session
has been introduced. ASession
simply represents a user's play session. It parses a single packet dump to look forConnection
sConnection
is no longer identified by a string discriminator made from the address. Now it uses a combination of the address, port, and connection stream settings. This allows for titles which reuse connections with multiple streams (such as Rayman Legends) to properly split each stream into it's own connectionRVConnectionData
are a separate server to the main secure server. When the StationURL is populated and the protocol list is not empty, clients will connect to BOTH the main and special stations. When clients make an RMC request, it checks the protocol ID and decides which to send it to. No known NEX titles use this feature, however it is partially checked now (though incomplete)