peerStartAutoMatchWithSocket

GameSpy SDK

peerStartAutoMatchWithSocket

Start an automatch attempt using an external managed socket.

void peerStartAutoMatchWithSocket(
PEER peer,
int maxPlayers,
const gsi_char * filter,
SOCKET socket,
unsigned short port,
peerAutoMatchStatusCallback statusCallback,
peerAutoMatchRateCallback rateCallback,
void * param,
PEERBool blocking );
RoutineRequired HeaderDistribution
peerStartAutoMatchWithSocket<peer.h>SDKZIP

Parameters

peer
[in] Initialized peer object.
maxPlayers
[in] Total number of players to match. (Includes local player).
filter
[in] Hard filter for returned server list.
socket
[in] Socket to be used for reporting.
port
[in] Local port to which the socket is bound.
statusCallback
[in] Callback function to be called when the status changes.
rateCallback
[in] Callback function to be called when a potential match should be rated.
param
[in] Pointer to user data. This is optional and will be passed unmodified to the callback function.
blocking
[in] When set to PEERTrue this function will not return until the operation has completed.

Remarks

The peerStartAutoMatch function begins the AutoMatch process using the specified socket being shared. The function takes a maxPlayers parameter, which specifices the maximum number of people that should be in the final match. For example, if the local player wants to player a 3v3 match, maxPlayers should be 6. The match can be started before the maxPlayers is reached, for example if an exact number of players is not needed, but an upper limit must still be specified.
The filter is a SQL-type filter, just like the filter used in peerStartListingGames(). It is used to rule out matches that are not acceptable. Potential matches that do not pass the filter will not be passed to the rating callback. The statusCallback is called whenever the status of the match changes, until either peerStopAutoMatch() is called, or the statusCallback is called with a status of PEERFailed or PEERComplete. The rateCallback is used to rate possible matches.

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
peerStartAutoMatchWithSocketpeerStartAutoMatchWithSocketApeerStartAutoMatchWithSocketW

peerStartAutoMatchWithSocketW and peerStartAutoMatchWithSocketA are UNICODE and ANSI mapped versions of peerStartAutoMatchWithSocket. The arguments of peerStartAutoMatchWithSocketA are ANSI strings; those of peerStartAutoMatchWithSocketW are wide-character strings.

Section Reference: Gamespy Peer SDK