DWC_GetFriendStatusData

Syntax

#include <dwc.h>

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

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 assumes that status is a character string encoded in Base64. The function obtains the status data (the statusData argument) by decoding status. 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.

This function takes several hundred microseconds. Be aware of this fact when you need to check status several times during a short interval.

Arguments

friendData The pointer to the type DWCFriendData friend information.
statusData Pointer to where the friend status data is stored. If NULL is passed, the data is not copied.
size Pointer to where the friend status data length is stored. -1 is stored if data is invalid.

Return Values

DWC_STATUS_OFFLINE Offline (indicates that the DWC is offline or that friendship with the partner has not yet been established).
DWC_STATUS_ONLINE Online (logged in to a Wi-Fi Connection server).
DWC_STATUS_PLAYING In-game (after matchmaking has completed).
DWC_STATUS_MATCH_ANYBODY In connect-to-anybody peer matchmaking.
DWC_STATUS_MATCH_FRIEND In connect-to-friends peer matchmaking.
DWC_STATUS_MATCH_SC_CL Client DS undergoing server-client matchmaking.
DWC_STATUS_MATCH_SC_SV Server DS undergoing server-client matchmaking.

See Also

DWC_GetFriendStatus
DWC_GetFriendStatusSC
DWC_GetFriendStatusDataSC
DWC_SetOwnStatusString
DWC_SetOwnStatusData

Revision History

2005/12/16 Added a description about the networking states and introduced other similar functions.
2005/11/07 Initial version.


CONFIDENTIAL