Updated udsNodeInfo and udsConnectionStatus. Updated the related code for udsNodeInfo.
This commit is contained in:
parent
570c834679
commit
daba63af69
@ -19,8 +19,19 @@
|
||||
/// Node info struct.
|
||||
typedef struct {
|
||||
u64 uds_friendcodeseed;//UDS version of the FriendCodeSeed.
|
||||
|
||||
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;
|
||||
u16 pad_x22;
|
||||
@ -37,8 +48,7 @@ typedef struct {
|
||||
|
||||
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.
|
||||
|
@ -148,9 +148,9 @@ Result udsGenerateNodeInfo(udsNodeInfo *nodeinfo, const char *username)
|
||||
{
|
||||
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;
|
||||
}
|
||||
@ -165,7 +165,7 @@ Result udsGetNodeInfoUsername(const udsNodeInfo *nodeinfo, char *username)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user