Updated udsNodeInfo and udsConnectionStatus. Updated the related code for udsNodeInfo.

This commit is contained in:
yellows8 2016-04-07 16:31:26 -04:00
parent 570c834679
commit daba63af69
2 changed files with 16 additions and 6 deletions

View File

@ -19,7 +19,18 @@
/// Node info struct. /// Node info struct.
typedef struct { typedef struct {
u64 uds_friendcodeseed;//UDS version of the FriendCodeSeed. 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. //The rest of this is initialized by NWM-module.
u16 NetworkNodeID; u16 NetworkNodeID;
@ -37,8 +48,7 @@ typedef struct {
u8 total_nodes; u8 total_nodes;
u8 max_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." u16 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. "
} udsConnectionStatus; } udsConnectionStatus;
/// Network struct stored as big-endian. /// Network struct stored as big-endian.

View File

@ -148,9 +148,9 @@ Result udsGenerateNodeInfo(udsNodeInfo *nodeinfo, const char *username)
{ {
len = 10; 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; if(units < 0 || units > len)ret = -2;
} }
@ -165,7 +165,7 @@ Result udsGetNodeInfoUsername(const udsNodeInfo *nodeinfo, char *username)
ssize_t units=0; ssize_t units=0;
size_t len = 10; 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; if(units < 0 || units > len)return -2;
return 0; return 0;