DWCMatchedSCCallback

Syntax

#include <dwc.h>

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

Description

This function is called when a connection has been established or when an error or cancellation occurs after the DWC_SetupGameServer or the DWC_ConnectToGameServerAsync function has 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: Matchmaking was a success or an error was detected.
self TRUE: One's own DS successfully connected to the server DS and its network, or cancelled matchmaking.
FALSE: Another client DS successfully connected to the server DS and its network, or cancelled matchmaking.
isServer TRUE: The server DS cancelled matchmaking.
FALSE: The client DS has successfully connected to the server DS and its network, or cancelled matchmaking.
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 Content
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

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


CONFIDENTIAL