DWCMatchedSCCallback

C Specification

#include <dwc.h>

typedef void (*DWCMatchedSCCallback)(DWCError error,
                                      BOOL cancel,
                                      BOOL self,
                                      BOOL     isServer,
                                      int index,
                                      void* param);

Description

This function is called when only a connection has been established or when an error or cancellation occurs after the DWC_SetupGameServer or DWC_ConnectToGameServerAsync functions have been called. If an error occurs, the values of all arguments other than error and param are undefined.

This callback function can be set using DWC_SetupGameServer or DWC_ConnectToGameServerAsync.

Arguments

error DWC error type For details, see DWC_GetLastErrorEx.
cancel TRUE: A matchmaking cancellation was detected.
FALSE: The matchmaking was a success or an error was detected.
self TRUE: One's own DS has successfully connected to the server DS and its network, or the matchmaking was cancelled.
FALSE: Another client DS successfully connected to the server DS and its network, or the matchmaking was cancelled.
isServer TRUE: The server DS cancelled matchmaking.
FALSE: The client DS has successfully connected to the server DS and its network or the matchmaking was cancelled.
index Matchmaking was a success or the friend roster index of the cancelled host. Value is -1 if the host is not a friend or if self = TRUE.
param Parameter for the callback specified by DWC_SetupGameServer or DWC_ConnectToGameServerAsync.

Possible combinations of argument values

When error == DWC_ERROR_NONE && cancel == FALSE
self isServer Description
TRUE TRUE None.
TRUE FALSE One's own DS is the client DS, and the connection to the server DS and its network is successful. The index is -1.
FALSE TRUE None.
FALSE FALSE One's own DS is the server or client DS and another client DS successfully connected to the server DS and its network. The index is the friend roster index of that client DS. If not a friend, it is -1.

When error == DWC_ERROR_NONE && cancel == TRUE
self isServer Description
TRUE TRUE One's own DS is the server DS, and that DS has cancelled matchmaking. The index is -1.
TRUE FALSE One's own DS is the client DS, and that DS has cancelled matchmaking. The index is -1.
FALSE TRUE One's own DS is the client DS, and the server DS has cancelled matchmaking. The index is the friend list index of the server DS.
FALSE FALSE One's own DS is the client or server DS, and another client DS has cancelled matchmaking. The index is the friend roster index of that client DS. If not a friend, it is -1.

Return Values

None.

See Also

DWC_SetupGameServer, DWC_ConnectToGameServerAsync, DWC_GetLastErrorEx

Revision History

08/24/2006 Corrected a mistake listed under allowable argument combinations.
12/16/2005 Added a description about the callback configuration functions. Added a table of the values that the argument can take
11/01/2005 Initial version.


CONFIDENTIAL