/// Node info struct.
typedef struct {
u64 uds_friendcodeseed;//UDS version of the FriendCodeSeed.
- u8 usercfg[0x18];//This is the first 0x18-bytes from this config block: https://www.3dbrew.org/wiki/Config_Savegame#0x000A0000_Block
+
+ union {
+ u8 usercfg[0x18];//This is the first 0x18-bytes from this config block: https://www.3dbrew.org/wiki/Config_Savegame#0x000A0000_Block
+
+ struct {
+ u16 username[10];
+
+ u16 unk_x1c;//Unknown. Set to 0x0 with the output from udsScanBeacons().
+ u8 flag;//"u8 flag, unknown. Originates from the u16 bitmask in the beacon node-list header. This flag is normally 0 since that bitmask is normally 0?"
+ u8 pad_x1f;//?
+ };
+ };
//The rest of this is initialized by NWM-module.
u16 NetworkNodeID;
u8 total_nodes;
u8 max_nodes;
- u8 node_bitmask;//"This is a bitmask of NetworkNodeIDs: bit0 for NetworkNodeID 0x1(host), bit1 for NetworkNodeID 0x2(first original client), and so on."
- u8 unk_x2f;//"Padding maybe? Normally 0. "
+ u16 node_bitmask;//"This is a bitmask of NetworkNodeIDs: bit0 for NetworkNodeID 0x1(host), bit1 for NetworkNodeID 0x2(first original client), and so on."
} udsConnectionStatus;
/// Network struct stored as big-endian.
{
len = 10;
- memset(nodeinfo->usercfg, 0, len*2);
+ memset(nodeinfo->username, 0, sizeof(nodeinfo->username));
- units = utf8_to_utf16((uint16_t*)nodeinfo->usercfg, (uint8_t*)username, len);
+ units = utf8_to_utf16((uint16_t*)nodeinfo->username, (uint8_t*)username, len);
if(units < 0 || units > len)ret = -2;
}
ssize_t units=0;
size_t len = 10;
- units = utf16_to_utf8((uint8_t*)username, (uint16_t*)nodeinfo->usercfg, len);
+ units = utf16_to_utf8((uint8_t*)username, (uint16_t*)nodeinfo->username, len);
if(units < 0 || units > len)return -2;
return 0;