`AnyDataHolder`/`Data` and their inconsistent/possibly incorrect documentation
The current wiki has some issues/inconsistencies when it comes to what is currently documented as "AnyDataHolder". This can be broken up into 2 parts:
- Inconsistent documentation in the wiki itself
- Misunderstanding of what the structure actually seems to be
The wiki seems to refer to "AnyDataHolder" by several names, some of which can be confusing as some of the names it goes by are reused by other types (at times incorrectly as well). Such as:
- https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol#request-1 where
oExtraDatais documented asAny< AuthenticationInfo>. In this caseAnylinks toAnyDataHolder - https://github.com/kinnay/NintendoClients/wiki/Secure-Protocol#request-3 where
hCustomDatais simply documented asData. In this caseDatalinks toAnyDataHolder - https://github.com/kinnay/NintendoClients/wiki/Messaging-Protocol#usermessage-structure which says that it inherits from
Data, but links toAnyDataHolderwhen in reality it inherits fromDatahttps://github.com/kinnay/NintendoClients/blob/2373fbe6d685af037b81bc6604c5623ce8c8e141/nintendo/nex/messaging.py#L39 - https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol#nulldata-structure which correctly says it inherits from
Dataand links to the properData - There is likely also more, these are just the first few I found while searching
This inconsistent naming of types can make it sometimes confusing at a glance as to what these types actually are when reading the wiki
Additionally some areas seem to be incorrectly documenting some fields/types as using what is called "AnyDataHolder" when they actually use something else. In reality it seems like the true name is AnyObjectHolder (in fact, I could not find any mentions of "AnyDataHolder" in any of the games I looked at), and then other types build off this type to form more type-specific *Holder types, such as DataHolder and GatheringHolder (these names were confirmed to be the real names based on old debug logs found in some games). That explains both:
- Why the documentation of the current "AnyDataHolder" reads
This class can hold any object derived from a given base class (usually nn::nex::Data). The "usually" implying that sometimes non-Datatypes can be found here. Which seems to be wrong, they can't be found here it's a different*Holdertype - Why types like
Gatheringare documented as being found insideAnyDataHoldertypes despite not inheriting fromData(it usesGatheringHolder)
It also seems that, based on some implications of some signatures found in some Wii U titles, that the "type name" portion of the holder does NOT need to be a string? AnyObjectHolder seems to be a template class which takes in a base parent type (Data, Gathering, etc.), and then a 2nd type. In all cases we have seen the 2nd type is nn::nex::String, which we believe is how the holder determines what the "identifier" type will be (what is currently called the "type name"). For example, the signature for SecureConnection::RegisterEx types the hCustomData field as nn::nex::AnyObjectHolder<nn::nex::Data, nn::nex::String>
@DaniElectra and I did quite a bit of research into this a while ago on Discord, and I've compiled our notes on these changes in 2 places:
- https://github.com/PretendoNetwork/nintendo-wiki/issues/34
- https://github.com/PretendoNetwork/nex-go/issues/74 (has most of the details from our notes)