DWC_GetFriendStatusDataSC

C Specification

#include <dwc.h>

u8 DWC_GetFriendStatusDataSC( const DWCFriendData* friendData,
                              u8*   maxEntry,
                              u8*   numEntry,
                              char* statusData,
                              int* size);

Description

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

A player's communication status is made up of the status flag expressed in this function's return value and the status character string. The player status is managed on the GameSpy server. This function presumes the status character to be a Base-64 encoded character string and obtains the status data (the statusData argument) by decoding it. In addition, server DS-specific information is included during server-client matchmaking. The status flag and the server DS-specific information are automatically set by the DWC library, but 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_GetFriendStatusData function if there is no need to obtain any specific information during 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 sensitive of this fact when you need to check status several times in a short period.

Arguments

friendData The pointer to the type DWCFriendData friend information.
maxEntry When the partner is the server DS during server-client matchmaking, this pointer stores the maximum number of connectable devices. Otherwise, 0.
numEntry When the partner is the server DS during server-client matchmaking, this pointer stores the current number of connected devices that were obtained. Otherwise, 0.
statusData The pointer to where the friend status data is stored. If NULL is passed, the data will not be copied.
size The pointer to where the friend status data length is stored. -1 is stored in the case of invalid data.

Return Values

DWC_STATUS_OFFLINE Offline
(Indicates the DWC is offline or that the friendship with the partner is not 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_GetFriendStatusData, DWC_SetOwnStatusString, DWC_SetOwnStatusData

Revision History

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