DWC_GetFriendStatusData

Syntax

#include <dwc.h>

u8 DWC_GetFriendStatusData(const DWCFriendData *friendData,
                           char *statusData,
                           int *size);

Arguments

friendData Pointer to DWCFriendData type friend data.
statusData Pointer to where the friend's status data is stored. If NULL is passed, the data is not copied.
size Pointer to where the length of the friend's status data is stored. In the case of invalid data, -1 is stored.

Return Values

DWC_STATUS_OFFLINE Offline
(Indicates that oneself is offline or that friendship with the other party has not yet been established.)
DWC_STATUS_ONLINE Online (Logged in to a Wi-Fi Connection server.)
DWC_STATUS_PLAYING Currently playing a game as a client (does not depend on matchmaking type)
Currently playing a game as a server, after at least one server exchange, when using friend-specified matchmaking or server-client matchmaking
Either of the above states indicate that the local host cannot proceed to connection with this other party. (The PLAYING state is not a state that accepts connection.)
DWC_STATUS_MATCH_ANYBODY Currently searching for a connection partner during peer matchmaking with friend unspecified
Currently playing a game as a server during peer matchmaking with friend unspecified
DWC_STATUS_MATCH_FRIEND Currently searching for a connection partner during peer matchmaking with friend specified
Currently playing a game as a server during peer matchmaking with friend specified
DWC_STATUS_MATCH_SC_CL Currently connecting to a server as a client host during server-client matchmaking
Currently connecting to a server as a group ID connection client host
DWC_STATUS_MATCH_SC_SV Currently playing a game as a server host during server-client matchmaking

Description

This function gets the communication status of the friend specified with friendData. The GameSpy server sends a notification each time the friend's communication status changes. This is saved in the internal cache of the DWC library. Therefore, this function references that status and does not perform any communications.

A player's communication status is made up of the status flag, returned by this function, and the status character string. The player status is managed on the GameSpy server. This function presumes that the status string is a character string encoded in Base64. The function obtains the status data (the statusData argument) by decoding the status string. The status flag is automatically set by the DWC library. However, the application can set the status data by using the DWC_SetOwnStatusData function. The data specified by this function is encoded in Base64 and sent to the GameSpy server as the status character string.

Use the DWC_GetFriendStatusDataSC function to obtain specific information in server-client matchmaking. Also, for applications where character strings (rather than binary data such as statusData) are set with the DWC_SetOwnStatusString function, get the binary data by using the DWC_GetFriendStatus or DWC_GetFriendStatusSC function.

Revision History

2.0.0
Changed the return value specification.
1.2.1
Deleted notes regarding execution speed.

CONFIDENTIAL