DWC_UpdateServersAsync

Syntax

#include <dwc.h>

BOOL DWC_UpdateServersAsync(const char *playerName,
                            DWCUpdateServersCallback updateCallback,
                            void *updateParam,
                            DWCFriendStatusCallback statusCallback,
                            void *statusParam,
                            DWCDeleteFriendListCallback deleteCallback,
                            void *deleteParam);

Arguments

playerName Specify NULL. Retained for compatibility with past versions.
updateCallback Pointer to the friend roster synchronization process completion callback function.
updateParam Parameter for the friend roster synchronization process completion callback.
statusCallback Pointer to the callback function that notifies the user about changes to friend status. Even if the friend roster synchronization process has completed, this callback function is called each time there are changes to a friend's communication status.
statusParam Parameter for the callback that notifies the user about changes to friend status.
deleteCallback Pointer to the callback function that deletes information from the friend roster. Even if the friend roster synchronization process has completed, there is the possibility that this callback function may be called when a friend relationship is established.
deleteParam Parameter for friend roster deletion callback.

Return Values

TRUE Start friend roster synchronization. The results are indicated via the callback function.
FALSE Not a good state for calling this function.

Description

Synchronizes the GameSpy server and local friend rosters. In order to perform this synchronization, everything up through the login performed by the DWC_LoginAsync function must first be completed.

Set the friend roster in advance by using the DWC_InitFriendsMatch function.

The primary synchronization for the friend roster includes sending friend relationship requests to friends on the local friend roster but not on the GameSpy server friend roster. It also includes deleting friend information on the GameSpy server friend roster that is not on the local friend roster. Even if the partner who is sent the friend relationship request is offline, the request is saved on the GameSpy server. It is then delivered immediately after the partner next logs in using the DWC_LoginAsync function. The friend relationship is established only when the partner also has this information on his local friend roster. However, this only registers the partner as a friend on the system of the person sending the request. Partners that receive friend relationship requests automatically follow the same process to register the requesting party as a friend.

Bear in mind that the friend roster synchronization process completion callback is called only after all the local and GameSpy server friend rosters are checked, the necessary friend relationship requests are sent, and the unnecessary friend information is deleted. Even though a callback has been returned, it does not mean that all friend relationships have been established.

When the isChanged argument of the friend roster synchronization completion callback is TRUE, this indicates that some of the friend information in the local friend roster has been updated and the local friend roster must be saved. If friend relationships are established outside of the friend roster synchronization, the configured friend relationship establishment callback is called with the DWC_SetBuddyFriendCallback function.

Also, if multiple friend information entries about the same friend are found in the roster during friend roster synchronization, all but one of those entries will be deleted. Indices inside the friend rosters in deleted friendship information and indices that are determined to be identical information are considered to be arguments. Whenever they are deleted, the callback is called.

Revision History


CONFIDENTIAL